如何使用PHP从Paypal立即购买按钮接收回调 [英] How do I receive callback from Paypal buy now button using PHP
问题描述
我目前正在测试PHP网站上的立即购买"按钮.交易正常,但是我现在要从Paypal打电话回去更新我的数据库.
I am currently testing the buy now button on a PHP website. The transaction is working but I am getting now call back from Paypal to update my database.
这是我的代码(我已经更改了网址):
Here is the code I have (I have changed urls) :
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="encrypted" value="........"
<input type="image" src="https://www.paypalobjects.com/fr_CA/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - la solution de paiement en ligne la plus simple et la plus sécurisée !">
<img alt="" border="0" src="https://www.paypalobjects.com/fr_CA/i/scr/pixel.gif" width="1" height="1">
<input name="notify_url" value="mypage.php" type="hidden">
</form>
对于在另一个网站上看到的回电,我应该收到$ _POST ['payment_status'];和$ _POST ['invoice'];
For the call back I saw on another website I should receive a $_POST['payment_status']; and a $_POST['invoice'];
是真的吗?
推荐答案
$_POST['payment_status'];
和$_POST['invoice'];
您是正确的.付款成功后,贝宝将通过mypage.php
与您的页面联系.
确认与您的页面对话后,您就可以处理$_POST
变量.
You are correct. After a successful payment, paypal will contact your page at mypage.php
.
After you verify that it is paypal talking to your page, you can process the $_POST
variables.
The list of variables that paypal will send you is listed here.
这篇关于如何使用PHP从Paypal立即购买按钮接收回调的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!