diff --git a/CRM/Financial/BAO/PaymentProcessor.php b/CRM/Financial/BAO/PaymentProcessor.php index 636706852c6a..86addccd3e95 100644 --- a/CRM/Financial/BAO/PaymentProcessor.php +++ b/CRM/Financial/BAO/PaymentProcessor.php @@ -218,34 +218,6 @@ public static function del($paymentProcessorID) { public static function getPayment($paymentProcessorID, $mode = 'based_on_id') { $capabilities = ($mode == 'test') ? array('TestMode') : array(); $processors = self::getPaymentProcessors($capabilities, array($paymentProcessorID)); - $processor = $processors[$paymentProcessorID]; - $fields = array( - 'id', - 'name', - 'payment_processor_type_id', - 'user_name', - 'password', - 'signature', - 'url_site', - 'url_api', - 'url_recur', - 'url_button', - 'subject', - 'class_name', - 'is_recur', - 'billing_mode', - 'is_test', - 'payment_type', - 'is_default', - ); - // Just to prevent e-Notices elsewhere we set all fields. - foreach ($fields as $name) { - if (!isset($processor)) { - $processor[$name] = NULL; - } - } - $processor['payment_processor_type'] = CRM_Core_PseudoConstant::paymentProcessorType(FALSE, - $processor['payment_processor_type_id'], 'name'); return $processors[$paymentProcessorID]; } @@ -326,7 +298,25 @@ public static function getAllPaymentProcessors($mode = 'all', $reset = FALSE, $i $processors = civicrm_api3('payment_processor', 'get', $retrievalParameters); foreach ($processors['values'] as $processor) { - $fieldsToProvide = array('user_name', 'password', 'signature', 'subject', 'is_recur'); + $fieldsToProvide = array( + 'id', + 'name', + 'payment_processor_type_id', + 'user_name', + 'password', + 'signature', + 'url_site', + 'url_api', + 'url_recur', + 'url_button', + 'subject', + 'class_name', + 'is_recur', + 'billing_mode', + 'is_test', + 'payment_type', + 'is_default', + ); foreach ($fieldsToProvide as $field) { // Prevent e-notices in processor classes when not configured. if (!isset($processor[$field])) { @@ -548,7 +538,8 @@ public static function getProcessorForEntity($entityID, $component = 'contribute // The function looks to load the payment processor ID from the contribution page, which // can support multiple processors. } - $paymentProcessor['payment_processor_type'] = CRM_Core_PseudoConstant::paymentProcessorType(FALSE, $paymentProcessor['payment_processor_type_id'], 'name'); + + $paymentProcessor['payment_processor_type'] = CRM_Core_PseudoConstant::getName('CRM_Financial_BAO_PaymentProcessor', 'payment_processor_type_id', $paymentProcessor['payment_processor_type_id']); $result = Civi\Payment\System::singleton()->getByProcessor($paymentProcessor); } return $result; diff --git a/CRM/Utils/VersionCheck.php b/CRM/Utils/VersionCheck.php index 23d13e0ba7f3..2abd563bc2f6 100644 --- a/CRM/Utils/VersionCheck.php +++ b/CRM/Utils/VersionCheck.php @@ -179,11 +179,10 @@ private function getPayProcStats() { $dao->find(); $ppTypes = array(); - // Get title and id for all processor types - $ppTypeNames = CRM_Core_PseudoConstant::paymentProcessorType(); - + // Get title for all processor types + // FIXME: This should probably be getName, but it has always returned translated label so we stick with that for now as it would affect stats while ($dao->fetch()) { - $ppTypes[] = $ppTypeNames[$dao->payment_processor_type_id]; + $ppTypes[] = CRM_Core_PseudoConstant::getLabel('CRM_Financial_BAO_PaymentProcessor', 'payment_processor_type_id', $dao->payment_processor_type_id); } // add the .-separated list of the processor types $this->stats['PPTypes'] = implode(',', array_unique($ppTypes));