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 !
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.
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 ....
(*) Direct link to this section, in case you can't found it -> https://www.paypal.com/cgi-bin/customerprofileweb?cmd=_profile-website-payments
You should check the settings at https://www.sandbox.paypal.com/us/cgi-bin/webscr?cmd=_profile-website-payments and make sure
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With