0
我的沙箱应用程序出现问题。我在我的网络应用程序中整合了用于PayPal结帐快递付款的脚本。此脚本:Paypal沙箱应用程序登录错误
<script src="https://www.paypalobjects.com/api/checkout.js"></script>
<div id="paypal-button-container"></div>
<script>
var total = 0;
$.getJSON("/Home/getTotal", function (result) {
total = result;
});
// Render the PayPal
paypal.Button.render({
// Set your environment
env: 'sandbox', // sandbox | production
// Specify the style of the button
style: {
label: 'buynow',
fundingicons: true, // optional
branding: true // optional
},
// PayPal Client IDs - replace with your own
// Create a PayPal app: https://developer.paypal.com/developer/applications/create
client: {
sandbox: 'AT9iydEDhcqfM_dhU8MR0lvkFgZBjD1oXQVrG-CR9CyK_vd-aXpNzEnyVV7um_hAPrkqQX8JhtjGCbBt'
},
// Wait for the PayPal button to be clicked
payment: function (data, actions) {
return actions.payment.create({
transactions: [
{
amount: { total: total, currency: 'USD' }
}
]
});
},
// Wait for the payment to be authorized by the customer
onAuthorize: function (data, actions) {
return actions.payment.execute().then(function() {
window.alert('Payment Complete!');
});
}
}, '#paypal-button-container');
</script>
此代码显示一个贝宝按钮。当我点击按钮时,它会显示一个登录页面以进行付款。问题是:我无法使用我拥有的PayPal帐户登录此页面。我在某个地方看过,只有沙箱的测试账户可以用于登录此页面,但我想让每个拥有paypal账户的人都登录到此页面。我该怎么办 ?谢谢您的回答!
您是否创建了如代码所示的PayPal应用程序? – Claies
是的,我已经创建了2沙盒应用程序 –
如果你想要让大家登录,那么你应该用一个生产账户,而不是一个沙箱 – Hosar