You are here

function _payment_gateway_list in Ubercart 6.2

Same name and namespace in other branches
  1. 5 payment/uc_payment/uc_payment.module \_payment_gateway_list()

Builds a list of payment gateways defined in the enabled modules.

6 calls to _payment_gateway_list()
uc_credit_default_gateway in payment/uc_credit/uc_credit.module
Retrieves the ID of the default credit card gateway.
uc_payment_gateways_form in payment/uc_payment/uc_payment.admin.inc
Displays an overview of the available payment gateways.
uc_payment_gateway_select in payment/uc_payment/uc_payment.admin.inc
Selects a specific gateway when multiple gateways are available.
uc_payment_methods_form in payment/uc_payment/uc_payment.admin.inc
Displays an overview of the available payment methods.
uc_payment_process in payment/uc_payment/uc_payment.module
Processes a payment through an enabled payment gateway.

... See full list

File

payment/uc_payment/uc_payment.module, line 805

Code

function _payment_gateway_list($filter = NULL, $enabled_only = FALSE) {
  $gateways = module_invoke_all('payment_gateway');

  // Allow other modules to alter the payment gateways.
  drupal_alter('payment_gateway', $gateways);
  foreach ($gateways as $i => $value) {
    $gateways[$i]['enabled'] = variable_get('uc_pg_' . $gateways[$i]['id'] . '_enabled', TRUE);
    if ($filter != NULL) {
      if (!isset($gateways[$i][$filter]) || !function_exists($gateways[$i][$filter])) {
        unset($gateways[$i]);
        continue;
      }
    }
    if ($enabled_only) {
      if (!variable_get('uc_pg_' . $gateways[$i]['id'] . '_enabled', TRUE)) {
        unset($gateways[$i]);
      }
    }
  }
  return $gateways;
}