如何防止重复的PayPal付款? [英] How to prevent duplicate PayPal payments?
问题描述
我有一个简单的立即付款"按钮,该代码是通过按钮制作器创建的,并添加了一个自定义"隐藏字段来识别它.我想知道是否可以添加一些额外的隐藏字段来告诉 PayPal此交易不应进行两次".
I have a simple Pay Now button, the code created through the button maker, with a "custom" hidden field added to identify it. I wonder if there is some additional hidden field I can add to tell PayPal that "This transaction should not be made twice".
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="custom" value="{MYUNIQUEID}">
<input type="hidden" name="hosted_button_id" value="{MYHOSTEDBUTTONID}">
<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif"
border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
由于现在客户不太可能支付两次,但我注意到当 Sandbox 出现故障时,我成功地为同一笔交易支付了两次.我绝对想避免的东西.不仅仅是为了客户,当然可以退款,而且因为我不希望我的数据库搞砸了,我想避免大量编码以捕获重复付款......
As it is now it's unlikely that the customer should be able to pay twice, but I noticed that when the Sandbox had a glitch I succeeded in paying the same transaction twice. Something that I absolutely want to avoid. Not just for the customer, that could get refunded, sure, but also since I don't want my database messed up and I would like to avoid extensive coding to catch duplicate payments...
推荐答案
您可能希望向发票"参数添加唯一标识符;<input type="hidden" name="invoice" value="您的唯一发票 ID">
并在个人资料">我的销售工具"部分中启用阻止重复付款"您在 www.paypal.com 上的帐户
You would want to add a unique identifier to the "invoice" parameter; <input type="hidden" name="invoice" value="your unique invoice ID">
and enable "Block duplicate payments" within the 'Profile' > 'My selling tools' section on your account at www.paypal.com
这篇关于如何防止重复的PayPal付款?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!