Changeset 6997
- Timestamp:
- 01/09/08 04:45:19 (11 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/sfAuthorizeNetPlugin/lib/sfAuthorizeNet.class.php
r2641 r6997 22 22 */ 23 23 private $authorize_password; 24 25 /** 26 * Method to use to authenticate with Authorize.net gatway. Default is password. Recommended to be set to x_tran_key 27 * 28 * @var string 29 */ 30 private $authentication_method = "x_password"; 24 31 25 32 /** … … 88 95 * - url - The absolute URL to the Authorize.net gateway 89 96 * - test - Boolean value, enable or disable test mode 90 * @param string $username - Authorize.net gateway username 91 * @param string $password (optional) - Authorize.net gateway password 97 * - authentication_method - String of either x_password or x_tran_key 98 * @param string $username - Authorize.net gateway username or API login id 99 * @param string $password (optional) - Authorize.net gateway password or API transaction key depending on $authorize_authentication_method 92 100 * @param array $options (optional) 93 101 */ … … 103 111 if (isset($options['url'])) $this->setAuthorizeUrl($options['url']); 104 112 if (isset($options['test'])) $this->setAuthorizeTestMode($options['test']); 113 if (isset($options['authentication_method'])) $this->setAuthenticationMethod($options['authentication_method']); 105 114 } 106 115 … … 154 163 { 155 164 $this->authorize_hash = $hash; 165 } 166 167 /** 168 * Sets the authentication method for the authorize.net gateway 169 * 170 * @param string $authentication_method Should be either x_password or x_tran_key 171 */ 172 public function setAuthenticationMethod($authentication_method) 173 { 174 $this->authentication_method = $authentication_method; 175 } 176 177 /** 178 * Returns the Authentication method for authorize.net gateway 179 * 180 * @return string 181 */ 182 public function getAuthenticationMethod() 183 { 184 return $this->authentication_method; 156 185 } 157 186 … … 865 894 $this->addQueryParameter('x_delim_data', 'TRUE'); 866 895 $this->addQueryParameter('x_login', $this->getAuthorizeUsername()); 867 $this->addQueryParameter( 'x_password', $this->getAuthorizePassword());896 $this->addQueryParameter($this->getAuthenticationMethod(), $this->getAuthorizePassword()); 868 897 $this->addQueryParameter('x_version', $this->getAuthorizeVersion()); 869 898 $this->addQueryParameter('x_type', $this->getAuthorizeType()); … … 1004 1033 curl_setopt($ch, CURLOPT_POSTFIELDS, $query_string); 1005 1034 curl_setopt($ch, CURLOPT_REFERER, ""); 1035 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, true); 1036 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 1006 1037 $response = curl_exec($ch); 1007 1038 curl_close($ch);