Users closing browser so OnApprove not firing…
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Labels:
-
PayPal HTML Buttons
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm in the same situation and with the current docs I haven't figured out the proper way to handle this.
One solution would be to use webhooks, this is nodejs but it explains the gist of it https://riptutorial.com/paypal/example/1867/testing-sandbox-webhooks-with-ngrok-and-express--node-
Problem is, webhooks response time seems to be random, can be instantaneous or take hours.
So my current solution would be to continue using onApprove for when the customer stays with the window open and use the webhook as a backup to update the db in case the onApprove wasn't triggered. This might be a bit troublesome as well since it might raise a race condition between the onApprove and webhook if they're triggered at the same time.
I don't know if this is the only solution to this problem and the docs are so unorganised and outdated that I can't understand what the proper course of action should be.

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- If I don't capture within the 3 hour limit, how can I be sure that the payment went through? in REST APIs
- Checkout buttons appear twice and popups close as soon as they appear (ReactJS) in PayPal Payments Standard
- Paypal subscription button - Popup not closing and onApprove not triggered in SDKs
- What JSON is returned to Browser with the onApprove: function(data, actions) in PayPal Payments Standard
- Uncaught Error: No ack for postMessage 1() in https://www.sandbox.paypal.com in 10000ms in Sandbox Environment