I'm getting invalid ReturnURL error when trying to use PayPal Express. And I'm not seeing any options for setting the return url in the Store settings page.

I've tried setting the return parameter in the checkout-tag, but it doesn't seem to help

{exp:store:checkout return="https://www.example.no"}
{exp:store:checkout return="store/order/ORDER_HASH"}

None of the above works (the second one is the same as in the example template)

Any suggestions?

Edit: I think I found the problem. We use config-bootstrap in our EE, and there I've set up the site_url as

define('NSM_SITE_URL', '//' . NSM_SERVER_NAME);

This is to make plugins like minimee work when we're on https and http. So the site url wil be spit out like //www.example.com, and this is the reason PayPal is getting angry at me.

I found a way around it, though, but I'm not happy about it. In merchant_paypal_express.php in the system/ee/third_party/-folder, I changed the _build_authorize_or_purchase() method a bit:

$request['RETURNURL'] = 'https:' . $this->param('return_url');
$request['CANCELURL'] = 'https:' . $this->param('cancel_url');

As you see, I added https hardcoded to the url. But now it works.

1 Answer 1


Give your .htaccess file a check to see if there is anything in there which could interfere with the return path. If you're unsure then copy and paste it in to your question so we can give it a quick check.

Failing that try including a hidden field in between your checkout tags:

<input type="hidden" name="return_url" value="http://domain.com/store/order/ORDER_HASH" />

Make sure the above is the correct return URL in full. Give that a try and see if it yields any different results so we have something to go on from there. Let me know how it goes.

  • Hi, thanks. I've been looking into it, and I found a dirty fix for it, as explained above. Any suggestions to fix this a better way would be appreciated (:
    – peirix
    Sep 4, 2013 at 9:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.