/** * Displays notices if a gateway is disabled * @return void */ function disabled_gateway_warning() { if (isset($_GET['tab'])) { $gateway_id = $_GET['tab']; if (APP_Gateway_Registry::is_gateway_registered($gateway_id) && !APP_Gateway_Registry::is_gateway_enabled($gateway_id)) { $this->admin_msg(__('This gateway is currently <strong>disabled</strong>. Users cannot use it as a purchasing option. Go to the <a href="?page=app-payments-settings">General</a> tab to enable it.', APP_TD)); } } }
public function test_register() { APP_Gateway_Registry::register_gateway('APP_Mock_Gateway'); $this->assertTrue(APP_Gateway_Registry::is_gateway_registered('mock-gateway')); $gateway = APP_Gateway_Registry::get_gateway('mock-gateway'); $this->assertEquals('mock-gateway', $gateway->identifier()); $this->assertFalse(APP_Gateway_Registry::is_gateway_enabled('mock-gateway')); return $gateway; }
/** * Displays notices if a gateway is disabled. */ function disabled_gateway_warning() { if (isset($_GET['tab'])) { $gateway_id = $_GET['tab']; $gateway = APP_Gateway_Registry::get_gateway($gateway_id); if (APP_Gateway_Registry::is_gateway_registered($gateway_id) && $gateway->supports('escrow') && !APP_Gateway_Registry::is_gateway_enabled($gateway_id, 'escrow')) { $this->admin_msg(__('This gateway is currently <strong>disabled</strong>. It cannot be used on escrow transactions. Go to the <a href="?page=app-payments-settings&tab=escrow">Escrow</a> tab to enable it.', APP_TD)); } } }