成功付款后的PayPal POST数据 [英] PayPal POST data after successful payment

查看:87
本文介绍了成功付款后的PayPal POST数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试制作一个将与MySQL交互的PHP应用程序. 我已经有一个获取POST数据的页面,获取它后,它将为用户提供信用". 成功下订单后,PayPal按钮可以向我发送帖子数据吗? 或还有其他方法吗? (最有可能更简单,更安全)

I am trying to make an PHP app, that will interact with MySQL. I already have an page that gets POST data, and after it gets it, it gives "credit" to user. Can PayPal button after successful order send me an post data? or is there any other way? (most likely simplier and more secure)

推荐答案

是的,看看PayPal即时付款通知(IPN)- https://www.paypal.com/ipn/
每当交易开始时,这将强制将交易数据的POST发送给您.如果您当前使用网站付款标准"(基于HTML的按钮),则只需添加

Yes, have a look at PayPal Instant Payment Notification (IPN) - https://www.paypal.com/ipn/
This will force a POST of transactional data to be sent to you whenever a transaction has been initiated. If you currently use Website Payments Standard (HTML based buttons), you can simply add

<input type="hidden" name="notify_url" value="http://full-URL-to-the-script-you-set-up-for-IPN">

您需要获取从贝宝(PayPal)收到的所有POST数据,附加cmd = _notify-validate并将其发送回 https://www.paypal.com/cgi-bin/webscr (或 https://www.sandbox.paypal.com/cgi-bin/webscr (针对沙盒),以验证IPN消息.
根据此结果,您将返回INVALID或VERIFIED响应.
无效可能意味着IPN POST并非源自PayPal,而已验证则意味着IPN POST已被验证为确实来自PayPal.

You'll need to take all POST data you received from PayPal, append cmd=_notify-validate and send it back to https://www.paypal.com/cgi-bin/webscr (or https://www.sandbox.paypal.com/cgi-bin/webscr for Sandbox) in order to validate the IPN message.
Depending on this result, you'll get back an INVALID or VERIFIED response.
INVALID may mean the IPN POST didn't originate from PayPal, whereas VERIFIED means the IPN POST was verified as indeed coming from PayPal.

这篇关于成功付款后的PayPal POST数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆