How to verify successful payment of paypal

孤者浪人 提交于 2019-12-05 08:01:12

I'd highly suggest looking into using PayPal Instant Payment Notifications (IPN). PayPal IPN allows you to (asynchronously) process order information while not having to depend on the buyer to return to your website to complete the order.

You can use IPN by setting up a script which receives this (POST) data from PayPal. In addition, you must include the following code in your button and/or API call(s):

For Website Payments Standard (where "xxxxxxxx" is the full URL to your IPN script):
input type="hidden" name="notify_url" value="xxxxxxxx"

For Express Checkout: Include NOTIFYURL=xxxxxxxx in your SetExpressCheckout and DoExpressCheckoutPayment API call

For Website Payments Pro Include NOTIFYURL=xxxxxxxx in your DoDirectPayment API call

You can find sample code, documentation and further information on PayPal IPN at https://www.paypal.com/ipn

Additionally, here's an article with additional steps on verifying the authenticity of IPN messages at https://www.x.com/developers/community/blogs/ppmtsrobertg/securing-your-instant-payment-notification-ipn-script

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!