JSFiddle - React, Tailwind, and code Playground
HTML
<script type="text/javascript" src="https://www.paypal.com/sdk/js?client-id=AWRR9FTbuJ_WOInJ-hCSd85TzYQBhHbDfsoOYDnWIYRlg_Y8F3dByTMBQ9ToB9ja9mbzeOJvbsF06wnw¤cy=EUR&locale=en_GB&commit=false&disable-funding=credit,card"></script>
<div id="paypal-button-container"></div>
JavaScript
let CreateOrderData = {
intent: "CAPTURE",
purchase_units: [
{
"amount": {
"breakdown": {
"item_total": {
"currency_code": "EUR",
"value": "41.84"
},
"shipping": {
"currency_code": "EUR",
"value": "4.50"
},
"tax_total": {
"currency_code": "EUR",
"value": "0.00"
},
"handling": {
"currency_code": "EUR",
"value": "0.00"
},
"shipping_discount": {
"currency_code": "EUR",
"value": "0.00"
},
"insurance": {
"currency_code": "EUR",
"value": "0.00"
},
"discount": {
"currency_code": "EUR",
"value": "0.00"
}
},
"currency_code": "EUR",
"value": "46.34"
},
"items": [
{
"name": "test",
"sku": "SKU",
"unit_amount": {
"currency_code": "EUR",
"value": "41.84"
},
"tax": {
"currency_code": "EUR",
"value": "0.00"
},
"quantity": "1",
"category": "PHYSICAL_GOODS"
}
]
}
]
};
let shippingChageData = {"accept": true, "shipping": "24.60", "value": "66.44", "itemsTotal": "41.84"};
paypal.Buttons({
commit: false,
"return": "representation",
...