如何使用沙盒测试 Paypal 订阅按钮? [英] How do I test Paypal subscription buttons with sandbox?
问题描述
经过 5 个小时的研究和阅读过时的 paypal 文档后,我终于放弃了!
after 5 hours of research and reading outdated paypal documentation I finally give up!
我需要使用贝宝沙盒测试一个简单的贝宝订阅按钮.
I need to test a simple paypal subscription button with the paypal sandbox.
按钮代码:
<form action="https://www.sandbox.paypal.com/us/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="34CXHXVU2J8BY">
<input type="image"
src="https://www.paypalobjects.com/en_US/GB/i/btn/btn_subscribeCC_LG.gif"
border="0" name="submit"
alt="PayPal — The safer, easier way to pay online."
style="border:none;padding:0;height:auto;width:auto">
<img alt="" border="0"
src="https://www.paypalobjects.com/de_DE/i/scr/pixel.gif"
width="1" height="1">
</form>
但是当我尝试发送表单时,我在 paypal 网站上收到此错误:
But when I try to send the form, I get this error on the paypal website:
提前致谢,菲利普
推荐答案
问题是您在实时 PayPal 网站中生成了一个托管"PayPal 按钮,但您正在将此数据发送到沙盒.
由于 hosted_button_id
在 Sandbox 中未被识别,它返回一个错误.
The problem is that you've generated a 'hosted' PayPal button in the live PayPal website, but you're sending this data to the Sandbox.
Since the hosted_button_id
isn't recognized in the Sandbox, it returns an error.
您需要:
- 创建一个非托管按钮,并更改操作"和业务"参数以匹配沙盒详细信息
- 通过
www.sandbox.paypal.com > 在 Sandbox 中创建一个新的托管"按钮简介 >贝宝按钮.
TL;DR:Sandbox 与 Live PayPal 网站 100% 分离.在 Live 中生成的托管按钮在 Sandbox 中不起作用.
TL;DR: Sandbox is 100% separated from the Live PayPal website. A hosted button generated in Live, doesn't work in Sandbox.
这篇关于如何使用沙盒测试 Paypal 订阅按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!