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];
}
$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])) {
// 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;
$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));