Paypal buttons: pop-up window never closes, alert never shows up
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I follow the instruction to add paypal button to a html (this html only contain paypal code). I changed client_id to my sandbox id. It works because I got
webhook call. But the pop-up window never close. alert should show a small window, but never shows up.
What can I do? Any information would be appreciated. Thanks in advance.
The code:
<script>
paypal.Buttons({
createOrder: function(data, actions) {
// This function sets up the details of the transaction, including the amount and line item details.
return actions.order.create({
purchase_units: [{
amount: {
value: '0.01'
}
}]
});
},
onApprove: function(data, actions) {
// This function captures the funds from the transaction.
return actions.order.capture().then(function(details) {
// This function shows a transaction success message to your buyer.
alert('Transaction completed by ' + details.payer.name.given_name);
});
}
}).render('#paypal-button-container');
//This function displays Smart Payment Buttons on your web page.
</script>
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Add Others data in SDKs
- Change the button from Sandbox to Production in REST APIs
- PayPal Checkout golden buttons opens checkout window with different options in PayPal Upgrade Community
- Error: "Unable to change shipping method. Please try again." in PayPal popup in REST APIs
- How do you dynamically pass an item name through an 'add to cart' button? in Sandbox Environment