New to the community? Welcome! Please read our Community Rules and Guidelines
If you want to report illegal content under the EU Digital Services Act, please do so here
Paypal payments, checkouts, paypalcheckout. I must be able to receive data on success.php delete.php
Help me: I need to know when the product has been paid and then insert it in the MySQL or JSON dB
<div id="paypal-button-container"></div>
<div id="paypal-button"></div>
<script src="https://www.paypalobjects.com/api/checkout.js"></script>
<script>
paypal.Button.render({
env: '<?php echo PayPalENV; ?>', client: {
<?php if(ProPayPal) { ?>
production: '<?php echo PayPalClientId; ?>'
<?php } else { ?>
sandbox: '<?php echo PayPalClientId; ?>'
<?php } ?>
},
// Customize button";
style: {
size: 'large',
shape: 'pill',
color: 'white',
layout: 'horizontal',
label: 'pay',
},
payment: function (data, actions) {
return actions.payment.create({
transactions: [{
amount: {
total: '<?php echo $productPrice; ?>',
currency: '<?php echo $currency; ?>'
}
}]
});
},
onAuthorize: function (data, actions) {
return actions.payment.execute()
.then(function () {
window.location = "<?php echo PayPalBaseUrl ?>orderDetails.php?paymentID="+data.paymentID+"&payerID="+data.payerID+"&token="+data.paymentToken+"&pid=<?php echo $productId; ?>";
});
}
}, '#paypal-button');
</script>
I have to create success.php or cancel.php but I don't get data from paypal, who helps me with a functioning example?
Thank you
Lady