PayPal Payment (via HTML button) not always going through
bezalelk
Contributor
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on
Sep-26-2020
10:13 AM
Hi,
I am accepting payments on my Wix site using HTML (element) code for the PayPal button and payment (code below). After the payment, the HTML code send a message to the page, and when the page gets it, I execute custom code that displays a unique message.
Lately the users have been notifying me that after they put all the info in, the PayPal popup closes and nothing happens.
I look on my PayPal account (business account) and I dont see the payment, but I do see the API call.
Does someone know why this happens and how I can fix this?
TIA,
<head>
<meta name="viewport" content="width=device-width, initial-scale=1"> <!-- Ensures optimal rendering on mobile devices. -->
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> <!-- Optimal Internet Explorer compatibility -->
<script src="https://www.paypalobjects.com/api/checkout.js"></script>
</head>
<body>
<div id="paypal-button-container"></div>
<script>
paypal.Button.render({
env: 'production', // sandbox | production
client: {
sandbox: '<Sandbox client-ID>',
production: '<Production client-ID>'
},
commit: true, // Optional: show a 'Pay Now' button in the checkout flow
payment: function (data, actions) {
return actions.payment.create({
payment: {
transactions: [
{
amount: {
total: '9.99',
currency: 'USD'
}
}
]
}
});
},
onApprove: function (data, actions) {
// Get the payment details
return actions.order.capture()
.then(function (details) {
// Show a success page to the buyer
window.parent.postMessage("Payment Approved", "https://wpcjerusalem.wixsite.com/wpcjerusalem/register-for-rental");
});
},
onCancel: function(data, actions) {
// Show a cancel page, or return to cart
},
// --------- onError ---
onError: function(err) {
// Show an error page
console.log()('PayPal: An error has occurred! ');
}
}, '#paypal-button-container');
</script>
</body>
Labels:
- Labels:
-
Express Checkout
-
PayPal Buttons
0 REPLIES 0

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
Related Content
- Magento 2 Checkout Screen Asking For Credit Card in Merchant Products and Services Archives
- Zettle refunds and Zettle vs Here in Merchant Products and Services Archives
- Can't find my current billing statement on my account page. in Reporting Archives
- What is the difference between "Total Sales" and "Total Zettle collected payments" in Zettle report? in Merchant Products and Services Archives
- Buyer cancelled pending payment just after i posted the package. in Managing Risk and Fraud Archives