From 068fb0de9c5e4bc2962006063979ad9be39d72b2 Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 4 Oct 2016 22:08:14 +1300 Subject: [PATCH] CRM-18483 further Joomla! fix --- CRM/Core/Payment.php | 30 ++---------------------------- CRM/Core/Payment/PayPalIPN.php | 2 +- CRM/Core/Payment/PayPalImpl.php | 7 ++----- 3 files changed, 5 insertions(+), 34 deletions(-) diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index 2bc3116100..ee25a93867 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -47,33 +47,6 @@ abstract class CRM_Core_Payment { */ protected $_component; - /** - * Parameters to append to the notify url. - * - * The notify url is passed to the payment processor and the processor uses it for return ping backs or redirection. - * - * @var array - */ - protected $notifyUrlParameters = array(); - - /** - * Get notify url parameters. - * - * @return array - */ - public function getNotifyUrlParameters() { - return $this->notifyUrlParameters; - } - - /** - * Set notify url parameters. - * - * @param array $notifyUrlParameters - */ - public function setNotifyUrlParameters($notifyUrlParameters) { - $this->notifyUrlParameters = $notifyUrlParameters; - } - /** * How are we getting billing information. * @@ -993,7 +966,7 @@ abstract class CRM_Core_Payment { protected function getNotifyUrl() { $url = CRM_Utils_System::url( 'civicrm/payment/ipn/' . $this->_paymentProcessor['id'], - $this->getNotifyUrlParameters(), + array(), TRUE, NULL, FALSE @@ -1173,6 +1146,7 @@ abstract class CRM_Core_Payment { $params['processor_id'] = $_GET['processor_id'] = $lastParam; } else { + self::logPaymentNotification($params); throw new CRM_Core_Exception("Either 'processor_id' (recommended) or 'processor_name' (deprecated) is required for payment callback."); } } diff --git a/CRM/Core/Payment/PayPalIPN.php b/CRM/Core/Payment/PayPalIPN.php index 6bdc0e4623..c65a251522 100644 --- a/CRM/Core/Payment/PayPalIPN.php +++ b/CRM/Core/Payment/PayPalIPN.php @@ -52,7 +52,7 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { * @throws CRM_Core_Exception */ public function __construct($inputData) { - $this->setInputParameters($inputData); + $this->setInputParameters(array_merge($inputData, json_decode($inputData['custom'], TRUE))); parent::__construct(); } diff --git a/CRM/Core/Payment/PayPalImpl.php b/CRM/Core/Payment/PayPalImpl.php index c996175f39..92691180d4 100644 --- a/CRM/Core/Payment/PayPalImpl.php +++ b/CRM/Core/Payment/PayPalImpl.php @@ -805,13 +805,13 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { 'membershipID' => 'membershipID', 'related_contact' => 'relatedContactID', 'onbehalf_dupe_alert' => 'onBehalfDupeAlert', + 'accountingCode' => 'accountingCode', ); foreach ($notifyParameterMap as $paramsName => $notifyName) { if (!empty($params[$paramsName])) { $notifyParameters[$notifyName] = $params[$paramsName]; } } - $this->setNotifyUrlParameters($notifyParameters); $notifyURL = $this->getNotifyUrl(); $config = CRM_Core_Config::singleton(); @@ -829,9 +829,6 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { TRUE, NULL, FALSE ); - $customParams = array_merge($notifyParameters, array( - 'accountingCode' => CRM_Utils_Array::value('accountingCode', $params), - )); $paypalParams = array( 'business' => $this->_paymentProcessor['user_name'], 'notify_url' => $notifyURL, @@ -847,7 +844,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { 'invoice' => $params['invoiceID'], 'lc' => substr($config->lcMessages, -2), 'charset' => function_exists('mb_internal_encoding') ? mb_internal_encoding() : 'UTF-8', - 'custom' => json_encode($customParams), + 'custom' => json_encode($notifyParameters), 'bn' => 'CiviCRM_SP', ); -- 2.25.1