tags:

views:

73

answers:

2

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;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>
+1  A: 

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

JacobM
Good idea, I should have said that when it returns to index.php it also appends "?merchant_return_link=Test+Store" on to the end so it doesn't work
waitinforatrain
+1  A: 

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&amp;module=store&amp;show=order_confirm
JoeTortuga
Thanks, my solution in the end was to get it to return to a simple PHP file called paypalreturn.php, which redirected to the page I wanted to go to.
waitinforatrain