I am trying to integrate Paypal with one of the registration forms in my site. The flow is like this:
- The user visits the registration page and fills out his details, like first name, last name, username, password, age, etc.
- Then on clicking submit button, he navigates to the paypal site, pays some amount like 5$ and after successful payment, returns back to my site.
- The registration is not yet complete. I want to check whether the payment is successful or not, and if it is successful, then i have to insert the user data (filled prior to submitting the registration form) into the database.
Now my question is, how can i keep track of user data filled in the form and sent to paypal? What is my best bet?
- Should i use any custom hidden fields in the form to store these form values, and if so, is there any size limit?
- Should i store the entire form data in a session, and after succesful payment, use this session data to insert into db?
Or is there any other way of doing it?
I just want to get back all the form values after a successful payment, and only then, i can insert them into the database. I prefer sandbox testing prior to using real paypal.