Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PayPal PDT is not Returning a tx value in the Query String

I've gone through the (not so helpful) PayPal docs and can't find an easy answer to this problem. When the user returns from PayPal, the URL does not contain a query string and thus I do not receive the 'tx' value (or any other value for that matter).

This is an example of what I'm sending to PayPal:

<form accept-charset="utf-8" action="https://www.sandbox.paypal.com/au/cgi-bin/webscr" id="paypal-form" method="post">
    <input type="hidden" name="business" value="[email protected]">
    <input type="hidden" name="cancel_return" value="http://localhost/checkout">
    <input type="hidden" name="cmd" value="_xclick">
    <input type="hidden" name="charset" value="utf-8">
    <input type="hidden" name="currency_code" value="AUD">
    <input type="hidden" name="custom" value="155">
    <input type="hidden" name="lc" value="AU">
    <input type="hidden" name="notify_url" value="http://localhost/paypal-ipn">
    <input type="hidden" name="return" value="http://localhost/checkout">           
    <input type="hidden" name="item_name" value="ABC Company - Order #155">
    <input type="hidden" name="item_number" value="155">
    <input type="hidden" name="amount" value="8.95">
    <input type="hidden" name="discount_amount" value="0.00">
    <input type="hidden" name="shipping" value="25.00">
    <input type="image" src="https://www.paypal.com/en_AU/i/btn/btn_buynowCC_LG.gif" name="submit" alt="Buy Now">
</form>

Thanks in advance !

like image 395
Dallas Clark Avatar asked Dec 21 '11 04:12

Dallas Clark


3 Answers

I've just been struggling with this for some time, and another thing that seemingly causes no tx value to be returned is if you have a free trial.

So, if the cost of your service is free for the first 20 days then 4.99 thereafter you won't get a tx value back for the first free payment. If you charge one penny (or whatever your relevant currency is) for the initial 'free' period then you will get a tx value returned.

like image 79
ipr101 Avatar answered Oct 19 '22 05:10

ipr101


We actually logged a ticket with PayPal Merchant Technical Services to get to the bottom of this. We found that over time, some paypal merchant accounts would appear to forget their AutoReturn/PDT settings.

Even though you could go into the Website Preferences and AutoReturn and PDT were both enabled; the account would behave as if they were not enabled.

Follow this procedure to reset the settings ....

  • Click on Profile.
  • Click on "My Selling Preferences">
  • Click on "Website Preferences"

(*) Direct link to this section, in case you can't found it -> https://www.paypal.com/cgi-bin/customerprofileweb?cmd=_profile-website-payments

  • Disable both Auto Return and Payment Data Transfer.
  • Save your changes.
  • Access to Website Preferences again.
  • Enable Auto Return and Payment Data Transfer again.
  • Save your changes.
like image 34
user1798917 Avatar answered Oct 19 '22 07:10

user1798917


You should check the settings at https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_profile-website-payments and make sure

  1. Auto Return is set to ON
  2. You have specified a Return URL
  3. Payment Data Transfer is set to ON

There's another much less obvious thing I had to learn through experimentation: your form must not contain a "return" value, otherwise that will override the Return URL in your settings and prevent the Auto Return from working and you'll wind up without the necessary tx parameter. This is a relatively recent development (bug?) at Paypal, because it used to work.

like image 35
Daniel Avatar answered Oct 19 '22 06:10

Daniel