PHP Check Paypal Payment and then execute something

大憨熊 提交于 2019-12-25 00:29:48

问题


today i would ask you if someone know how Check if the user has really payed and then if he has really payed execute some mssql+script

for be precise if he has really payed i would execute this query via php: (UPDATE members SET Premium='1' WHERE membername="'.$membername.'"")


回答1:


You can check this PHP example from paypal site:

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

if (strcmp ($res, "VERIFIED") == 0) {
// Your code
}



回答2:


You can implement this using PayPal's Instant Payment Notification (IPN). However, it's important to understand that when the user comes back to your website from paying at PayPal, that does not mean the payment has gone through yet. The IPN could happen before they get back to your site or sometime later. You can even accept eCheck payments which can take quite a while to be a completed payment.

Therefore, your IPN listener script would wait for the completed payment, update the user's membership, and then send them an email with a link to login as a premium member.

The whole process is explained in this tutorial with example code: PayPal IPN with PHP



来源:https://stackoverflow.com/questions/7358411/php-check-paypal-payment-and-then-execute-something

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