Ejemplo n.º 1
0
 public static function get_gateway($config_id)
 {
     $config = new Pronamic_WP_Pay_Config($config_id);
     $config = Pronamic_WP_Pay_ConfigProvider::get_config($config->gateway_id, $config_id);
     $gateway = Pronamic_WP_Pay_GatewayFactory::create($config);
     return $gateway;
 }
Ejemplo n.º 2
0
 public static function get_gateway($config_id)
 {
     $config = get_pronamic_pay_gateway_config($config_id);
     $gateway_id = $config->gateway_id;
     $config_providers = array('buckaroo' => 'Pronamic_WP_Pay_Buckaroo_ConfigFactory', 'icepay' => 'Pronamic_WP_Pay_Gateways_Icepay_ConfigFactory', 'ideal_advanced' => 'Pronamic_WP_Pay_Gateways_IDealAdvanced_ConfigFactory', 'ideal_advanced_v3' => 'Pronamic_WP_Pay_Gateways_IDealAdvancedV3_ConfigFactory', 'ideal_basic' => 'Pronamic_WP_Pay_Gateways_IDealBasic_ConfigFactory', 'mollie' => 'Pronamic_WP_Pay_Gateways_Mollie_ConfigFactory', 'mollie_ideal' => 'Pronamic_WP_Pay_Gateways_Mollie_IDeal_ConfigFactory', 'multisafepay_connect' => 'Pronamic_WP_Pay_Gateways_MultiSafepay_ConfigFactory', 'ogone_directlink' => 'Pronamic_WP_Pay_Gateways_Ogone_DirectLink_ConfigFactory', 'ogone_orderstandard' => 'Pronamic_WP_Pay_Gateways_Ogone_OrderStandard_ConfigFactory', 'ogone_orderstandard_easy' => 'Pronamic_WP_Pay_Gateways_Ogone_OrderStandardEasy_ConfigFactory', 'omnikassa' => 'Pronamic_WP_Pay_Gateways_OmniKassa_ConfigFactory', 'pay_nl' => 'Pronamic_WP_Pay_Gateways_PayNL_ConfigFactory', 'paydutch' => 'Pronamic_WP_Pay_Gateways_PayDutch_ConfigFactory', 'qantani' => 'Pronamic_WP_Pay_Gateways_Qantani_ConfigFactory', 'sisow' => 'Pronamic_WP_Pay_Gateways_Sisow_ConfigFactory', 'targetpay' => 'Pronamic_WP_Pay_Gateways_TargetPay_ConfigFactory');
     $config_providers = apply_filters('pronamic_pay_config_providers', $config_providers);
     foreach ($config_providers as $name => $class_name) {
         Pronamic_WP_Pay_ConfigProvider::register($name, $class_name);
     }
     $config_gateways = array('Pronamic_WP_Pay_Buckaroo_Config' => 'Pronamic_WP_Pay_Buckaroo_Gateway', 'Pronamic_WP_Pay_Gateways_Icepay_Config' => 'Pronamic_WP_Pay_Gateways_Icepay_Gateway', 'Pronamic_WP_Pay_Gateways_IDealAdvanced_Config' => 'Pronamic_WP_Pay_Gateways_IDealAdvanced_Gateway', 'Pronamic_WP_Pay_Gateways_IDealAdvancedV3_Config' => 'Pronamic_WP_Pay_Gateways_IDealAdvancedV3_Gateway', 'Pronamic_WP_Pay_Gateways_IDealBasic_Config' => 'Pronamic_WP_Pay_Gateways_IDealBasic_Gateway', 'Pronamic_WP_Pay_Gateways_Ogone_DirectLink_Config' => 'Pronamic_WP_Pay_Gateways_Ogone_DirectLink_Gateway', 'Pronamic_WP_Pay_Gateways_Ogone_OrderStandard_Config' => 'Pronamic_WP_Pay_Gateways_Ogone_OrderStandard_Gateway', 'Pronamic_WP_Pay_Gateways_Ogone_OrderStandardEasy_Config' => 'Pronamic_WP_Pay_Gateways_Ogone_OrderStandardEasy_Gateway', 'Pronamic_WP_Pay_Gateways_Mollie_Config' => 'Pronamic_WP_Pay_Gateways_Mollie_Gateway', 'Pronamic_WP_Pay_Gateways_Mollie_IDeal_Config' => 'Pronamic_WP_Pay_Gateways_Mollie_IDeal_Gateway', 'Pronamic_WP_Pay_Gateways_MultiSafepay_Config' => 'Pronamic_WP_Pay_Gateways_MultiSafepay_Connect_Gateway', 'Pronamic_WP_Pay_Gateways_OmniKassa_Config' => 'Pronamic_WP_Pay_Gateways_OmniKassa_Gateway', 'Pronamic_WP_Pay_Gateways_PayDutch_Config' => 'Pronamic_WP_Pay_Gateways_PayDutch_Gateway', 'Pronamic_WP_Pay_Gateways_PayNL_Config' => 'Pronamic_WP_Pay_Gateways_PayNL_Gateway', 'Pronamic_WP_Pay_Gateways_Qantani_Config' => 'Pronamic_WP_Pay_Gateways_Qantani_Gateway', 'Pronamic_WP_Pay_Gateways_Sisow_Config' => 'Pronamic_WP_Pay_Gateways_Sisow_Gateway', 'Pronamic_WP_Pay_Gateways_TargetPay_Config' => 'Pronamic_WP_Pay_Gateways_TargetPay_Gateway');
     $config_gateways = apply_filters('pronamic_pay_config_gateways', $config_gateways);
     foreach ($config_gateways as $config_class => $gateway_class) {
         Pronamic_WP_Pay_GatewayFactory::register($config_class, $gateway_class);
     }
     global $pronamic_pay_gateways;
     if (isset($pronamic_pay_gateways[$gateway_id])) {
         $gateway = $pronamic_pay_gateways[$gateway_id];
         $gateway_slug = $gateway['gateway'];
         $config = Pronamic_WP_Pay_ConfigProvider::get_config($gateway_slug, $config_id);
         $gateway = Pronamic_WP_Pay_GatewayFactory::create($config);
         return $gateway;
     }
 }