Express Checkout Client-Side REST, onError function is not executing on retries
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everyone,
I detect a possible bug in the Express Checkout Client-Side REST integration:
I malformed the payment object adding an extra unexpected element. When I click the paypal button onError function is called and the process is interrupted. But if I retry clicking again the paypal button, the process is interruptep but onError function is NOT called again.
I was testing the sandbox environment so I don't know if this bug exists or not in production environment.
You can replicate this possible bug using the interactive demo with the next code:
<!DOCTYPE html> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="viewport" content="width=device-width, initial-scale=1"> <script src="https://www.paypalobjects.com/api/checkout.js"></script> </head> <body> <div id="paypal-button-container"></div> <script> paypal.Button.render({ env: 'sandbox', // sandbox | production // PayPal Client IDs - replace with your own // Create a PayPal app: https://developer.paypal.com/developer/applications/create client: { sandbox: 'AZDxjDScFpQtjWTOUtWKbyN_bDt4OgqaF4eYXlewfBP4-8aqX3PiV8e1GWU6liB2CUXlkA59kJXE7M6R', production: '<insert production client id>' }, // Show the buyer a 'Pay Now' button in the checkout flow commit: true, // payment() is called when the button is clicked payment: function(data, actions) { // Make a call to the REST api to create the payment return actions.payment.create({ payment: { transactions: [ { amount: { total: '0.01', currency: 'USD' } } ], testError: true } }); }, // onAuthorize() is called when the buyer approves the payment onAuthorize: function(data, actions) { // Make a call to the REST api to execute the payment return actions.payment.execute().then(function() { window.alert('Payment Complete!'); }); }, onError: function(err){ window.alert(err.message); } }, '#paypal-button-container'); </script> </body>
- 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
Are there any updates on this issue? It's the critical bug in UX and the only workaround I see here is to reload the page right after the error but that's insane!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- PayPal advanced credit cards with currency code not supported in REST APIs
- What if connection is lost before "onApprove" ? in Sandbox Environment
- Why use same functions twice while create and executing payment in Sandbox Environment
- Trouble with PayPal Checkout server integration in REST APIs
- Authentication failure while using REST API in php in REST APIs