X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FPayment.php;h=56249840903185d4f2f806e43a08b0e0daa56e21;hb=f2da77e6f4b87543c91a5baecbcd144d744cd585;hp=0910d79d8a5658ad3b09313593cb9980907b26ed;hpb=cdeb4bdffdfc26d382057594206ed1f39721f6f6;p=civicrm-core.git diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index 0910d79d8a..5624984090 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -1,7 +1,7 @@ method * * @public @@ -253,15 +255,12 @@ abstract class CRM_Core_Payment { // Check pp is extension $ext = CRM_Extension_System::singleton()->getMapper(); if ($ext->isExtensionKey($dao->class_name)) { - $extension_instance_found = TRUE; $paymentClass = $ext->keyToClass($dao->class_name, 'payment'); require_once $ext->classToPath($paymentClass); } else { - // Legacy instance - but there may also be an extension instance, so - // continue on to the next instance and check that one. We'll raise an - // error later on if none are found. - continue; + // Legacy or extension as module instance + $paymentClass = 'CRM_Core_' . $dao->class_name; } $paymentProcessor = CRM_Financial_BAO_PaymentProcessor::getPayment($dao->processor_id, $mode); @@ -278,13 +277,14 @@ abstract class CRM_Core_Payment { if (!method_exists($processorInstance, $method) || !is_callable(array($processorInstance, $method)) ) { - // No? This will be the case in all instances, so let's just die now - // and not prolong the agony. - CRM_Core_Error::fatal("Payment processor does not implement a '$method' method"); + // on the off chance there is a double implementation of this processor we should keep looking for another + // note that passing processor_id is more reliable & we should work to deprecate processor_name + continue; } // Everything, it seems, is ok - execute pp callback handler $processorInstance->$method(); + $extension_instance_found = TRUE; } if (!$extension_instance_found) CRM_Core_Error::fatal( @@ -373,8 +373,9 @@ INNER JOIN civicrm_contribution con ON ( con.contribution_recur_id = rec.id ) */ static function allowBackofficeCreditCard($template = NULL, $variableName = 'newCredit') { $newCredit = FALSE; + // restrict to type=1 (credit card) payment processor payment_types and only include billing mode types 1 and 3 $processors = CRM_Core_PseudoConstant::paymentProcessor(FALSE, FALSE, - "billing_mode IN ( 1, 3 )" + "billing_mode IN ( 1, 3 ) AND payment_type = 1" ); if (count($processors) > 0) { $newCredit = TRUE;