带 IPN 的 PHP PayPal 订阅

发布于 2024-10-11 15:18:05 字数 1539 浏览 4 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

扮仙女 2024-10-18 15:18:05

anon445699,我完全同意你关于订阅信息的看法,它主要向你展示如何生成一个没有参数的按钮。

也许这会对将来的某些人有所帮助,它概述了订阅的所有可能参数。我知道这对我有帮助
https://www.paypalobjects.com/en_US/ebook/subscriptions/html.html

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

深海里的那抹蓝 2024-10-18 15:18:05

那里有很多文章,google一下就可以了。日期并不那么重要,大多数主要功能基本上是相同的,他们不会对其进行太多更改,因为很多人都依赖它是相同的。不过,您真正需要做的是查看 paypal 的文档,它非常全面,甚至还有代码示例。包括订阅在内,您认为写文章的人和实施它的每个人是如何做到的?他们只是猜测并期待最好的结果吗?

接下来让自己在 PayPal 沙盒上获得一个帐户。想知道 IPN 发回什么内容?设置一个脚本来捕获 IPN 帖子,并将所有 $_POST 数据保存到文件中,并亲自查看如何使用沙箱完成虚假订单。这就是我在实施 paypal 时所做的。当然,文档中也注明了返回值。

编辑

我相信他们将发回的字段称为自定义。您可以劫持您不使用的字段,例如产品编号。或者可以使用 payer_id 字段。或者通过他们的电子邮件来识别他们。做到这一点的方法不止一种。不过,找出答案的最佳方法是在沙箱上尝试,而不是等待有人为您做或写一篇文章。如果你愿意尝试的话,你可以节省三天的阅读时间。

链接

大约 2 分钟就找到了这些,其中的信息足以完成工作。

各种IPN和订阅教程:
http://net.tutsplus.com/教程/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

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

贝宝文档:
https://cms.paypal.com/ us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_html_subscribe_buttons (这是您真正想要的)
https://cms.paypal.com/ us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_admin_IPNIntro

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文