From 391109282c5deb7e008dcfb2efa2ee07c91ea357 Mon Sep 17 00:00:00 2001 From: Peter Haight Date: Wed, 18 Nov 2020 18:45:06 -0800 Subject: [PATCH] Fix redirect to PayPal If you put in double slashes in the path part of the PayPal URL and then PayPal asks you to do their captcha, they have some sort of bug where they do the wrong redirect after the captcha to https://cgi-bin/webscr. Issue #153 --- CRM/Core/Payment/PayPalImpl.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CRM/Core/Payment/PayPalImpl.php b/CRM/Core/Payment/PayPalImpl.php index e2f8cb7596..88ba727eca 100644 --- a/CRM/Core/Payment/PayPalImpl.php +++ b/CRM/Core/Payment/PayPalImpl.php @@ -843,9 +843,10 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { } $this->_component = $params['component']; $token = $this->setExpressCheckOut($params); + $siteUrl = rtrim($this->_paymentProcessor['url_site'], '/'); return [ 'pre_approval_parameters' => ['token' => $token], - 'redirect_url' => $this->_paymentProcessor['url_site'] . "/cgi-bin/webscr?cmd=_express-checkout&token=$token", + 'redirect_url' => $siteUrl . "/cgi-bin/webscr?cmd=_express-checkout&token=$token", ]; } -- 2.25.1