From 75ead8de4bd8523266976d9f0c5b89dc4c445a76 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 20 May 2015 18:36:51 +1200 Subject: [PATCH] CRM-16530 introduce supportsMultipleConcurrentPayments" --- CRM/Core/Payment.php | 18 ++++++++++++++++++ CRM/Core/Payment/ProcessorForm.php | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index c33e336d32..6e9c301c16 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -163,6 +163,24 @@ abstract class CRM_Core_Payment { } } + /** + * Can more than one transaction be processed at once? + * + * In general processors that process payment by server to server communication support this while others do not. + * + * In future we are likely to hit an issue where this depends on whether a token already exists. + * + * @return bool + */ + protected function supportsMultipleConcurrentPayments() { + if ($this->_paymentProcessor['billing_mode'] == 4 || $this->_paymentProcessor['payment_type'] != 1) { + return FALSE; + } + else { + return TRUE; + } + } + /** * Are live payments supported - e.g dummy doesn't support this. * diff --git a/CRM/Core/Payment/ProcessorForm.php b/CRM/Core/Payment/ProcessorForm.php index 9e9f33660f..2717cc9ee2 100644 --- a/CRM/Core/Payment/ProcessorForm.php +++ b/CRM/Core/Payment/ProcessorForm.php @@ -90,7 +90,7 @@ class CRM_Core_Payment_ProcessorForm { if (!empty($form->_membershipBlock) && !empty($form->_membershipBlock['is_separate_payment']) && (!empty($form->_paymentProcessor['class_name']) && - !(CRM_Utils_Array::value('billing_mode', $form->_paymentProcessor) & CRM_Core_Payment::BILLING_MODE_FORM) + !$form->_paymentObject->supports('MultipleConcurrentPayments') ) ) { -- 2.25.1