Smart Payment Buttons: why is onApprove (transaction confirmation) so slow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm using the Smart Payment buttons and when the user completes a transaction inside Paypal's popup there is a 2-3 seconds delay between the popup closure and the effective transaction confirmation, fired by the standard client script:
onApprove: function(data, actions) { return actions.order.capture().then(function(details) { // get data.orderID, send email, update database, ... });
This is a big issue, because the onApprove execution gives me the transaction ID and it sends a mail to the customer; it should be fired right when the user paid and the popup closes. If the user closes the browser in those 2-3 seconds delay (or it loses the connection) I don't get the ID and the user doesn't get any email.
Is there any way to make it faster? Why do I have a delay between the closing popup and the actual onApprove execution?
- Labels:
-
PayPal HTML Buttons
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is no way to bypass the server's lazyness, it's a problem on PayPal's site and we're forced to wait for the callback. The Sandbox is a bit slowwer but I recently moved to Live and it's still terribly slow.
The only thing I could do was adding a popup with a warning text and the same loading spinner that uses PayPal. The popup goes away when PayPal fires the callback (~3 seconds, usually) or when the user cancels the payment. It's not "solution" though, as it wouldn't fix a possible connection issue.
You can find the spinner here (HTML + CSS) here:
https://codepen.io/LuBre/pen/NWGXrQr?editors=1100
And this is how it looks:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i have made add to cart button but it is not working.
our website is hosted on weebly.
when our buyer clicks on add to cart button than it takes to paypal cart once they click pay checkout than it ask paypal user name and password, once customer write and click to login than error window is coming and than over.

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Inquiry About Documentation and Support for Tokenization and Future Payment in Payflow
- I receive real payment in sendbox mode in Sandbox Environment
- How do I handle INSTRUMENT_DECLINED error? in REST APIs
- paypal_js_sdk_v5_unhandled_exception {err: 'Error: No ack for postMessage init() in SDKs
- Add Others data in SDKs