Smart Payment Buttons: why is onApprove (transaction confirmation) so slow?

LuBre
Contributor
Contributor

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?

 

 

Login to Me Too
4 REPLIES 4

LuBre
Contributor
Contributor

No updates on this issue? I can't be the only one experiencing this delay...

Login to Me Too

shotrox
Contributor
Contributor

I see the dame issue - did you ever figure out how to get around it?

Login to Me Too

LuBre
Contributor
Contributor

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:

LuBre_0-1588632099948.png

 

Login to Me Too

gpexim
New Community Member

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.

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.