/** * Constructor * Sets gateway-specific variables and calls the parent constructor */ function __construct() { global $_PP_CONF; // These are used by the parent constructor, set them first $this->gw_name = 'amazon'; $this->gw_desc = 'Amazon SimplePay'; // Set default values for the config items, just to be sure that // something is set here. $this->config = array('prod_access_key' => '', 'prod_secret_key' => '', 'test_access_key' => '', 'test_secret_key' => '', 'prod_url' => 'https://authorize.payments.amazon.com', 'sandbox_url' => 'https://authorize.payments-sandbox.amazon.com', 'test_mode' => 1); // The parent constructor reads our config items from the database to // override defaults parent::__construct(); // If the configured currency is not one of the supported ones, // this gateway cannot be used so disable it. if ($this->currency_code != 'USD') { $this->enabled = 0; } // The parent constructor sets all possible services. Remove services // not supported by this gateway unset($this->services['subscribe']); // parent constructor loads the config array, here we select which // keys to use based on test_mode if ($this->config['test_mode'] == '1') { $this->access_key = $this->config['test_access_key']; $this->secret_key = $this->config['test_secret_key']; $this->gw_url = $this->config['sandbox_url']; } else { $this->access_key = $this->config['prod_access_key']; $this->secret_key = $this->config['prod_secret_key']; $this->gw_url = $this->config['prod_url']; } $this->get_shipping = 0; }
/** * Constructor. * Set gateway-specific items and call the parent constructor. */ function __construct() { global $_PP_CONF, $_USER; $supported_currency = array('USD', 'AUD', 'CAD', 'EUR', 'GBP', 'JPY', 'NZD', 'CHF', 'HKD', 'SGD', 'SEK', 'DKK', 'PLN', 'NOK', 'HUF', 'CZK', 'ILS', 'MXN', 'PHP', 'TWD', 'THB'); // These are used by the parent constructor, set them first. $this->gw_name = 'paypal'; $this->gw_desc = 'PayPal Web Payments Standard'; // Set default values for the config items, just to be sure that // something is set here. $this->config = array('bus_prod_email' => '', 'micro_prod_email' => '', 'bus_test_email' => '', 'micro_test_email' => '', 'test_mode' => 1, 'micro_threshold' => '', 'encrypt' => 0, 'pp_cert' => '', 'pp_cert_id' => '', 'micro_cert_id' => '', 'sandbox_main_cert' => '', 'sandbox_micro_cert' => '', 'prv_key' => '', 'pub_key' => '', 'prod_url' => 'https://www.paypal.com', 'sandbox_url' => 'https://www.sandbox.paypal.com'); // Call the parent constructor to initialize the common variables. parent::__construct(); // Set the gateway URL depending on whether we're in test mode or not if ($this->config['test_mode'] == 1) { $this->gw_url = $this->config['sandbox_url']; $this->postback_url = 'https://ipnpb.sandbox.paypal.com'; } else { $this->gw_url = $this->config['prod_url']; $this->postback_url = 'https://ipnpb.paypal.com'; } // If the configured currency is not one of the supported ones, // this gateway cannot be used, so disable it. if (!in_array($this->currency_code, $supported_currency)) { $this->enabled = 0; } // Set defaults, just to make sure something is set $this->cert_id = $this->config['pp_cert_id']; $this->receiver_email = $this->config['bus_prod_email']; }
/** * Constructor * Sets gateway-specific variables and calls the parent constructor */ function __construct() { global $_PP_CONF; // These are used by the parent constructor, set them first $this->gw_name = 'authorizenetsim'; $this->gw_desc = 'Autnorize.Net SIM'; // Set default values for the config items, just to be sure that // something is set here. $this->config = array('prod_api_login' => '', 'prod_trans_key' => '', 'test_api_login' => '', 'test_trans_key' => '', 'prod_url' => 'https://secure.authorize.net', 'sandbox_url' => 'https://test.authorize.net', 'prod_md5_hash' => '', 'test_md5_hash' => '', 'test_mode' => 1); // The parent constructor reads our config items from the database to // override defaults parent::__construct(); // The parent constructor sets all possible services. Remove services // not supported by this gateway unset($this->services['subscribe']); $this->LoadLanguage(); // parent constructor loads the config array, here we select which // keys to use based on test_mode if ($this->config['test_mode'] == '1') { $this->api_login = $this->config['test_api_login']; $this->trans_key = $this->config['test_trans_key']; $this->gw_url = $this->config['sandbox_url']; $this->hash_key = $this->config['test_hash_key']; } else { $this->api_login = $this->config['prod_api_login']; $this->trans_key = $this->config['prod_trans_key']; $this->gw_url = $this->config['prod_url']; $this->hash_key = $this->config['prod_hash_key']; } $this->get_shipping = 0; }