How to set that the referer is the PayPal?

132 Views Asked by At

After the PayPal payment it redirects me to the my website. How can I set that user was redirected from the PayPal?

I did try the next variants:

request.env["HTTP_REFERER"]
request.referer
URI(request.referer).path

but nothing.

And one more question, can I catch that the referer is from PayPal exactly or user did it, the redirect, with the online tools, that was it fabricated or no?

1

There are 1 best solutions below

2
On

This is exactly what PayPal's PDT feature is for. It sends you secure variables about the transaction just made, which you can verify via a postback to PayPal just like PayPal's aynchronous notification system IPN. Here's how:

https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/paymentdatatransfer/