static function get_fields($gateway_id = '') { $gateways = APP_Gateway_Registry::get_active_gateways('escrow'); $fields = array(); foreach ($gateways as $gateway) { if ($gateway_id && $gateway_id != $gateway->identifier()) { continue; } $section = $gateway->user_form(); $fields = array_merge($fields, $section['fields']); } return $fields; }
function appthemes_recurring_available($gateway_id = '') { if (!empty($gateway_id) && APP_Gateway_Registry::is_gateway_enabled($gateway_id)) { $gateways = array(APP_Gateway_Registry::get_gateway($gateway_id)); } else { $gateways = APP_Gateway_Registry::get_active_gateways(); } foreach ($gateways as $gateway) { if ($gateway->is_recurring()) { return true; } } return false; }
/** * Outputs the escrow settings form for active escrow gateways with all the fields required by each gateways. */ function appthemes_display_escrow_form() { foreach (APP_Gateway_Registry::get_active_gateways('escrow') as $gateway) { $fields[$gateway->identifier()] = $gateway->user_form(); } if (empty($fields)) { return; } new APP_Escrow_Settings_Form($fields); }
function appthemes_get_active_gateways() { return APP_Gateway_Registry::get_active_gateways(); }