Paypal API v2 Custom tax when create order

Somesa
Contributor
Contributor

Hello, im using the paypal v2 api, i want to add each payment a fixed tax of 3.5€ I've searched in the documentation then I did this but it does not work, can you help me?

 

return actions.order.create({
    purchase_units: [{
        amount: {
            value: '{{ $total + 3.5 }}'
        },
        items: [
            {
                name: '{{ $fullname }}',
                unit_amount: {
                    value: '{{ $total }}'
                },
                tax: {
                    value: '3.5'
                }
            }
        ],
        tax_total: {
            value: '3.5'
        }
    }],
    application_context: {
        shipping_preference: 'NO_SHIPPING'
    }
});

 

Thank you

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.