PayPal Refund URL

Here is the code for my Paypal button:

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="cmd" value="_xclick"> <input type="hidden" name="business" value=" my@email.com "> <input type="hidden" name="lc" value="GB"> <input type="hidden" name="button_subtype" value="products"> <input type="hidden" name="no_note" value="1"> <input type="hidden" name="no_shipping" value="1"> <input type="hidden" name="rm" value="0"> <input type="hidden" name="return" value="http://www.example.com"> <input type="hidden" name="item_name" value="My Item"> <input type="hidden" name="amount" value="25.00"> <input type="hidden" name="currency_code" value="GBP"> <input type="hidden" name="bn" value="PP-BuyNowBF:proceed_btn.gif:NonHosted"> <input type="hidden" name="item_number" value="4BD9569402CDE"> <input type="image" src="http://www.example.com/image.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online."> <img alt="" border="0" src="https://www.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1"> </form> 

Is it possible to add item_number to the return url?

For example, after payment in PayPal is completed, the user is sent back to http://www.example.com?item_number=4BD9569402CDE

+4
source share
5 answers

I decided to go differently.

I realized that you can tell PayPal to send all your requests via POST, so I will add some POST checks to my PHP, and it should work fine.

Thanks for answers.

+4
source

I remember reading in my docs that you can add a new hidden field with any custom value that will be sent back to you.

You can use this field for anything - I don’t remember from memory how it was called, although, sorry, but if you have documents, you will find it quite easily.

+4
source

Adding

 <input type="hidden" name="rm" value="2" /> 

works too

+4
source

Why not just encode it in the file name:

 http://www.mysite.com/ppreturn/2938 

And then use mod_rewrite to turn it into a query string:

 RewriteRule ^/ppreturn/([1-9]+[0-9]*) /ppreturn/myscript.php?prodid=$1 

If paypal adds request data to your url (always), you can use mod_rewrite to add it to the end.

The full mod_rewrite tutorial is a bit beyond the scope, but Interwebs is full of information. Run with Apache docs . There is also a comparable system for IIS .

change

I comment 2 years later, but my answer is BAD. The accepted answer is better. GET requests should not theoretically mutate a state, especially when it is something like payments

+2
source

As far as I know, you cannot return vars to the PayPal return link. The biggest drawback is Paypals, and I have no idea why they don't allow you.

I always went around it by storing vars in cookies - this is by no means an ideal solution.

PayPal Pro may have more features though?

+1
source

Source: https://habr.com/ru/post/1308343/


All Articles