Paypal IPN 回调带参数
我想在用户付款后自动执行一个流程。
1) 用户在表单上输入详细信息并提交,会话将唯一 ID 传递给 paypal 2)用户完成paypal付款后,唯一的ID将传回我的服务器,以便脚本读取并注册到数据库中。
我该怎么做?
Possible Duplicate:
Can I send a variable to paypal, and have it post it back to me when payment completes?
I want to automate a process after user have made a payment.
1) User enter details on forms and submit, the session will pass unique ID to paypal
2) After user complete the paypal payment, unique ID is then pass back to my server for the script to read and register into db.
How do I do that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我个人使用过 Micah Carrick 的 Paypal IPN 类。
当用户提交表单并生成 ID 时,您可以实例化该类并执行以下操作:
自定义 字段对于您的目的来说是最重要的字段,您可以在此处放置任何您想要的内容,它将通过对您设置的 notify_url 脚本的 IPN 调用返回。
在此通知页面上,您可以验证 IPN 调用并检索自定义变量以执行您想要的操作...
请记住在您的 Paypal 帐户中启用 IPN 回调。
I've personally used Micah Carrick's Paypal IPN class.
When the user submits the form and the ID is generated, you can instantiate the class and do something like this:
The custom field is the most important one for your purpose, you can put whatever you want here and it'll be returned with the IPN call to the notify_url script you have set.
On this notification page, you can validate the IPN call and retrieve the custom variable to do what you want with it...
Remember to enable IPN callbacks in your Paypal account.
不幸的是,您的简单问题并不能很好地解决手头的任务。我建议查看 PayPal 的 IPN 文档,查看 PayPal IPN PHP 示例代码(或通过 Google 搜索人们构建的 IPN 类)。您可能还需要使用 PayPal 开发人员的 IPN 模拟器工具来测试代码。
...最后但并非最不重要的一点是,您需要在实际的 PayPal 商家帐户中设置各种配置,因此值得花一些时间来了解其中的内容。
我最近第一次做这一切。我希望它像即插即用一样简单。玩&开始收钱。它不是。
Unfortunately your simple question doesn't do justice to the task at hand. I recommend looking into PayPal's IPN documentation, checking out the PayPal IPN PHP sample code (or Googling for IPN classes people have built). You'll also likely need to test the code using PayPal Developers' IPN Simulator Tool.
... and last but not least, there's various configurations you need to set in your actual PayPal merchant account, so it's worth taking some to understand what's there.
I recently did all this for the first time. I wish it was as easy as plug & play & start receiving money. It's not.