Changeset 1978
- Timestamp:
- 02/06/2008 09:40:02 PM (10 months ago)
- Files:
-
- 1 modified
-
trunk/system/libraries/drivers/Payment/Paypal.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/libraries/drivers/Payment/Paypal.php
r1938 r1978 35 35 'API_Signature' => '', 36 36 'API_Endpoint' => 'https://api-3t.paypal.com/nvp', 37 'version' => '3. 0',37 'version' => '3.2', 38 38 'Amt' => 0, 39 39 'PAYMENTACTION' => 'Sale', … … 59 59 $this->paypal_values['ReturnUrl'] = $config['ReturnUrl']; 60 60 $this->paypal_values['CANCELURL'] = $config['CANCELURL']; 61 $this->paypal_values['error_url'] = $config['CANCELURL']; 61 62 $this->paypal_values['CURRENCYCODE'] = $config['CURRENCYCODE']; 62 63 $this->paypal_values['API_Endpoint'] = ($config['test_mode']) ? 'https://api.sandbox.paypal.com/nvp' : 'https://api-3t.paypal.com/nvp'; … … 158 159 protected function paypal_login() 159 160 { 160 $data = '&A mt='.$this->paypal_values['Amt'].161 '&PAYMENTACTION='.$this->paypal_values['PAYMENTACTION'].162 '&R eturnURL='.$this->paypal_values['ReturnUrl'].163 '&C ancelURL='.$this->paypal_values['CANCELURL'];161 $data = '&AMT='.urlencode($this->paypal_values['Amt']). 162 //'&PAYMENTACTION='.$this->paypal_values['PAYMENTACTION']. 163 '&RETURNURL='.urlencode($this->paypal_values['ReturnUrl']). 164 '&CANCELURL='.urlencode($this->paypal_values['CANCELURL']); 164 165 165 166 $reply = $this->contact_paypal('SetExpressCheckout', $data); … … 195 196 protected function contact_paypal($method, $data) 196 197 { 197 $final_data = 'METHOD='.urlencode($method). 198 $final_data = 'USER='.urlencode($this->paypal_values['API_UserName']). 199 '&PWD='.urlencode($this->paypal_values['API_Password']). 200 '&SIGNATURE='.urlencode($this->paypal_values['API_Signature']). 198 201 '&VERSION='.urlencode($this->paypal_values['version']). 199 '&PWD='.urlencode($this->paypal_values['API_Password']). 200 '&USER='.urlencode($this->paypal_values['API_UserName']). 201 'SIGNATURE='.urlencode($this->paypal_values['API_Signature']).$data; 202 '&METHOD='.urlencode($method).$data; 202 203 203 204 Log::add('debug', 'Connecting to '.$this->paypal_values['API_Endpoint']); … … 218 219 // Moving to error page to display curl errors 219 220 $this->session->set_flash(array('curl_error_no' => curl_errno($ch), 'curl_error_msg' => curl_error($ch))); 220 url::redirect($this-> error_url);221 url::redirect($this->paypal_values['error_url']); 221 222 } 222 223 else
