From 2f5f688796e73df0001fc33a5a58d01be262cab9 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Thu, 25 Jun 2015 00:38:13 +1200 Subject: [PATCH] CRM-16407 use new factory class fo instantiating payment processors --- CRM/Contribute/BAO/Contribution/Utils.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CRM/Contribute/BAO/Contribution/Utils.php b/CRM/Contribute/BAO/Contribution/Utils.php index 6e5b6fc540..9cb582e016 100644 --- a/CRM/Contribute/BAO/Contribution/Utils.php +++ b/CRM/Contribute/BAO/Contribution/Utils.php @@ -93,13 +93,12 @@ class CRM_Contribute_BAO_Contribution_Utils { $payment = NULL; $paymentObjError = ts('The system did not record payment details for this payment and so could not process the transaction. Please report this error to the site administrator.'); - if ($isPaymentTransaction) { - $payment = CRM_Core_Payment::singleton($form->_mode, $form->_paymentProcessor, $form); + if ($isPaymentTransaction && !empty($form->_paymentProcessor)) { + // @todo - remove this line once we are sure we can just use $form->_paymentProcessor['object'] consistently. + $payment = Civi\Payment\System::singleton()->getByProcessor($form->_paymentProcessor); } - //fix for CRM-2062 //fix for CRM-16317 - $form->_params['receive_date'] = date('YmdHis'); $form->assign('receive_date', CRM_Utils_Date::mysqlToIso($form->_params['receive_date']) -- 2.25.1