PayPal 捐赠按钮付款后重定向
我知道如何在付款后进行 PayPal 捐赠按钮重定向,但我需要知道的是,您能否通过此重定向传递已付款额。所以它会重定向到http://example.com/donate?amount=123
,这可能吗? 谢谢!
编辑:看来我可以用 IPN(?) 做到这一点,我只是不知道如何使用 paypal 的 IPN,有人可以帮助我吗? (是的,我已经阅读了文档,它们很令人困惑)
I know how to make a PayPal donate button redirect after payment, but what I need to know is, can you pass the payed amount through this redirection. So it would redirect to http://example.com/donate?amount=123
, is this even possible?
Thanks!
EDIT: It seems I can do it with IPN(?), I just don't know how to use paypal's IPN, can anyone help me? (yes I have read the docs, they are confusing)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,这是可能的,如下所示:
但是(考虑到安全性)
最好将其与参考 ID 一起保存在例如
$_SESSION['amount']
中>$_SESSION['reference_id'] = md5('whatever you like' . 'plus salt');在 paypal 按钮中使用该 reference_id,如下所示:
然后,
if $_GET['ref'] == $_SESSION['reference_id']
,那么您可以使用 $_SESSION['amount'] 变量。yes it is possible, like so:
But (concerning security)
It would be better to keep it in e.g.
$_SESSION['amount']
along with a reference id$_SESSION['reference_id'] = md5('whatever you like' . 'plus salt');
And in the paypal button use that reference_id like so:
And then,
if $_GET['ref'] == $_SESSION['reference_id']
, then you can use the $_SESSION['amount'] variable.