Checking if paypal payment was successful

為{幸葍}努か 提交于 2019-12-07 12:23:13

问题


I have downloaded sample code from paypal to allow me to use parallel payments via their sandbox accounts. When I run parallel.php, I get redirected to paypal's sandbox login page.

How am I supposed to know "server side" that the payment has been made successfully, so I can update my database records?


回答1:


I believe you have to work with PayPals IPN system. This will basically send a confirmation to your server that tells you it has gone through.

https://www.paypal.com/ipn




回答2:


Paypal lets you register a notification url which is part of the IPN (instant payment notification IIRC) system. So if someone pays by a delayed payment (such as a bank transfer) the transaction will update days later. You need to have an application (web page) on your server that can be called by Paypal with transaction details to update a payment.

You'll need to create an initial transaction record in your system when paypal redirects back to you so refer to their documentation for that. I'd also recommend looking at either OSCommerce or Zen cart for an idea of how they do it as they support the same kind of thing.



来源:https://stackoverflow.com/questions/5536360/checking-if-paypal-payment-was-successful

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