- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
![Moderator Moderator](https://www.paypalobjects.com/webstatic/icon/pp32.png)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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>
![](/skins/images/969EE294DC97B096AB9429A53D934B29/responsive_peak/images/icon_anonymous_message.png)
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Enable Reference Transactions for sandbox account in Sandbox Environment
- Balance dispute. Balance amount should be more than it shows on the e-statement. in PayPal Upgrade Community
- Error creating an order for cupture - Issues with Authorization header in Braintree Server-side Integration (PHP, Java, .NET, Ruby, Python, NodeJS SDKs)
- How to pass "amount" using @paypal/react-paypal-js in REST APIs
- Using Sandbox credentials at checkout loops PayPal to sign up page in Sandbox Environment