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.
... View more