As the title says, the Return to Merchant URL on the Paypal site is incorrectly pointing to http://www.[mywebsite].com/[mydrupalinstallfolder]//[mydrupalinstallfold...

I did a search and couldn't find anything related. Looks like a simple path problem.

Comments

JoshLangner’s picture

I think I found the problem:

global $base_url;
  $return_url = variable_get('paypal_return_url', '%order-history') == '%order-history' ? t('%order-history', array('%order-history' => url("store/history/$user->uid"))) : url(variable_get('paypal_return_url', '%order-history'));
  $return_url = $base_url .'/'. $return_url;
  $cancel_url = (!strstr(variable_get('paypal_cancel_url', 'node'), 'http://')) ? $base_url. '/'. variable_get("paypal_cancel_url", 'node') : variable_get("paypal_cancel_url", 'node');

The problem comes in the line: $return_url = $base_url .'/'. $return_url;

Here is what each actually does:
* $base_url = "http://www.[mywebsite].com/[mydrupalinstallfolder]"
* plus we're adding an extra "/"
* $return_url = "/[mydrupalinstallfolder]/store/history/2"

"$base_url" needs to be replaced with "base_path()", and we don't need that extra slash in there. I think that should fix it. We should also check for other misused cases of $base_url and base_path().

sime’s picture

Component: paypal.module » paypal

fixing component

gordon’s picture

Status: Active » Fixed

Fixed in v4

Anonymous’s picture

Status: Fixed » Closed (fixed)