Adding param to return paypal url instead of redirecting user

This commit is contained in:
Christophe LATOUR 2017-11-14 19:50:57 +01:00
parent 2571a14fec
commit 83daadd46b

View File

@ -578,7 +578,7 @@ class PaypalExpressCheckout extends Paypal
return false;
}
public function redirectToAPI()
public function redirectToAPI($return_url = false)
{
$this->secure_key = $this->getSecureKey();
$this->_storeCookieInfo();
@ -588,7 +588,12 @@ class PaypalExpressCheckout extends Paypal
else
$url = '/websc&cmd=_express-checkout';
Tools::redirectLink('https://'.$this->getPayPalURL().$url.'&token='.urldecode($this->token));
$paypal_url = 'https://'.$this->getPayPalURL().$url.'&token='.urldecode($this->token);
if ($return_url !== false) {
return $paypal_url;
} else {
Tools::redirectLink($paypal_url);
}
exit(0);
}