function _payment_gateway_list in Ubercart 5
Same name and namespace in other branches
- 6.2 payment/uc_payment/uc_payment.module \_payment_gateway_list()
Build a list of payment gateways defined in the enabled modules.
7 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.module - uc_payment_gateway_select in payment/
uc_payment/ uc_payment.module - Select a payment gateway to process a payment when multiple gateways exist for a given payment method.
- uc_payment_methods_form in payment/
uc_payment/ uc_payment.module - uc_payment_process in payment/
uc_payment/ uc_payment.module - Process a payment through an enabled payment gateway.
File
- payment/
uc_payment/ uc_payment.module, line 1101
Code
function _payment_gateway_list($filter = NULL, $enabled_only = FALSE) {
$gateways = module_invoke_all('payment_gateway');
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]);
}
}
if ($enabled_only) {
if (!variable_get('uc_pg_' . $gateways[$i]['id'] . '_enabled', TRUE)) {
unset($gateways[$i]);
}
}
}
return $gateways;
}