Changeset 468 for trunk/lib/AuthorizeNet.inc.php
- Timestamp:
- Feb 20, 2014 3:03:59 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property
svn:mergeinfo
set to
/branches/eli_branch merged eligible
-
Property
svn:mergeinfo
set to
-
trunk/lib/AuthorizeNet.inc.php
r396 r468 4 4 * For details visit the project site: <http://trac.strangecode.com/codebase/> 5 5 * Copyright 2001-2012 Strangecode, LLC 6 * 6 * 7 7 * This file is part of The Strangecode Codebase. 8 8 * … … 11 11 * Free Software Foundation, either version 3 of the License, or (at your option) 12 12 * any later version. 13 * 13 * 14 14 * The Strangecode Codebase is distributed in the hope that it will be useful, but 15 15 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 16 16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 17 17 * details. 18 * 18 * 19 19 * You should have received a copy of the GNU General Public License along with 20 20 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>. … … 31 31 * @date 2004-04-06 32 32 */ 33 33 34 34 // Example usage 35 35 // require_once 'codebase/lib/AuthorizeNet.inc.php'; … … 61 61 class AuthorizeNet { 62 62 63 var$post_url = ''; // The URL to post data to.64 var$_results = array();65 var$_params = array();66 var$_default_params = array(63 public $post_url = ''; // The URL to post data to. 64 private $_results = array(); 65 private $_params = array(); 66 private $_default_params = array( 67 67 'x_version' => '3.1', 68 68 'x_relay_response' => 'FALSE', … … 80 80 81 81 // Array of response names. Used in the results array. 82 var$_result_fields = Array(82 private $_result_fields = Array( 83 83 'x_response_code', 84 84 'x_response_subcode', … … 129 129 * @param optional array $_params A hash containing parameters. 130 130 */ 131 function AuthorizeNet($params = array())131 public function __construct($params = array()) 132 132 { 133 133 $app =& App::getInstance(); … … 143 143 $this->_params = $this->_default_params; 144 144 $this->setParam($params); 145 145 146 146 $this->setParam(array('md5_hash_salt' => $app->getParam('signing_key'))); 147 147 } … … 153 153 * @param array $params Array of parameters (key => val pairs). 154 154 */ 155 function setParam($params)155 public function setParam($params) 156 156 { 157 157 $app =& App::getInstance(); 158 158 159 159 if (isset($params) && is_array($params)) { 160 160 // Merge new parameters with old overriding only those passed. … … 172 172 * @return mixed Configured parameter value. 173 173 */ 174 function getParam($param)174 public function getParam($param) 175 175 { 176 176 $app =& App::getInstance(); 177 177 178 178 if (isset($this->_params[$param])) { 179 179 return $this->_params[$param]; … … 192 192 * @return mixed False or x_response_code: false = error, 1 = accepted, 2 = declined, 3 = error 193 193 */ 194 function process()194 public function process() 195 195 { 196 196 $app =& App::getInstance(); 197 197 198 198 if (empty($this->_params['x_login'])) { 199 199 $this->_results['x_response_reason_text'] = _("Transaction gateway temporarily not available. Please try again later."); … … 245 245 * @return array Returns the results array. 246 246 */ 247 function getResult($key=null)247 public function getResult($key=null) 248 248 { 249 249 if (isset($key)) { … … 265 265 * @return bool True if the hash is valid, false otherwise. 266 266 */ 267 function validMD5Hash()267 public function validMD5Hash() 268 268 { 269 269 return ( … … 282 282 * @access public 283 283 */ 284 function reset()284 public function reset() 285 285 { 286 286 $this->_results = Array(); … … 297 297 * @return integer Transaction result code. 298 298 */ 299 function _processResult($result)299 private function _processResult($result) 300 300 { 301 301 $this->_results = Array(); … … 315 315 } 316 316 } 317 ?>
Note: See TracChangeset
for help on using the changeset viewer.