【发布时间】:2019-02-11 11:14:39
【问题描述】:
我在我的网站上使用快速结帐。我想在完成交易时禁用它的送货地址。我在按钮上使用脚本。我正在使用的一段代码就是这个。
paypal.Button.render({
env: 'production', // sandbox | production
client: {
sandbox: 'mykey',
production: 'mykey'
},
// Show the buyer a 'Pay Now' button in the checkout flow
commit: true,
// payment() is called when the button is clicked
payment: function(data, actions) {
// Make a call to the REST api to create the payment
return actions.payment.create({
payment: {
transactions: [
{
amount: { total: '5.00', currency: 'EUR' }
}
]
}
});
},
// onAuthorize() is called when the buyer approves the payment
onAuthorize: function(data, actions) {
// Make a call to the REST api to execute the payment
return actions.payment.execute().then(function() {
window.location = "address";
});
}
}, '#paypal-button-container');
非常感谢您的帮助。谢谢
【问题讨论】:
标签: paypal payment-gateway paypal-sandbox paypal-rest-sdk