From 9ffd78de31ed823edc6687054e1c7512234f32f7 Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Wed, 18 Jan 2023 20:01:53 +0000 Subject: [PATCH] Paypal: Use standard functions for cancelUrl / notifyUrl --- CRM/Core/Payment/PayPalImpl.php | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/CRM/Core/Payment/PayPalImpl.php b/CRM/Core/Payment/PayPalImpl.php index 220d4e9a2f..bbaa04114c 100644 --- a/CRM/Core/Payment/PayPalImpl.php +++ b/CRM/Core/Payment/PayPalImpl.php @@ -936,30 +936,15 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { $notifyParameters[$notifyName] = $params[$paramsName]; } } - $notifyURL = $this->getNotifyUrl(); - $config = CRM_Core_Config::singleton(); - $url = $this->getBaseReturnUrl(); - $cancel = ($this->_component == 'event') ? '_qf_Register_display' : '_qf_Main_display'; - - $cancelUrlString = "$cancel=1&cancel=1&qfKey={$params['qfKey']}"; - if (!empty($params['is_recur'])) { - $cancelUrlString .= "&isRecur=1&recurId={$params['contributionRecurID']}&contribId={$params['contributionID']}"; - } - - $cancelURL = CRM_Utils_System::url( - $url, - $cancelUrlString, - TRUE, NULL, FALSE - ); $paypalParams = [ 'business' => $this->_paymentProcessor['user_name'], - 'notify_url' => $notifyURL, + 'notify_url' => $this->getNotifyUrl(), 'item_name' => $this->getPaymentDescription($params, 127), 'quantity' => 1, 'undefined_quantity' => 0, - 'cancel_return' => $cancelURL, + 'cancel_return' => $this->getCancelUrl($params['qfKey'], $params['participantID'] ?? NULL), 'no_note' => 1, 'no_shipping' => 1, 'return' => $this->getReturnSuccessUrl($params['qfKey']), -- 2.25.1