private function PaymentTypes()
    {
        $factory = Omnipay::getFactory();
        // since the omnipay gateway factory only returns gateways from the composer.json extra data,
        // we should merge it with user-defined gateways from Payment.allowed_gateways
        $gateways = array_unique(array_merge(
            $factory->all(),
            array_keys(GatewayInfo::getSupportedGateways(false))
        ));

        $supportedGateways = array();

        array_walk($gateways, function ($name, $index) use (&$supportedGateways, &$factory) {
            try {
                $instance = $factory->create($name);
                $supportedGateways[$name] = $instance;
            } catch (\Exception $e) {
            }
        });

        return $supportedGateways;
    }
private function PaymentTypes()
    {
        $factory = Omnipay::getFactory();
        // since the omnipay gateway factory only returns gateways from the composer.json extra data,
        // we should merge it with user-defined gateways from Payment.allowed_gateways
        $gateways = array_unique(array_merge(
            $factory->all(),
            array_keys(GatewayInfo::getSupportedGateways(false))
        ));

        $supportedGateways = array();

        array_walk($gateways, function ($name, $index) use (&$supportedGateways, &$factory) {
            try {
                $instance = $factory->create($name);
                $supportedGateways[$name] = $instance;
            } catch (\Exception $e) {
            }
        });

        return $supportedGateways;
    }
private function PaymentTypes ( ) { $ factory = Omnipay :: getFactory ( ) ; // since the omnipay gateway factory only returns gateways from the composer.json extra data, // we should merge it with user-defined gateways from Payment.allowed_gateways $ gateways = array_unique ( array_merge ( $ factory -> all ( ) , array_keys ( GatewayInfo :: getSupportedGateways ( false ) ) ) ) ; $ supportedGateways = array ( ) ; array_walk ( $ gateways , function ( $ name , $ index ) use ( & $ supportedGateways , & $ factory ) { try { $ instance = $ factory -> create ( $ name ) ; $ supportedGateways [ $ name ] = $ instance ; } catch ( \ Exception $ e ) { } } ) ; return $ supportedGateways ; }
Get all available payment types
Get all available payment types