I'm trying to integrate paypal payment into my web site.
EDIT:
After a sucessfull payment I want to redirect to a PHP page to manipulate payment data, for instance: Saving to db transaction and payment id, payer email , send email etc.
So this is my "onApprove" function:
onApprove: function(data, actions) {
var EXECUTE_URL = 'https://www.mywebsite.com/actions/paymentsuccess.php';
return fetch(EXECUTE_URL, {
method: 'post',
headers: {
'content-type': 'application/json'
},
body: JSON.stringify({
paymentID: data.paymentID,
payerID: data.payerID,
payerEmail: data.payerEmail,
payerName: data.payerName,
payerPhone: data.payerPhone
})
});
},
How to call a PHP page (maybe with a POST ) and pass all payment data, and elaborate that page (i don't need to stay to the payment page) ?
Thanks
question from:
https://stackoverflow.com/questions/65831161/paypal-smart-button-how-to-redirect-to-a-php-page-after-successfull-payment 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…