PayPal automatic return does not return POST data

I have a similar problem with this post

Configure PayPal return URL and automatically return it?

However, the solution does not work there. We have an IPN setting, and the POST variables are passed back (the visitor clicks back and can download the purchased PDF files), but then I tried to get rid of the Paypal order confirmation page, which says

You have just completed a payment. The transaction ID for this payment is: XXXXXXXXXXXXXX.

and turned on "Automatic return" in the payment settings of the website, specifying the URL http://www.educted.ca/payment_complete.php , now the POST variables do not return to payment_complete.php - it appears empty. As soon as I turn off Auto Return, the POST variables are displayed correctly and purchased products can be downloaded. Of course I use a Paypal Sandbox account.

<input type="hidden" name="return" value="<?php echo LIVE_SITE;>payment_complete.php"> <input type="hidden" name="cancel_return" value="<?php echo LIVE_SITE; ?>catalog.php"> <input type="hidden" name="notify_url" value="<?php echo LIVE_SITE; ?>ipn.php"> <input type="hidden" name="rm" value="2"> 

Any ideas?

+8
php return paypal paypal-ipn
source share
4 answers

If you enable Auto Return, values ​​will always be returned via GET no matter what rm set for.

If you want to deliver files immediately after the customer completes the transaction, check out PayPal Payment Data Transfer. Once enabled, PDT adds tx GET var to your return URL; By calling PayPal at https://www.paypal.com/cgi-bin/webscr?cmd=_notify-synch&tx=value-for-tx-here&at=value-for-your-paypal-account-authentication-token , you can get additional data about the transaction and immediately check whether it is valid. See Also https://www.paypal.com/pdt/

IPN must be reserved for backend processing, as a significant delay can occur.
PDT, on the other hand, you retrieve information from PayPal and as such immediately.

+13
source share

You can still keep the Auto Return value set to On, but be sure to turn off PDT and you will get all transactional variables sent to your return URL via POST (if you have the rm parameter equal to 2 in your request, of course, like you said you have).

For some reason, turning on PDT will ignore the rm parameter and force the use of the GET method.

+4
source share

In your particular case, it was showing empty due to an error in your code:

 <?php echo LIVE_SITE;> 

This is not parsed as valid PHP - it will lead to a fatal error. If the information is not yet displayed and the error report is disabled, it will be a blank page.

+1
source share

You can still keep the Auto Return value set to On, but be sure to turn off PDT and you will get all transactional variables sent to your return URL via POST (if you have the rm parameter equal to 2 in your request, of course, like you said you have).

This is the correct answer! You should not include sending payment data with an answering machine if you want to receive POST data.

BUT, in this case, you must use the https site, otherwise the client will receive a warning before redirecting!

+1
source share

All Articles