[英]Creating a PayPal Subscription Button in Sandbox mode
I am trying to setup a sandbox for PayPal Smart Buttons to test before I release to production.我正在尝试为 PayPal 智能按钮设置一个沙箱,以便在我发布到生产环境之前进行测试。
When I go to PayPal Subscriptions , I select my plan and click 'Copy Code'.当我转到PayPal Subscriptions 时,我选择我的计划并单击“复制代码”。 The result is:
结果是:
<div id="paypal-button-container"></div>
<script src="https://www.paypal.com/sdk/js?client-id=XXX&vault=true" data-sdk-integration-source="button-factory"></script>
<script>
paypal.Buttons({
....
createSubscription: function(data, actions) {
return actions.subscription.create({
'plan_id': 'P-YYYY'
});
},
onApprove: function(data, actions) {
alert(data.subscriptionID);
}
}).render('#paypal-button-container');
</script>
Is there a way to enable sandbox for logging in?有没有办法启用沙箱登录? I see that I can create sandbox accounts at Developer Accounts page but the sandbox accounts created there do not work (I mean how is it supposed to know I am in 'sandbox mode'?)
我看到我可以在开发人员帐户页面创建沙箱帐户,但在那里创建的沙箱帐户不起作用(我的意思是它怎么知道我处于“沙箱模式”?)
The sandbox and live environments are completely separate.沙盒和实时环境是完全分开的。
Using a sandbox business account, log into the www.sandbox.paypal.com environment, and then you can go to:使用沙盒企业账号,登录www.sandbox.paypal.com环境,即可进入:
https://www.sandbox.paypal.com/billing/overview (same as your link, but with ' sandbox. ' in the URL. https://www.sandbox.paypal.com/billing/overview (与您的链接相同,但 URL 中带有“ sandbox. ”。
Create sandbox plans there.在那里创建沙箱计划。 These sandbox subscriptions can be tested with sandbox personal accounts.
这些沙盒订阅可以使用沙盒个人帐户进行测试。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.