From 3a80832aeab9097aefd0179ae96b31fb1f91be85 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sun, 12 Jul 2015 17:35:56 +1200 Subject: [PATCH] CRM-16808 standards on doPreApproval rather than doExpressCheckout --- CRM/Core/Payment.php | 2 +- CRM/Core/Payment/PayPalImpl.php | 2 +- CRM/Core/Payment/PaymentExpress.php | 27 ------------------------ CRM/Core/Payment/Realex.php | 27 ------------------------ CRM/Event/Form/Registration/Register.php | 2 +- 5 files changed, 3 insertions(+), 57 deletions(-) diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index 9410f7f168..8499202b38 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -249,7 +249,7 @@ abstract class CRM_Core_Payment { * - pre_approval_parameters (this will be stored on the calling form & available later) * - redirect_url (if set the browser will be redirected to this. */ - protected function doPreApproval($params) {} + public function doPreApproval($params) {} /** * Default payment instrument validation. diff --git a/CRM/Core/Payment/PayPalImpl.php b/CRM/Core/Payment/PayPalImpl.php index 7cc8755026..ee6b4adbcc 100644 --- a/CRM/Core/Payment/PayPalImpl.php +++ b/CRM/Core/Payment/PayPalImpl.php @@ -154,7 +154,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { * @return array * the result in an nice formatted array (or an error object) */ - public function setExpressCheckOut(&$params) { + protected function setExpressCheckOut(&$params) { $args = array(); $this->initialize($args, 'SetExpressCheckout'); diff --git a/CRM/Core/Payment/PaymentExpress.php b/CRM/Core/Payment/PaymentExpress.php index b87834024a..bf3dd9f41f 100644 --- a/CRM/Core/Payment/PaymentExpress.php +++ b/CRM/Core/Payment/PaymentExpress.php @@ -95,33 +95,6 @@ class CRM_Core_Payment_PaymentExpress extends CRM_Core_Payment { } } - /** - * @param array $params - * - * @throws Exception - */ - public function setExpressCheckOut(&$params) { - CRM_Core_Error::fatal(ts('This function is not implemented')); - } - - /** - * @param $token - * - * @throws Exception - */ - public function getExpressCheckoutDetails($token) { - CRM_Core_Error::fatal(ts('This function is not implemented')); - } - - /** - * @param array $params - * - * @throws Exception - */ - public function doExpressCheckout(&$params) { - CRM_Core_Error::fatal(ts('This function is not implemented')); - } - /** * This function collects all the information from a web/api form and invokes * the relevant payment processor specific functions to perform the transaction diff --git a/CRM/Core/Payment/Realex.php b/CRM/Core/Payment/Realex.php index 474d8f9423..a31171ecbf 100644 --- a/CRM/Core/Payment/Realex.php +++ b/CRM/Core/Payment/Realex.php @@ -76,33 +76,6 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment { $this->_setParam('sequence', rand(1, 1000)); } - /** - * @param array $params - * - * @throws Exception - */ - public function setExpressCheckOut(&$params) { - CRM_Core_Error::fatal(ts('This function is not implemented')); - } - - /** - * @param $token - * - * @throws Exception - */ - public function getExpressCheckoutDetails($token) { - CRM_Core_Error::fatal(ts('This function is not implemented')); - } - - /** - * @param array $params - * - * @throws Exception - */ - public function doExpressCheckout(&$params) { - CRM_Core_Error::fatal(ts('This function is not implemented')); - } - /** * @param array $params * diff --git a/CRM/Event/Form/Registration/Register.php b/CRM/Event/Form/Registration/Register.php index 07ab16b89b..44254ac314 100644 --- a/CRM/Event/Form/Registration/Register.php +++ b/CRM/Event/Form/Registration/Register.php @@ -1170,7 +1170,7 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { ); $params['invoiceID'] = $invoiceID; - $token = $payment->setExpressCheckout($params); + $token = $payment->doPreApproval($params); if (is_a($token, 'CRM_Core_Error')) { CRM_Core_Error::displaySessionError($token); CRM_Utils_System::redirect($params['cancelURL']); -- 2.25.1