'Paypal Smart Buttons tax get's ignored
I'm implementing PayPal Smart Buttons SDK within our shop. The Payload which gets sent by javascript to https://www.sandbox.paypal.com/v2/checkout/orders looks like:
{
"reference_id":"XYZ",
"description":"Fonts bought from hobo typefaces",
"custom_id":"XYZ",
"soft_descriptor":"Soft",
"redirect_urls":{
"return_url":"https://dev.hobo-typefaces.com/checkout",
"cancel_url":"https://dev.hobo-typefaces.com/cancel"
},
"amount":{
"currency_code":"EUR",
"total":"378.00",
"shipping":0,
"value":"360.00",
"tax":"18.00",
"breakdown":{
"item_total":{
"currency_code":"EUR",
"subtotal":"360.00",
"value":"360.00",
"total":"378.00",
"shipping":0,
"tax":"18.00"
}
}
},
"items":[
{
"name":"Rosart Regular",
"sku":"Rosart Regular",
"unit_amount":{
"currency_code":"EUR",
"value":"60.00"
},
"quantity":"1"
},
{
"name":"Rosart RegularItalic",
"sku":"Rosart RegularItalic",
"unit_amount":{
"currency_code":"EUR",
"value":"60.00"
},
"quantity":"1"
},
{
"name":"Rosart MediumItalic",
"sku":"Rosart MediumItalic",
"unit_amount":{
"currency_code":"EUR",
"value":"60.00"
},
"quantity":"1"
},
{
"name":"Rosart Medium",
"sku":"Rosart Medium",
"unit_amount":{
"currency_code":"EUR",
"value":"60.00"
},
"quantity":"1"
},
{
"name":"Rosart Semibold",
"sku":"Rosart Semibold",
"unit_amount":{
"currency_code":"EUR",
"value":"60.00"
},
"quantity":"1"
},
{
"name":"Rosart SemiboldItalic",
"sku":"Rosart SemiboldItalic",
"unit_amount":{
"currency_code":"EUR",
"value":"60.00"
},
"quantity":"1"
}
]
}
While the checkout Flow works, the tax get's ignored and paypal calculates 360 EUR. Unfortunately I cannot solve this with paypal documentation. Where I'm unsure is amount.value, amount.total and the same within the breakdown array.
I'm thankful if one could help why my tax is ignore.
Solution 1:[1]
You aren't passing valid tax objects in the purchase_units array and its items array.
[Edit: page no longer exists] See here for an example: https://developer.paypal.com/docs/checkout/reference/server-integration/set-up-transaction/
See here for the API reference: https://developer.paypal.com/docs/api/orders/v2/#orders_create
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
