开发者

Paypal form integration with registration form

开发者 https://www.devze.com 2023-04-02 03:25 出处:网络
I am try开发者_StackOverflow社区ing to integrate Paypal with one of the registration forms in my site.

I am try开发者_StackOverflow社区ing 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消