'Response object is wrong', self::ERROR => 'Authorize.net return error: %s' ); public static function getInstance($options, $api = null) { if (empty($api)) { $api = self::DEFAULT_API_PROVIDER; } self::_setOptions($options); $class = 'AuthorizeNet' . strtoupper($api); $filePath = BASE_PATH . '/' . 'lib/AuthorizeNet/' . $class . '.php'; if (!file_exists($filePath)) { throw new Qs_Exception("Cannot open file: $filePath"); } require_once $filePath; return new $class(); } protected static function _setOptions(array $options) { foreach (self::$_optionsMap as $option) { if (!array_key_exists($option, $options)) { throw new Qs_Exception('Set authorize option ' . $option . ' (_lib/app-config/checkout.php).'); } define(self::AUTHORIZE_OPTION_NAME_PREFIX . $option, $options[$option]); } } }