PHP PayPal Subscription with IPN [closed]
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this questionI am trying to learn how I can add PayPal Subscription to my existing PHP app using IPN and looking for a good article that explains the ins-and-outs.
In my app, users can register for a free account and then they can select a membership type and rate (daily, weekly, monthly and yearly). When they have made their selection, the configured PayPal button is displayed. They can click the Subscribe button which takes them to PayPal.
I need to know how to identify the user: what 开发者_如何学Gocustom information to send to PayPal that is then sent back? I would also like to know what information PayPal sends back to the IPN page.
It seems that the button can be configured for the notify url. Does that mean I still have to turn on IPN?
I just have too many questions to list here... The PayPal site does not have any teaching material that explains Subscriptions and how to integrate it into a site.
Any good and recent articles you know of?
anon445699, I completely agree with you about the subscribe information it mostly shows you how to generate a button with no parameters.
Maybe this will help some people in the future, it oulines all the possible parameters for subscriptions. I know it helped me https://www.paypalobjects.com/en_US/ebook/subscriptions/html.html
There are plenty of articles out there, just google it. The date doesn't matter as much, most of the main functionality is basically the same, they don't change it much because a ton of people rely on it being the same. What you really need to do though, is look at the documentation at paypal, its quite thorough, and even has code samples. Including for subscriptions, how do you think the people who wrote articles, and everyone who has implemented it did it? Did they just guess and hope for the best?
Next get yourself an account on the paypal sandbox. Want to know what the IPN sends back? Setup a script to catch an IPN post, and save all the $_POST data to a file, and see for yourself using the sandbox to complete a fake order. Thats what I did when implementing paypal. Of course, the return values are also noted in the documents as well.
Edit
I believe the field they will send back is called custom. You could hijack a field you are not using, like productnumber. Or maybe use the payer_id field. Or identify them with their email. There is not just one way to do it. The best way to find out though, is to try it on the sandbox rather than waiting for someone to do it for you or write an article. You could have saved yourself 3 days of reading if you would just try it.
Links
Found these in about 2 minutes, there is more than enough info in these to get the job done.
Various IPN and subscription tutorials:
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
精彩评论