有人可以向我展示“hello world”吗?贝宝IPN?

发布于 2024-09-07 18:15:04 字数 145 浏览 0 评论 0原文

我想设置一个 PayPal 捐款箱,并使用他们的 IPN 协议来监控捐款何时到达。该文档非常复杂,并且充满了我不感兴趣的功能。是否有一个简短的片段 - 最好是用 Python 编写的——这展示了如何连接到 Paypal,永远循环,并在每次捐款进来时打印“刚刚收到 5 美元”?

I'd like to set up a PayPal donation box, and use their IPN protocol to monitor when donations come in. The documentation is enormously complex and full of features I'm not interested in. Is there a short snippet -- ideally in Python -- that shows how to, say, connect to Paypal, loop forever, and print "Just got $5" every time a donation comes in?

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

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

发布评论

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

评论(1

你在看孤独的风景 2024-09-14 18:15:04

事实上,对于 IPN,情况正好相反。付款后,PayPal 通过 HTTP POST 向您的服务器发布通知。因此,您需要制作一个 CGI 脚本或服务器来接收这些帖子、检查其有效性并处理它们。

设置 IPN 处理器最简单的示例代码可能是 PHP 示例代码:

https://cms.paypal.com/cms_content/US/en_US/files/developer/IPN_PHP_41.txt

但有一整套代码片段:

https://github.com/paypal/ipn-code-samples

您不应该跳过官方文档,因为它涵盖了如何管理设置和测试 IPN。它位于:

https://www.paypalobjects.com/webstatic /en_US/developer/docs/pdf/ipnguide.pdf

特别是,请参阅第 2-4 章。

Actually, with IPNs it's the other way around. PayPal posts a notification to your server via HTTP POST when a payment is made. You therefore need to make a CGI script or server that receives these posts, checks their validity, and processes them.

Probably the easiest sample code to look at for setting up an IPN processor is the PHP sample code at:

https://cms.paypal.com/cms_content/US/en_US/files/developer/IPN_PHP_41.txt

but there's a whole set of code snippets at:

https://github.com/paypal/ipn-code-samples

You shouldn't skip the official documentation because it covers how to administratively set up, and test, IPNs. It's at:

https://www.paypalobjects.com/webstatic/en_US/developer/docs/pdf/ipnguide.pdf

In particular, see chapters 2-4.

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