- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Part of the code that I'm talking about:
onApprove: function(data, actions) {
return actions.order.capture().then(function(details) {
// What if connection is lost right before executing the code below
return fetch('/paypal-transaction-complete', {
method: 'post',
headers: {
'content-type': 'application/json'
},
body: JSON.stringify({
orderID: data.orderID
})
});
});
}
As everyone else here, I'm using the fetch path to execute the SDK and store some information in the database, said SDK takes the data.orderID
But what do I do if the customer loses connection before fetch is executed? In said case I would not retrive the data.orderID and therefore wouldn't be able to request the details, even though the payment was processed.
Any advice is welcome
Edit: Made a payment through sandbox and closed the tab right after paying, as expected the payment was processed but it wasn't saved on the database.
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I saw your message too late.
What I did was:
1) Add a loading screen so the user doesn't click away during transaction
2) Before even processing the Paypal sale information I saved the checkout ID in a temporal table, in the database
So if something goes wrong when requesting the information, I still have the checkout id to process it again
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm struggling in the same situation.
It could happen on mobile, switching trought apps, before the completition.
Or closing a tab on desktop.
What could i do to stop this or to recover lost confirmation ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I saw your message too late.
What I did was:
1) Add a loading screen so the user doesn't click away during transaction
2) Before even processing the Paypal sale information I saved the checkout ID in a temporal table, in the database
So if something goes wrong when requesting the information, I still have the checkout id to process it again
Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Integrate PayPal Commerce with Vortx? in PayPal Upgrade Community
- Connect PayPal Payments with BigCommerce? in PayPal Upgrade Community
- Connect PayPal Payments with Wix? in PayPal Upgrade Community
- Connect To PayPal script failed to show the button on recent websites built. in PayPal Payments Standard
- Our online donation forms won't connect to Paypal in PayPal Payments Standard