Changeset 136 for trunk/lib/AuthorizeNet.inc.php
- Timestamp:
- Jun 3, 2006 7:47:48 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/AuthorizeNet.inc.php
r42 r136 1 1 <?php 2 /** 3 * AuthorizeNet.inc.php 4 * code by strangecode :: www.strangecode.com :: this document contains copyrighted information 5 * 6 * The AuthorizeNet class provides an abstract interface for communicating 7 * with authorize.net's AIM interface. Supports Auth.Net v3.1 8 * 9 * @author Quinn Comendant <quinn@strangecode.com> 10 * @version 1.0 11 * @date 2004-04-06 12 */ 13 2 14 // Example usage 3 15 // require_once 'codebase/lib/AuthorizeNet.inc.php'; … … 14 26 // 'x_Exp_Date' => '042008', 15 27 // 'x_Invoice_Num' => '100', 16 // 'x_Address' => '10 rue Levouv ',28 // 'x_Address' => '10 rue Levouvé', 17 29 // 'x_City' => 'SomeCity', 18 30 // 'x_State' => 'CA', … … 27 39 // } 28 40 29 /** 30 * The AuthorizeNet class provides an abstract interface for communicating 31 * with authorize.net's AIM interface. Supports Auth.Net v3.1 32 * 33 * @author Quinn Comendant <quinn@strangecode.com> 34 * @version 1.0 35 * @date 2004-04-06 36 */ 37 38 require_once dirname(__FILE__) . '/Utilities.inc.php'; 39 40 class AuthorizeNet 41 { 41 class AuthorizeNet { 42 42 43 var $post_url = ''; // The URL to post data to. 43 44 var $md5_hash_value = ','; // A custom value for the response delimination character. … … 132 133 function setParam($params) 133 134 { 135 $app =& App::getInstance(); 136 134 137 if (isset($params) && is_array($params)) { 135 138 // Merge new parameters with old overriding only those passed. 136 139 $this->_params = array_merge($this->_params, $params); 137 140 } else { 138 App::logMsg(sprintf('Parameters are not an array: %s', $params), LOG_ERR, __FILE__, __LINE__);141 $app->logMsg(sprintf('Parameters are not an array: %s', $params), LOG_ERR, __FILE__, __LINE__); 139 142 } 140 143 } … … 149 152 function getParam($param) 150 153 { 154 $app =& App::getInstance(); 155 151 156 if (isset($this->_params[$param])) { 152 157 return $this->_params[$param]; 153 158 } else { 154 App::logMsg(sprintf('Parameter is not set: %s', $param), LOG_DEBUG, __FILE__, __LINE__);159 $app->logMsg(sprintf('Parameter is not set: %s', $param), LOG_NOTICE, __FILE__, __LINE__); 155 160 return null; 156 161 } … … 167 172 function process() 168 173 { 174 $app =& App::getInstance(); 175 169 176 if (empty($this->_params['x_login'])) { 170 177 $this->_results['x_response_reason_text'] = _("Transaction gateway temporarily not available. Please try again later."); 171 App::logMsg(sprintf('x_login not specified.', null), LOG_ERROR, __FILE__, __LINE__);178 $app->logMsg(sprintf('x_login not specified.', null), LOG_ERROR, __FILE__, __LINE__); 172 179 return false; 173 180 } 174 181 if (empty($this->_params['x_card_num'])) { 175 182 $this->_results['x_response_reason_text'] = _("Transaction gateway temporarily not available. Please try again later."); 176 App::logMsg(sprintf('x_card_num not specified.', null), LOG_ERROR, __FILE__, __LINE__);183 $app->logMsg(sprintf('x_card_num not specified.', null), LOG_ERROR, __FILE__, __LINE__); 177 184 return false; 178 185 }
Note: See TracChangeset
for help on using the changeset viewer.