X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FPayment.php;h=63c2ce9033cf3feb07c51cdb39f9451f54ca02c7;hb=01b67c50f6f13dc0adfd6ec4b1dcf0f3d2423f12;hp=425de725409d6d2cfbc5e8efe9e109e1493b174a;hpb=674cb8b854f6008090d4dcce9372ee76346a198f;p=civicrm-core.git diff --git a/CRM/Core/Payment.php b/CRM/Core/Payment.php index 425de72540..63c2ce9033 100644 --- a/CRM/Core/Payment.php +++ b/CRM/Core/Payment.php @@ -89,7 +89,7 @@ abstract class CRM_Core_Payment { * @return CRM_Core_Payment * @throws \CRM_Core_Exception */ - public static function &singleton($mode = 'test', &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) { + public static function singleton($mode = 'test', &$paymentProcessor, &$paymentForm = NULL, $force = FALSE) { // make sure paymentProcessor is not empty // CRM-7424 if (empty($paymentProcessor)) { @@ -206,6 +206,27 @@ abstract class CRM_Core_Payment { } } + /** + * Getter for the payment processor. + * + * The payment processor array is based on the civicrm_payment_processor table entry. + * + * @return array + * Payment processor array. + */ + public function getPaymentProcessor() { + return $this->_paymentProcessor; + } + + /** + * Setter for the payment processor. + * + * @param array $processor + */ + public function setPaymentProcessor($processor) { + $this->_paymentProcessor = $processor; + } + /** * Setter for the payment form that wants to use the processor. * @@ -599,10 +620,7 @@ abstract class CRM_Core_Payment { } else { // Legacy or extension as module instance - if (empty($paymentClass)) { - $paymentClass = 'CRM_Core_' . $dao->class_name; - - } + $paymentClass = 'CRM_Core_' . $dao->class_name; } $processorInstance = Civi\Payment\System::singleton()->getById($dao->processor_id);