I am using Titanium studio to build an iphone mobile app, and I want to do the following
- Send a user id using API to my server
- Server processes payment for that user using the previous card on file
- Server sends a success/failure response.
What is the most secure way to do this? I know if I just send the user id then anyone could hack.
Are you sure what your doing is allowed (roll-your-own Payments and credit cards in-app will generally get you rejected)
Make sure your app does not violate any of these guidelines:
Check the latest App store review guidelines here : https://developer.apple.com/appstore/resources/approval/guidelines.html
Also refer to these SO questions for more information:
iPhone Paypal in UIWebView Appstore approval process
iOS – Integrating credit card payments
A more secure way to do this (if you pass all the above guidelines) would be to use a userid, password, and salt, encrypted either over
httpsorSHA256. Note that you have to specify you use encryption if you go the second route, during the review process.Here is a wikipedia article about Salt and Passwords that I used.
Here is a SHA256 library for JavaSCript that works great with Titanium and is simple to use.