Luehang / react-paypal-button-v2

An easy and simple to use React button component to implement PayPal Checkout with Smart Payment Buttons V2 (Version 2).
https://luehangs.site/lue_hang/projects/react-paypal-button-v2
MIT License
275 stars 81 forks source link

[BUG] Set platform_fees returned status: 422 #51

Open Erseni opened 4 years ago

Erseni commented 4 years ago
createOrder={(data, actions) => {
    return actions.order.create({
        purchase_units: [{
            description: 'Payment for ' + name + '.',
            payee: {
                email_address: 'yyy@xxx.net',
            },
            amount: {
                currency_code: 'EUR,
                value: (amount * 0.9).toFixed(2),
            },
            payment_instruction : {
                disbursement_mode: 'INSTANT',
                platform_fees: [
                    {
                        amount: {
                            currency_code: currency,
                            value: (amount * 0.1).toFixed(2),
                        },
                    }
                ],
            },
        }],
    });
}}