From d8ce0d683cd9293bfdd94a806e48bc5e3ecb86b4 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sat, 1 Nov 2014 11:32:30 +1300 Subject: [PATCH] fixing processor based support --- CRM/Contribute/Form/AbstractEditPayment.php | 1 - CRM/Core/Payment.php | 6 +++--- CRM/Core/Payment/AuthorizeNet.php | 2 +- CRM/Core/Payment/Dummy.php | 2 +- CRM/Core/Payment/PayPalImpl.php | 2 +- CRM/Core/Payment/Realex.php | 2 +- CRM/Financial/BAO/PaymentProcessor.php | 2 +- 7 files changed, 8 insertions(+), 9 deletions(-) diff --git a/CRM/Contribute/Form/AbstractEditPayment.php b/CRM/Contribute/Form/AbstractEditPayment.php index 554a9eeee8..34f031ce6e 100644 --- a/CRM/Contribute/Form/AbstractEditPayment.php +++ b/CRM/Contribute/Form/AbstractEditPayment.php @@ -348,7 +348,6 @@ LEFT JOIN civicrm_contribution on (civicrm_contribution.contact_id = civicrm_co * @throws Exception */ public function getValidProcessors() { - $validProcessors = array(); $defaultID = NULL; $capabilities = array('BackOffice'); if ($this->_mode == 'live') { diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index b865aea8ba..432b1c21f1 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -163,7 +163,7 @@ abstract class CRM_Core_Payment { * are back office payments supported - e.g paypal standard won't permit you to enter a credit card associated with someone else's login * @return bool */ - private function supportsBackOffice() { + protected function supportsBackOffice() { return TRUE; } @@ -171,7 +171,7 @@ abstract class CRM_Core_Payment { * are back office payments supported - e.g paypal standard won't permit you to enter a credit card associated with someone else's login * @return bool */ - private function supportsLiveMode() { + protected function supportsLiveMode() { return TRUE; } @@ -180,7 +180,7 @@ abstract class CRM_Core_Payment { * We set this to false for historical consistency but in fact most new processors use tokens for recurring and can support this * @return bool */ - private function supportsFutureRecurStartDate() { + protected function supportsFutureRecurStartDate() { return FALSE; } diff --git a/CRM/Core/Payment/AuthorizeNet.php b/CRM/Core/Payment/AuthorizeNet.php index ce115deabc..a07329d129 100644 --- a/CRM/Core/Payment/AuthorizeNet.php +++ b/CRM/Core/Payment/AuthorizeNet.php @@ -88,7 +88,7 @@ class CRM_Core_Payment_AuthorizeNet extends CRM_Core_Payment { * In the case of Authorize.net this is an option * @return bool */ - private function supportsFutureRecurStartDate() { + protected function supportsFutureRecurStartDate() { return TRUE; } diff --git a/CRM/Core/Payment/Dummy.php b/CRM/Core/Payment/Dummy.php index 5312ee0dee..1d25494977 100644 --- a/CRM/Core/Payment/Dummy.php +++ b/CRM/Core/Payment/Dummy.php @@ -126,7 +126,7 @@ class CRM_Core_Payment_Dummy extends CRM_Core_Payment { * are back office payments supported - e.g paypal standard won't permit you to enter a credit card associated with someone else's login * @return bool */ - private function supportsLiveMode() { + protected function supportsLiveMode() { return FALSE; } diff --git a/CRM/Core/Payment/PayPalImpl.php b/CRM/Core/Payment/PayPalImpl.php index 8a74b9e608..f3c6cf5e68 100644 --- a/CRM/Core/Payment/PayPalImpl.php +++ b/CRM/Core/Payment/PayPalImpl.php @@ -98,7 +98,7 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { * are back office payments supported - e.g paypal standard won't permit you to enter a credit card associated with someone else's login * @return bool */ - private function supportsBackOffice() { + protected function supportsBackOffice() { if ($this->_processorName == ts('PayPal Pro')) { return TRUE; } diff --git a/CRM/Core/Payment/Realex.php b/CRM/Core/Payment/Realex.php index 2122c6ad79..0d63fd12f7 100644 --- a/CRM/Core/Payment/Realex.php +++ b/CRM/Core/Payment/Realex.php @@ -87,7 +87,7 @@ class CRM_Core_Payment_Realex extends CRM_Core_Payment { * @return object * @static */ - static function &singleton($mode, &$paymentProcessor) { + static function &singleton($mode, &$paymentProcessor, &$paymentForm = NULL, $force = false) { $processorName = $paymentProcessor['name']; if (self::$_singleton[$processorName] === NULL) { self::$_singleton[$processorName] = new CRM_Core_Payment_Realex($mode, $paymentProcessor); diff --git a/CRM/Financial/BAO/PaymentProcessor.php b/CRM/Financial/BAO/PaymentProcessor.php index b14e0b55c1..1a72cbf6ab 100644 --- a/CRM/Financial/BAO/PaymentProcessor.php +++ b/CRM/Financial/BAO/PaymentProcessor.php @@ -335,7 +335,7 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces continue; } foreach ($capabilities as $capability) { - if ($capability && !$processor['object']->supports($capability)) { + if (($processor['object']->supports($capability)) == FALSE) { unset ($processors[$index]); } } -- 2.25.1