I’m currently working on a web app that includes a PayPal “buy now” button. To acquire this button, I converted my PayPal account into a business account and obtained the code automatically generated by PayPal:
<script src="https://www.paypal.com/sdk/js?client-id=MYID&components=hosted-buttons&disable-funding=venmo¤cy=EUR"></script>
<div id="paypal-container-IDBUTTON"></div>
<script>
paypal.HostedButtons({
hostedButtonId: "ID BUTTON",
}).render("#paypal-container-IDBUTTON")
</script>
This setup is functioning well; however, while exploring the documentation, I noticed that additional functionality can be added to the paypal.HostedButtons() function, such as onExit. Unfortunately, it appears that these functions are not being executed (I attempted to use console.log to verify).
Beyond this, I’m encountering a more pressing issue: how can I call a function to modify data in the database after a payment has been successfully completed?
banana23 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.