Sandbox always shows amount of transaction is 0.01

MickeyMousePark
Contributor
Contributor

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

is shows the amount of the sale as 0.01..why does it not show 35.00

What am i missing..

Thanks in advance for anyones help

Login to Me Too
1 ACCEPTED SOLUTION

Accepted Solutions
Solved

MickeyMousePark
Contributor
Contributor

Here is my working JS code:

 

<script src="https://www.paypal.com/sdk/js?client-id=AVzxhXXXXXXXXXXXXXXXXXXXXXgHtNyyjBawLvnvJLRrshVSrLjwhqWoPg3F..."></script>


<div id="paypal-button-container" style="position:relative;left:25%;width:50%;text-align:center;color:#FFFF00;"></div>

<script>
paypal.Buttons(
{createOrder: function(data, actions) {
return actions.order.create({
"purchase_units": [
{
"amount": {
"currency_code": "USD",
"value": "35.00",
},

},
],
})
},
onApprove:function(data,actions) {
return actions.order.capture().then(function(details){

alert('Transaction completed by ' + details.payer.name.given_name);
})
},
})
.render('#paypal-button-container')

</script>

View solution in original post

Login to Me Too
3 REPLIES 3

MickeyMousePark
Contributor
Contributor

i solved my error in the JS code..not sure how to delete this post...

Login to Me Too

MTS_Jennifer
Moderator
Moderator

Hi @MickeyMousePark ,

Thank you for posting to the PayPal Merchant Community.

That's great news that you solved the issue. Can you please post what you changed in your JavaScript code to resolve the issue. That will help others that are facing this same issue.

Thank you,

Jennifer

MTS

PayPal

Login to Me Too
Solved

MickeyMousePark
Contributor
Contributor

Here is my working JS code:

 

<script src="https://www.paypal.com/sdk/js?client-id=AVzxhXXXXXXXXXXXXXXXXXXXXXgHtNyyjBawLvnvJLRrshVSrLjwhqWoPg3F..."></script>


<div id="paypal-button-container" style="position:relative;left:25%;width:50%;text-align:center;color:#FFFF00;"></div>

<script>
paypal.Buttons(
{createOrder: function(data, actions) {
return actions.order.create({
"purchase_units": [
{
"amount": {
"currency_code": "USD",
"value": "35.00",
},

},
],
})
},
onApprove:function(data,actions) {
return actions.order.capture().then(function(details){

alert('Transaction completed by ' + details.payer.name.given_name);
})
},
})
.render('#paypal-button-container')

</script>

Login to Me Too

Haven't Found your Answer?

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