Paypal - 拆分付款并将其发送到不同的 PayPal 帐户

Mar*_*ino 7 javascript paypal

我的目标是获得金额的 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) {
        console.log(payment);
    });
}
}, '#paypal-button');
Run Code Online (Sandbox Code Playgroud)

请帮助我..谢谢。

Tho*_*ate 7

不,仅使用 Paypal 按钮是不可能的。Paypal 有自己的方式将钱分配到您想要设置的任何帐户,并且您需要使用 Payouts API。

注意:它曾经是“自适应支付”,但他们(Paypal)停止允许新的集成。

根据文档:https://developer.paypal.com/docs/api/ payments.payouts- batch/v1/

使用 Payouts API 在一次 API 调用中向多个 PayPal 账户进行 PayPal 付款。Payouts API 是一种快速、便捷的方式来发送佣金、回扣、奖励和一般支出。

请注意,您需要一个 PayPal 企业帐户才符合此条件: https: //developer.paypal.com/docs/payouts/integrate/prerequirements/#