PayPal Sandbox always shows amount of transaction is 0.01 Here is my code:
<script src="https://www.paypal.com/sdk/js?client-id=AVzxh6XXXXXXXX9Z-1gHtNyyjBawLvnvJLRrshVSrLjwhqWoPg3FI9PiTdi-..."></script>
<div id="paypal-button-container" style="position:relative;left:25%;width:50%;text-align:center;color:#FFFF00;"></div>
<script>
paypal.Buttons().render('#paypal-button-container')
</script>
<script>
createOrder: function(data, actions) {
return actions.order.create({
"purchase_units": [
{
"amount": {
"currency_code": "USD",
"value": "35.00"
}
}
]
});
}
</script>
the buttons show... i click on Paypal and login to my sandbox personal account in the popup
it shows the amount of the sale as 0.01 why does it not show 35.00
What am i missing..
Thanks in advance for anyone's help
NOTE: i have tried to ask this on PayPal developer community with no response at all..i am hoping someone here on Stack Overflow can spot the problem.. I am not new coding but am new to JS
--Richard
I expected the amount of transaction to show as 35.00
paypal.Buttons().render
The button code needs to be an object inside paypal.Buttons({...})
, as seen in this demo and all code samples.
Moreover, actions.order.create
is deprecated and should not be used for any new integration; support will be sunset in the future.
Instead, create the order from a backend using the v2/checkout/orders API, on demand from a route that returns a result in JSON format. Have your buttons fetch from that backend, as seen in the demo linked above and all current PayPal code samples (notably the Standard Integration Guide, as well as the Integration Builder)