Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/258.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php PayPal捐赠按钮付款后重定向_Php_Paypal_Redirect_Paypal Ipn - Fatal编程技术网

Php PayPal捐赠按钮付款后重定向

Php PayPal捐赠按钮付款后重定向,php,paypal,redirect,paypal-ipn,Php,Paypal,Redirect,Paypal Ipn,我知道如何使贝宝捐赠按钮重定向付款后,但我需要知道的是,你可以通过这个重定向支付的金额。因此它将重定向到http://example.com/donate?amount=123,这可能吗? 谢谢 编辑:似乎我可以用IPN(?),我只是不知道如何使用贝宝的IPN,有人能帮我吗?(是的,我读过这些文件,它们令人困惑)是的,这是可能的,就像这样: <!-- where you setup your paypal button : --> <input type="hidden" na

我知道如何使贝宝捐赠按钮重定向付款后,但我需要知道的是,你可以通过这个重定向支付的金额。因此它将重定向到
http://example.com/donate?amount=123
,这可能吗? 谢谢


编辑:似乎我可以用IPN(?),我只是不知道如何使用贝宝的IPN,有人能帮我吗?(是的,我读过这些文件,它们令人困惑)

是的,这是可能的,就像这样:

<!-- where you setup your paypal button : -->
<input type="hidden" name="return" value="http://example.com/donate?amount=<?php echo $amount ?>" />

然后,
如果$\u GET['ref']=$\u SESSION['reference\u id']
,那么您就可以使用$\u SESSION['amount']变量。

攻击者在仅捐赠了1之后不可能重定向到吗?最好使用返回url提供的某种事务id调用paypal api,并直接询问paypal。问题是,这是一个捐赠按钮,因此,用户在单击按钮后输入他们捐赠的金额:/I我认为您可以配置:。我认为“立即购买”按钮和“捐赠”按钮之间的区别只是图像
<input type="hidden" name="return" value="http://example.com/donate?ref=<?php echo $_SESSION['reference_id'] ?>" />