9

I have a similar problem to this post

Setting PayPal return URL and making it auto return?

However, the solution there is not working. We have IPN set up and POST variables get passed back (the visitor clicks back and is able to download purchased PDF files) but then I tried to get rid of Paypal order confirmation page that says

you just completed your payment. Your transaction ID for this payment is: XXXXXXXXXXXXX.

and enabled "Auto Return" in Website Payment Preferences, specifying the URL http://www.educted.ca/payment_complete.php, the POST variables now do not get passed back to payment_complete.php - it shows blank. As soon as I disable "Auto Return", POST variables display properly and products purchased can be downloaded. I am using Paypal Sandbox account, of course.

<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?

Community
  • 1
  • 1
Natalia
  • 417
  • 3
  • 7
  • 18

4 Answers4

14

If you enable Auto Return, the values are always going to get returned via GET irrespective of what rm is set to.

If you want to do immediate file delivery after the buyer has completed the transaction, have a look at PayPal Payment Data Transfer. Once enabled, PDT adds a 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'll be able to pull in extra data about the transaction, and immediately check whether it's valid.
See also https://www.paypal.com/pdt/

IPN should be reserved for backend processing as it can come with a significant delay.
PDT, on the other hand, has you pulling the info from PayPal, and is as such immediate.

Robert
  • 19,326
  • 3
  • 58
  • 59
  • Thank you! What does this mean "IPN should be reserved for backend processing"? What would be an appropriate use for IPN then? Do we need to use it in our case? – Natalia Dec 28 '11 at 23:28
  • Yes, by using IPN you will be automatically kept updated in case something happens to the transaction after it has been completed (for example, if PayPal decides to review the transaction, or if the buyer suddenly file a PayPal case against you). – Robert Dec 29 '11 at 18:23
  • I am doing this but we are NOT getting a tx= variable back in the url? Also nothing back in the post variables? Has something changed? – YodasMyDad Aug 15 '13 at 13:55
4

You can still keep Auto Return set to On, but make sure you DISABLE PDT, and you will get all the transaction variables sent to your return URL via POST (if you have the rm parameter set to 2 in your request of course, as you said you have).

For some reason, enabling PDT will ignore the rm parameter and force the GET method to be used.

1

You can still keep Auto Return set to On, but make sure you DISABLE PDT, and you will get all the transaction variables sent to your return URL via POST (if you have the rm parameter set to 2 in your request of course, as you said you have).

This is the correct answer! You must not enable sending payment data with auto response, if you want get POST-Data.

BUT, in this case you have to use a https-site, otherwise the customer get a warning before redirecting!

Dirk_G
  • 161
  • 1
  • 2
0

In your particular case, it was showing blank because of an error in your code:

<?php echo LIVE_SITE;>

That doesn't parse as valid PHP - it'd cause a fatal error. If no information has been output yet and error reporting is off, it'll be a blank page.

James Pederson
  • 404
  • 2
  • 7