【发布时间】:2020-01-28 13:39:04
【问题描述】:
我的目标是获得 5% 的金额并将其发送到公司 PayPal 帐户,另外 95% 将直接发送到其他用户的 Paypal。如何在 PayPal 代码中执行此操作?
这是我的 PayPal 代码。
paypal.Button.render({
style: {
size: 'responsive',
color: 'black'
},
env: 'sandbox', // 'sandbox' Or 'production',
client: {
sandbox: 'MyClientID',
production: ''
},
locale: 'en_US',
commit: true, // Show a 'Pay Now' button
payment: function(data, actions) {
// Set up the payment here
return actions.payment.create({
payment: {
transactions: [{
amount: { total: '1.00', currency: 'USD' }
}]
}
});
},
onAuthorize: function(data, actions) {
// Execute the payment here
return actions.payment.execute().then(function(payment) {
console.log(payment);
});
}
}, '#paypal-button');
请帮帮我..谢谢。
【问题讨论】:
标签: javascript paypal