Hello I use Checkout-PHP-SDK V2 here https://github.com/paypal/Checkout-PHP-SDK
The payment button like this:
<<removed<>
paypal.Buttons({
createOrder: function(data, actions) {
return fetch('/createorder', {
method: 'post'
}).then(function(res) {
return res.json();
}).then(function(data) {
return data.orderID;
});
},
onApprove: function(data, actions) {
return actions.order.capture().then(function() {
window.location = "/getorder/" + data.orderID;
});
}
}).render('#paypal-button-container');
</script>
it works but I want to display a message (please wait) at the closing of modal paypal so that the buyer does not close the page or refresh it otherwise it will not be redirected with window.location that I have in onApprove
Please excuse my English I did the translation from google to communicate with you.
... View more