我的目标是获得金额的 5% 并将其发送到公司 PayPal 帐户,其余 95% 将直接发送到其他用户的 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) …Run Code Online (Sandbox Code Playgroud)