Subscribe to PHP PayPal with IPN

I am trying to find out how I can add a PayPal subscription to an existing PHP application using IPN and look for a good article that explains all the ins and outs.

In my application, users can register for a free account, and then they can choose the type and rate for membership (daily, weekly, monthly and yearly). When they make their choice, the configured PayPal button will be displayed. They can click the "Subscribe" button, which will lead them to PayPal.

I need to know how to identify the user: what user information is sent to PayPal, which is then sent back? I would also like to know what information PayPal sends to the IPN page.

It seems that the button can be configured to specify a URL. Does this mean that I still need to enable IPN?

I just have too many questions to list here ... There is no training material on PayPal that explains Subscriptions and how to integrate it into the site.

Any good and recent articles you know about?

+7
source share
2 answers

There are many articles, just Google. The date does not matter, most of the basic functions are basically the same, they do not change it, because a ton of people rely on the fact that it is the same. What you really need to do is look at the paypal documentation, it's thorough enough, and even have code samples. Including for subscription, do you think the people who wrote the articles, and all who implemented it, did it? Did they just guess and hope for the best?

Then make yourself an account in the paypal sandbox. Want to know what IPN returns? Configure the script to catch the IPN message and save all the $ _POST data to a file and see for yourself using the sandbox to execute a fake order. What I did when implementing PayPal. Of course, the return values ​​are also noted in the docs.

Edit

I believe that the field they send back is called normal. You can capture a field that you are not using, such as a product number. Or maybe use the payer_id field. Or indicate them by email. There is more than one way to do this. The best way to find out though is to try it out on the sandbox, rather than wait for someone to do it for you or write an article. You could save yourself 3 days of reading if you tried.

References

Found them after about 2 minutes, more than enough information to get this work.

Various tutorials for IPN and subscription:
http://net.tutsplus.com/tutorials/php/using-paypals-instant-payment-notification-with-php/
http://www.web-development-blog.com/archives/easy-payments-using-paypal-ipn/
http://www.paymentsplus.com.au/joomla/faq/paypal-buy-now-guide.html

Sandbox:
https://developer.paypal.com/devscr?cmd=_signup-run

Paypal Documentation:
https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_subscribe_buttons (this is the one you really want)
https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_admin_IPNIntro

+2
source

anon445699, I completely agree with you regarding the subscription information, which basically shows you how to create a button without parameters.

Maybe this will help some people in the future, it will give all the possible options for a subscription. I know this helped me https://www.paypalobjects.com/en_US/ebook/subscriptions/html.html

+3
source

All Articles