CRM-16530 introduce supportsMultipleConcurrentPayments"
authorEileen McNaughton <eileen@fuzion.co.nz>
Wed, 20 May 2015 06:36:51 +0000 (18:36 +1200)
committerEileen McNaughton <eileen@fuzion.co.nz>
Wed, 20 May 2015 06:37:30 +0000 (18:37 +1200)
CRM/Core/Payment.php
CRM/Core/Payment/ProcessorForm.php

index c33e336d32004561b89d1fbeb2c551bf7d3bb549..6e9c301c167065a4d7e39444cdae6655c24266f5 100644 (file)
@@ -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.
    *
index 9e9f33660f5e45d13f62a4747afb7a8165b02039..2717cc9ee26103d201aa1dbc30db17ac093737e3 100644 (file)
@@ -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')
       )
     ) {