Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paypal return URL - using GET parameters?

Tags:

php

paypal

Here's some simple code I'm using to test the Paypal Website Payments Standard upload thingy.

My return URL is http://mysite/index.php?module=store&show=order_confirm I go through the payment process, and when I get to the end and it returns me to the page, it instead just returns me to index.php (i.e. without the extra parameters).

Anyone know what the deal with this is

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">

    <input type="hidden" name="cmd" value="_cart" />

    <input type="hidden" name="upload" value="1">
    <input type="hidden" name="return" value="http://mysite/index.php?module=store&amp;show=order_confirm" />
    <input type="hidden" name="currency_code" value="EUR" />

    <input type="hidden" name="business" value="[email protected]">

            <input type="hidden" name="item_name_1" value="adaddada" />
            <input type="hidden" name="amount_1" value="30.00" />

            <input type="hidden" name="quantity_1" value="1" />
                            <input type="hidden" name="item_name_2" value="wuiui" />
            <input type="hidden" name="amount_2" value="50.00" />
            <input type="hidden" name="quantity_2" value="1" />


    <input type="hidden" name="custom" value="19" />

    <input type="image" name="submit" border="0" src="https://www.paypal.com/en_US/i/btn/btn_xpressCheckout.gif" alt="PayPal - The safer, easier way to pay online">

</form>
like image 403
bcoughlan Avatar asked Jan 21 '23 21:01

bcoughlan


2 Answers

I'm not sure why Paypal is doing what it's doing, but I suspect their desire to add their own GET parameters is wiping out your own. You might want to try something like this, if mod_rewrite or something similar is available to you:

write a rule that changes this:

http://mysite/store/order_confirm/?merchant_return_link=Test+Store

to this

http://mysite/index.php?merchant_return_link=Test+Store&module=store&show=order_confirm
like image 136
JoeTortuga Avatar answered Jan 24 '23 09:01

JoeTortuga


Try escaping the ? and & in the return URL; change them to %3F and %26.

like image 42
Jacob Mattison Avatar answered Jan 24 '23 09:01

Jacob Mattison