Simple Checkout with DB-interaction(PHP) via Redirect

dkasai
Contributor
Contributor

Hello,

 

I´d like to use the simple integration of a Checkout button, as described here:

https://developer.paypal.com/docs/checkout/integrate/#2-set-up-a-payment 

 

Nevertheless, I´d also like to store the information, that the user has paid, in the background (in a Database via PHP) and then quickly redirect to a confirmation page.

So the sequence I have in mind, goes like that:

(1) Paypal-Button with redirect from within the Paypal-JS-Code (as described here: https://developer.paypal.com/docs/checkout/how-to/customize-flow/#do-a-full-page-redirect

(2) this (redirect)-page does the background DB action and again redirects to a confirmation page

(3) confirmation page shown to the user

 

The problem is, that - as far as I know - redirects only work with HTTP-GET, so the second page (2) has to be a public url, which can be accessed directly (triggering the DB action).

Can I somehow verify if the second page is called as a redirect from Paypal (and block all other requests)?

Or is there generally a better solution to this scenario (while ideally still working with the simple checkout option)?

 

Thanks a lot for your answers!
Best regards,

Daniel

Login to Me Too
0 REPLIES 0

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.