문제

I am trying to integrate Paypal with one of the registration forms in my site. The flow is like this:

  1. The user visits the registration page and fills out his details, like first name, last name, username, password, age, etc.
  2. 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.
  3. 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?

  1. Should i use any custom hidden fields in the form to store these form values, and if so, is there any size limit?
  2. 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.

도움이 되었습니까?

해결책

I suggest making a registration without instant payment, but making their account inactive. This way you will get user id and put it in the custom field. Uppon a successful payment, activate user's account. Here is an example of the IPN script. https://cms.paypal.com/cms_content/US/en_US/files/developer/IPN_PHP_41.txt

You will need a business account for this to work.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top