'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); if (!class_exists($class)) { throw new Qs_Exception("Cannot find class: $class"); } 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]); } } }