Changeset 2457199
- Timestamp:
- 01/15/2021 10:21:37 PM (5 years ago)
- Location:
- girocheckout/trunk
- Files:
-
- 3 added
- 15 edited
-
girocheckout.php (modified) (1 diff)
-
library/GiroCheckout_SDK.php (modified) (4 diffs)
-
library/GiroCheckout_SDK_Request.php (modified) (9 diffs)
-
library/GiroCheckout_SDK_Request_Cart.php (modified) (2 diffs)
-
library/GiroCheckout_SDK_Tools.php (modified) (1 diff)
-
library/GiroCheckout_Utility.php (modified) (1 diff)
-
library/api/GiroCheckout_SDK_AbstractApi.php (modified) (5 diffs)
-
library/api/creditcard/GiroCheckout_SDK_CreditCardFinalizeform.php (added)
-
library/api/creditcard/GiroCheckout_SDK_CreditCardInitform.php (added)
-
library/api/creditcard/GiroCheckout_SDK_CreditCardTransaction.php (modified) (1 diff)
-
library/api/directdebit/GiroCheckout_SDK_DirectDebitTransaction.php (modified) (3 diffs)
-
library/api/giropay/GiroCheckout_SDK_GiropayIDCheck.php (modified) (2 diffs)
-
library/api/paypage/GiroCheckout_SDK_PaypageDonationcert.php (added)
-
library/api/paypage/GiroCheckout_SDK_PaypageTransaction.php (modified) (4 diffs)
-
library/helper/GiroCheckout_SDK_ResponseCode_helper.php (modified) (4 diffs)
-
library/helper/GiroCheckout_SDK_TransactionType_helper.php (modified) (3 diffs)
-
payments/gc_creditcard.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
girocheckout/trunk/girocheckout.php
r2435416 r2457199 10 10 * Plugin Name: GiroCheckout 11 11 * Description: Plugin to integrate the GiroCheckout payment methods into WooCommerce. 12 * Version: 4.1. 112 * Version: 4.1.2 13 13 * Author: GiroSolution GmbH 14 14 * Author URI: http://www.girosolution.de -
girocheckout/trunk/library/GiroCheckout_SDK.php
r2346265 r2457199 7 7 * 8 8 * @package GiroCheckout 9 * @version $Revision: 274 $ / $Date: 2019-09-06 14:04:44 -0400 (Fri, 06 Sep 2019) $9 * @version $Revision: 321 $ / $Date: 2020-12-11 14:09:33 -0300 (Fri, 11 Dec 2020) $ 10 10 */ 11 define('__GIROCHECKOUT_SDK_VERSION__', '2. 1.28');11 define('__GIROCHECKOUT_SDK_VERSION__', '2.3.1.4'); 12 12 13 13 if( version_compare( phpversion(), '5.3.0', '<' ) ) { … … 25 25 class GiroCheckout_SDK_Autoloader { 26 26 public static function load($classname) { 27 if( strpos($classname, 'GiroCheckout_SDK') === FALSE ) { 28 // move to next autoloader if prefix does not belong to plugin 29 return true; 30 } 31 27 32 $filename = $classname . '.php'; 28 33 $pathsArray = array ('api', … … 47 52 if($path == './') { 48 53 $pathToFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . $filename; 49 } else { 54 } 55 else { 50 56 $pathToFile = dirname(__FILE__) . DIRECTORY_SEPARATOR . $path . DIRECTORY_SEPARATOR . $filename; 51 57 } … … 54 60 require_once $pathToFile; 55 61 return true; 56 } else { 62 } 63 else { 57 64 continue; 58 65 } -
girocheckout/trunk/library/GiroCheckout_SDK_Request.php
r2346265 r2457199 10 10 * 11 11 * @package GiroCheckout 12 * @version $Revision: 274 $ / $Date: 2019-09-06 14:04:44 -0400 (Fri, 06 Sep 2019) $12 * @version $Revision: 320 $ / $Date: 2020-11-24 12:58:51 -0300 (Tue, 24 Nov 2020) $ 13 13 */ 14 14 class GiroCheckout_SDK_Request … … 34 34 private $secret = ''; 35 35 36 /* 37 * stores the api call request method object 36 /** 37 * Stores the api call request method object 38 * @var GiroCheckout_SDK_AbstractApi $requestMethod 38 39 */ 39 40 private $requestMethod; … … 43 44 * instantiates request 44 45 * 45 * a request method instance has to be passed (see examples section) 46 * 47 * @param InterfaceApi /String $apiCallMethod 46 * A request method instance has to be passed (see examples section) 47 * 48 * @param GiroCheckout_SDK_AbstractApi/String $apiCallMethod 49 * @param integer $iUseServer Server to use, 0=default, 1=Prod, 2=Dev, 3=custom URL for local use (specified in 2nd parameter) 50 * @param string $strCustServer Optional custom server to use, mostly for local testing (only if $p_iServer is 3). 48 51 * @throws GiroCheckout_SDK_Exception_helper 49 52 */ 50 function __construct($apiCallMethod) {53 public function __construct($apiCallMethod, $iUseServer = 0, $strCustServer = '') { 51 54 $Config = GiroCheckout_SDK_Config::getInstance(); 52 55 … … 72 75 throw new GiroCheckout_SDK_Exception_helper('Failure: API call method unknown'); 73 76 } 77 78 if( $iUseServer > 0 ) { 79 $this->requestMethod->setServer( $iUseServer, $strCustServer ); 80 } 74 81 } 75 82 … … 93 100 } 94 101 102 public function setTransactionType( $p_strTrxType ) { 103 $this->requestMethod = GiroCheckout_SDK_TransactionType_helper::getTransactionTypeByName($p_strTrxType); 104 } 105 95 106 /* 96 107 * Adds a key value pair to the params variable. Used to fill the request with data. … … 165 176 * Returns the raw response of the request. 166 177 * 167 * @return arrayResponse values178 * @return string Response values 168 179 */ 169 180 public function getResponseRaw() { … … 176 187 * @param String $secret 177 188 * @return String $this own instance 189 * @throws GiroCheckout_SDK_Exception_helper 178 190 */ 179 191 public function setSecret($secret) { … … 183 195 $this->secret = $secret; 184 196 return $this; 197 } 198 199 /** 200 * Set URL to post requests to dev.girosolution.de. 201 * This can be used when the method of changing the apache environment variable 202 * GIROCHECKOUT_SERVER isn't applicable. 203 * Call before submit. 204 * @param integer $p_iServer Server to use, 0=default, 1=Prod, 2=Dev, 3=custom URL for local use (specified in 2nd parameter) 205 * @param string $p_strCustServer Optional custom server to use, mostly for local testing (only if $p_iServer is 3). 206 */ 207 public function setServer( $p_iServer, $p_strCustServer = '' ) { 208 $this->requestMethod->setServer($p_iServer, $p_strCustServer); 185 209 } 186 210 … … 269 293 270 294 return TRUE; 295 } 296 297 /** 298 * Validates the passed API credentials against the host using the transaction type of the current object. 299 * 300 * @param string $p_strMerchantId Merchant ID to test 301 * @param string $p_strProjectId Project ID to test 302 * @param string $p_strProjectPass Project password to test 303 * @param string $p_strErrorDetails [OUT] Optionally pass variable here that is filled with the readon in case of return FALSE. 304 * @return bool TRUE on successful validation, FALSE on failed validation (=wrong credentials) 305 */ 306 public function testCredentials( $p_strMerchantId, $p_strProjectId, $p_strProjectPass, &$p_strErrorDetails = NULL ) { 307 if( !is_null($p_strErrorDetails) ) { 308 $p_strErrorDetails = ''; 309 } 310 311 $Config = GiroCheckout_SDK_Config::getInstance(); 312 313 try { 314 $this->setSecret($p_strProjectPass); 315 316 // Set some default parameters 317 $this->addParam('merchantId', $p_strMerchantId) 318 ->addParam('projectId', $p_strProjectId) 319 ->addParam('merchantTxId',123456330) 320 ->addParam('amount',-1) // provoke validation error 321 ->addParam('currency','EUR') 322 ->addParam('purpose','Credential validation') 323 ->addParam('urlRedirect','http://dummy') 324 ->addParam('urlNotify','http://dummy'); 325 326 if( $this->requestMethod->getPayMethod() == GiroCheckout_SDK_Config::FTG_SERVICES_PAYMENT_METHOD_PAYDIREKT ) { 327 $this->addParam( 'orderId', 12345 ); 328 } 329 330 if ($Config->getConfig('DEBUG_MODE')) { 331 GiroCheckout_SDK_Debug_helper::getInstance()->logParamsSet($this->params); 332 } 333 334 $submitParams = $this->requestMethod->getSubmitParams($this->params); 335 336 if ($this->requestMethod->needsHash()) { 337 $submitParams['hash'] = GiroCheckout_SDK_Hash_helper::getHMACMD5Hash($this->secret, $submitParams); 338 } 339 340 $submitParams['sourceId'] = $this->getHostSourceId() . ';' . $this->getSDKSourceId() . ';'; 341 342 if (isset($this->params['sourceId'])) { 343 $submitParams['sourceId'] .= $this->params['sourceId']; 344 } 345 else { 346 $submitParams['sourceId'] .= ';'; 347 } 348 349 // Send additional info fields for support reasons 350 if (isset($_SERVER['HTTP_USER_AGENT'])) { 351 $submitParams['userAgent'] = $_SERVER['HTTP_USER_AGENT']; 352 } 353 354 list($header, $body) = GiroCheckout_SDK_Curl_helper::submit($this->requestMethod->getRequestURL(), $submitParams); 355 $this->responseRaw = print_r($header, TRUE) . "\n$body"; 356 357 //error_log( "Response Raw: ". $this->responseRaw ); 358 359 $response = GiroCheckout_SDK_Curl_helper::getJSONResponseToArray($body); 360 361 if ($response['rc'] == 5000 || $response['rc'] == 5001) { 362 if( !is_null($p_strErrorDetails) ) { 363 $p_strErrorDetails = 'Authentication failure, please double-check your project settings, rc=' . $response['rc']; 364 } 365 return FALSE; 366 } 367 else { 368 return TRUE; 369 } 370 } 371 catch (Exception $e) { 372 if( !is_null($p_strErrorDetails) ) { 373 $p_strErrorDetails = 'Exception, Failure: ' . $e->getMessage(); 374 } 375 return FALSE; 376 } 271 377 } 272 378 -
girocheckout/trunk/library/GiroCheckout_SDK_Request_Cart.php
r2082698 r2457199 19 19 * @param integer $p_iGrossAmt Gross amount (value) of the item 20 20 * @param string $p_strEAN (optional) Item id number 21 * @throws GiroCheckout_SDK_Exception_helper 21 22 */ 22 23 public function addItem( $p_strName, $p_iQuantity, $p_iGrossAmt, $p_strEAN = "" ) { … … 49 50 } 50 51 else { 51 return json_encode($this->m_aItems, JSON_UNESCAPED_UNICODE );52 return json_encode($this->m_aItems, JSON_UNESCAPED_UNICODE | JSON_NUMERIC_CHECK); 52 53 } 53 54 } -
girocheckout/trunk/library/GiroCheckout_SDK_Tools.php
r1801157 r2457199 45 45 return $logoName; 46 46 } 47 48 /** 49 * Build filename for logo for the specified payment method. 50 * 51 * @param integer $p_iPaymentMethod Payment method ID (see constants in GiroCheckout_SDK_Config) 52 * @param integer $p_iSize Image size (height in pixels, may be 40, 50 or 60) 53 * @return string Filename of logo file, prepend its folder path before use. 54 */ 55 public static function getPaymentLogoFilename( $p_iPaymentMethod, $p_iSize ) { 56 if( !in_array( $p_iSize, array(40, 50, 60) ) ) { 57 return ""; 58 } 59 60 switch( $p_iPaymentMethod ) { 61 case GiroCheckout_SDK_Config::FTG_SERVICES_PAYMENT_METHOD_GIROPAY: 62 case GiroCheckout_SDK_Config::FTG_SERVICES_PAYMENT_METHOD_GIROPAY_AVS_PAYMENT: 63 case GiroCheckout_SDK_Config::FTG_SERVICES_PAYMENT_METHOD_GIROPAY_AVS: 64 case GiroCheckout_SDK_Config::FTG_SERVICES_PAYMENT_METHOD_GIROPAY_KVS: 65 case GiroCheckout_SDK_Config::FTG_SERVICES_PAYMENT_METHOD_GIROPAY_INVOICE: 66 case GiroCheckout_SDK_Config::FTG_SERVICES_PAYMENT_METHOD_GIROPAY_DONATE: 67 return "Logo_giropay_{$p_iSize}_px.jpg"; 68 69 case GiroCheckout_SDK_Config::FTG_SERVICES_PAYMENT_METHOD_EPS: 70 return "Logo_eps_{$p_iSize}_px.jpg"; 71 72 case GiroCheckout_SDK_Config::FTG_SERVICES_PAYMENT_METHOD_GIRODIRECTDEBIT: 73 case GiroCheckout_SDK_Config::FTG_SERVICES_PAYMENT_METHOD_GIRODIRECTDEBIT_CHECKED: 74 case GiroCheckout_SDK_Config::FTG_SERVICES_PAYMENT_METHOD_GIRODIRECTDEBIT_GUARANTEE: 75 return "Logo_EC_{$p_iSize}_px.png"; 76 77 case GiroCheckout_SDK_Config::FTG_SERVICES_PAYMENT_METHOD_GIROCREDITCARD: 78 return "visa_msc_amex_{$p_iSize}px.png"; // Usually better obtained through GiroCheckout_SDK_Tools::getCreditCardLogoName() 79 80 case GiroCheckout_SDK_Config::FTG_SERVICES_PAYMENT_METHOD_IDEAL: 81 return "Logo_iDeal_{$p_iSize}_px.jpg"; 82 case GiroCheckout_SDK_Config::FTG_SERVICES_PAYMENT_METHOD_PAYPAL: 83 return "Logo_paypal_{$p_iSize}_px.png"; 84 case GiroCheckout_SDK_Config::FTG_SERVICES_PAYMENT_METHOD_PAYDIREKT: 85 return "Logo_paydirekt_{$p_iSize}_px.jpg"; 86 case GiroCheckout_SDK_Config::FTG_SERVICES_PAYMENT_METHOD_BLUECODE: 87 return "Logo_bluecode_{$p_iSize}_px.png"; 88 case GiroCheckout_SDK_Config::FTG_SERVICES_PAYMENT_METHOD_SOFORTUW: 89 return "Logo_sofort_{$p_iSize}_px.png"; 90 case GiroCheckout_SDK_Config::FTG_SERVICES_PAYMENT_METHOD_MAESTRO: 91 return "Logo_maestro_{$p_iSize}_px.png"; 92 default: 93 return ""; 94 } 95 } 96 97 /** 98 * Validates the passed API credentials against the host. 99 * 100 * @param string $p_strTransactionType Type of transaction to test (is match project) 101 * @param string $p_strMerchantId Merchant ID to test 102 * @param string $p_strProjectId Project ID to test 103 * @param string $p_strProjectPassword Project password to test 104 * @param string $p_strErrorInfo [OUT] Optionally pass variable here that is filled with the readon in case of return FALSE. 105 * @return bool TRUE on successful validation, FALSE on failed validation (=wrong credentials) 106 */ 107 public static function testApiCredentials( $p_strTransactionType, $p_strMerchantId, $p_strProjectId, $p_strProjectPassword, &$p_strErrorInfo = NULL ) { 108 try { 109 $testRequest = new GiroCheckout_SDK_Request( $p_strTransactionType ); 110 } 111 catch( Exception $e ) { 112 if( !is_null($p_strErrorInfo) ) { 113 $p_strErrorInfo = "Exception on creating Request object, msg=" . $e->getMessage(); 114 } 115 return FALSE; 116 } 117 118 return $testRequest->testCredentials( $p_strMerchantId, $p_strProjectId, $p_strProjectPassword, $p_strErrorInfo ); 119 } 47 120 } -
girocheckout/trunk/library/GiroCheckout_Utility.php
r2435416 r2457199 19 19 */ 20 20 public static function getVersion() { 21 return '4.1. 1';21 return '4.1.2'; 22 22 } 23 23 -
girocheckout/trunk/library/api/GiroCheckout_SDK_AbstractApi.php
r2346265 r2457199 6 6 * 7 7 * @package GiroCheckout 8 * @version $Revision: 274 $ / $Date: 2019-09-06 14:04:44 -0400 (Fri, 06 Sep 2019) $8 * @version $Revision: 318 $ / $Date: 2020-11-18 19:18:48 -0300 (Wed, 18 Nov 2020) $ 9 9 */ 10 10 class GiroCheckout_SDK_AbstractApi implements GiroCheckout_SDK_InterfaceApi … … 15 15 16 16 /* 17 * for develop ent use only17 * for development use only 18 18 */ 19 19 function __construct() { … … 149 149 public function getRequestURL() { 150 150 return $this->requestURL; 151 } 152 153 /** 154 * Set URL to post requests to dev.girosolution.de. 155 * This can be used when the method of changing the apache environment variable 156 * GIROCHECKOUT_SERVER isn't applicable. 157 * Call before submit. 158 * @param integer $p_iServer Server to use, 0=default, 1=Prod, 2=Dev, 3=custom URL for local use (specified in 2nd parameter) 159 * @param string $p_strCustServer Optional custom server to use, mostly for local testing (only if $p_iServer is 3). 160 */ 161 public function setServer($p_iServer, $p_strCustServer = '') { 162 $url = parse_url($this->requestURL); 163 if ($p_iServer == 1) { 164 $strSrvUrl = "https://payment.girosolution.de/"; 165 } 166 elseif ($p_iServer == 3) { 167 $strSrvUrl = $p_strCustServer; 168 } 169 else { 170 $strSrvUrl = "https://dev.girosolution.de/"; 171 } 172 173 $this->requestURL = rtrim($strSrvUrl, "/") . $url['path']; 151 174 } 152 175 … … 260 283 261 284 case GiroCheckout_SDK_Config::FTG_SERVICES_PAYMENT_METHOD_IDEAL: 262 return "Logo_iDeal_{$p_iSize}_px.png"; 285 return "Logo_iDeal_{$p_iSize}_px.jpg"; 286 case GiroCheckout_SDK_Config::FTG_SERVICES_PAYMENT_METHOD_PAYPAL: 287 return "Logo_paypal_{$p_iSize}_px.png"; 263 288 case GiroCheckout_SDK_Config::FTG_SERVICES_PAYMENT_METHOD_PAYDIREKT: 264 289 return "Logo_paydirekt_{$p_iSize}_px.jpg"; … … 274 299 } 275 300 301 public function getPayMethod() { 302 return $this->m_iPayMethod; 303 } 276 304 } -
girocheckout/trunk/library/api/creditcard/GiroCheckout_SDK_CreditCardTransaction.php
r2346265 r2457199 16 16 */ 17 17 protected $paramFields = array( 18 'merchantId' => TRUE, 19 'projectId' => TRUE, 20 'merchantTxId' => TRUE, 21 'amount' => TRUE, 22 'currency' => TRUE, 23 'purpose' => TRUE, 24 'type' => FALSE, 25 'locale' => FALSE, 26 'mobile' => FALSE, 27 'pkn' => FALSE, 28 'recurring' => FALSE, 29 'indicator' => FALSE, 30 'urlRedirect' => TRUE, 31 'urlNotify' => TRUE, 32 'pptoken' => FALSE, 18 'merchantId' => TRUE, 19 'projectId' => TRUE, 20 'merchantTxId' => TRUE, 21 'amount' => TRUE, 22 'currency' => TRUE, 23 'purpose' => TRUE, 24 'type' => FALSE, 25 'locale' => FALSE, 26 'mobile' => FALSE, 27 'pkn' => FALSE, 28 'recurring' => FALSE, 29 'indicator' => FALSE, 30 'urlRedirect' => TRUE, 31 'urlNotify' => TRUE, 32 'tds2Address' => FALSE, 33 'tds2Postcode' => FALSE, 34 'tds2City' => FALSE, 35 'tds2Country' => FALSE, 36 'tds2Optional' => FALSE, 37 'pptoken' => FALSE, 33 38 ); 34 39 -
girocheckout/trunk/library/api/directdebit/GiroCheckout_SDK_DirectDebitTransaction.php
r2346265 r2457199 4 4 * 5 5 * @package GiroCheckout 6 * @version $Revision: 274 $ / $Date: 2019-09-06 14:04:44 -0400 (Fri, 06 Sep 2019) $6 * @version $Revision: 303 $ / $Date: 2020-04-02 14:13:33 -0300 (Thu, 02 Apr 2020) $ 7 7 */ 8 8 … … 33 33 'mandateSequence' => FALSE, 34 34 'pkn' => FALSE, 35 'urlRedirect' => FALSE, 35 36 'urlNotify' => FALSE, 36 37 'pptoken' => FALSE, … … 47 48 'backendTxId' => FALSE, 48 49 'mandateReference' => FALSE, 49 'resultPayment' => FALSE 50 'resultPayment' => FALSE, 51 'ppredirect' => FALSE 50 52 ); 51 53 -
girocheckout/trunk/library/api/giropay/GiroCheckout_SDK_GiropayIDCheck.php
r2346265 r2457199 4 4 * 5 5 * @package GiroCheckout 6 * @version $Revision: 274 $ / $Date: 2019-09-06 14:04:44 -0400 (Fri, 06 Sep 2019) $6 * @version $Revision: 315 $ / $Date: 2020-11-10 01:20:46 -0300 (Tue, 10 Nov 2020) $ 7 7 */ 8 8 … … 20 20 'projectId' => TRUE, 21 21 'merchantTxId' => TRUE, 22 'bic' => TRUE,22 'bic' => FALSE, 23 23 'iban' => FALSE, 24 24 'info1Label' => FALSE, -
girocheckout/trunk/library/api/paypage/GiroCheckout_SDK_PaypageTransaction.php
r2346265 r2457199 20 20 'projectId' => TRUE, 21 21 'merchantTxId' => TRUE, 22 'amount' => TRUE,22 'amount' => FALSE, 23 23 'currency' => TRUE, 24 24 'purpose' => TRUE, … … 27 27 'expirydate' => FALSE, 28 28 'single' => FALSE, 29 'timeout' => FALSE, 29 30 'type' => FALSE, 30 31 'locale' => 'de', … … 41 42 'test' => TRUE, 42 43 'certdata' => FALSE, 44 'otherpayments' => FALSE, 43 45 'paydirektShippingFirstName' => FALSE, 44 46 'paydirektShippingLastName' => FALSE, … … 50 52 'failUrl' => FALSE, 51 53 'notifyUrl' => FALSE, 54 'tds2Address' => FALSE, 55 'tds2Postcode' => FALSE, 56 'tds2City' => FALSE, 57 'tds2Country' => FALSE, 58 'tds2Optional' => FALSE, 52 59 ); 53 60 -
girocheckout/trunk/library/helper/GiroCheckout_SDK_ResponseCode_helper.php
r2346265 r2457199 5 5 * 6 6 * @package GiroCheckout 7 * @version $Revision: 265 $ / $Date: 2019-06-13 15:31:39 -0400 (Thu, 13 Jun 2019) $7 * @version $Revision: 321 $ / $Date: 2020-12-11 14:09:33 -0300 (Fri, 11 Dec 2020) $ 8 8 */ 9 9 class GiroCheckout_SDK_ResponseCode_helper { … … 117 117 5101 => 'Verbindungsproblem zum Zahlungsabwickler', 118 118 5102 => 'Pseudo-Kartennummer nicht vorhanden', 119 5103 => 'Ungültige giropay-MerchantId', 120 5104 => 'Ungültiger Paypage-Timeout', 121 5105 => 'TDS20: Ungültige Adresse', 122 5106 => 'TDS20: Ungültige PLZ', 123 5107 => 'TDS20: Ungültige Stadt', 124 5108 => 'TDS20: Ungültiges Land', 125 5109 => 'TDS20: Ungültige E-Mail', 126 5110 => 'TDS20: Optional-Feld ungültig', 127 5111 => 'TDS20: Geben Sie bitte mindestens alle Felder außer Optional an', 128 5112 => 'TDS20: Sie müssen zu Optional auch die anderen Felder angeben', 119 129 5200 => 'Transaktion nicht akzeptiert', 120 130 5201 => 'giropay Bank offline', … … 188 198 5024 => 'invalid bankcode', 189 199 5025 => 'invalid bankaccount', 190 5026 => 'invalid bic',191 5027 => 'invalid iban',200 5026 => 'invalid BIC', 201 5027 => 'invalid IBAN', 192 202 5028 => 'invalid mobile', 193 203 5029 => 'invalid pkn', … … 243 253 5101 => 'connection problem to payment processor', 244 254 5102 => 'pseudo-cardnumber does not exist', 255 5103 => 'invalid giropay merchantId', 256 5104 => 'invalid paypage timeout', 257 5105 => 'TDS20: Invalid address', 258 5106 => 'TDS20: Invalid post code', 259 5107 => 'TDS20: Invalid city', 260 5108 => 'TDS20: Invalid country', 261 5109 => 'TDS20: Invalid email', 262 5110 => 'TDS20: Invalid optional field', 263 5111 => 'TDS20: Please provide at least all fields except Optional', 264 5112 => 'TDS20: You must provide the other fields along with Optional', 245 265 5200 => 'not accepted transaction', 246 266 5201 => 'giropay bank offline', -
girocheckout/trunk/library/helper/GiroCheckout_SDK_TransactionType_helper.php
r2346265 r2457199 4 4 * 5 5 * @package GiroCheckout 6 * @version $Revision: 2 74 $ / $Date: 2019-09-06 14:04:44 -0400 (Fri, 06 Sep2019) $6 * @version $Revision: 281 $ / $Date: 2019-10-18 12:19:18 +0200 (Fri, 18 Oct 2019) $ 7 7 */ 8 8 class GiroCheckout_SDK_TransactionType_helper { … … 14 14 const TRANS_TYPE_CREDITCARD_RECURRING = "creditCardRecurringTransaction"; 15 15 const TRANS_TYPE_CREDITCARD_VOID = "creditCardVoid"; 16 const TRANS_TYPE_CREDITCARD_INITFORM = "creditCardInitform"; 17 const TRANS_TYPE_CREDITCARD_FINALIZEFORM = "creditCardFinalizeform"; 16 18 17 19 const TRANS_TYPE_DIRECTDEBIT_TRANSACTION = "directDebitTransaction"; … … 82 84 case self::TRANS_TYPE_CREDITCARD_VOID: 83 85 return new GiroCheckout_SDK_CreditCardVoid(); 86 case self::TRANS_TYPE_CREDITCARD_INITFORM: 87 return new GiroCheckout_SDK_CreditCardInitform(); 88 case self::TRANS_TYPE_CREDITCARD_FINALIZEFORM: 89 return new GiroCheckout_SDK_CreditCardFinalizeform(); 84 90 85 91 //direct debit apis -
girocheckout/trunk/payments/gc_creditcard.php
r2435416 r2457199 326 326 } 327 327 328 // Adding fields for 3-D Secure 2.0 329 $aTdsOptionalInfo = new stdClass(); 330 $tds2Address = ""; 331 $tds2Postcode = ""; 332 $tds2City = ""; 333 $tds2Country = ""; 334 $shipAddressAddress = ""; 335 $shipAddressPostcode = ""; 336 $shipAddressCity = ""; 337 $shipAddressCountry = ""; 338 339 if (method_exists($order, 'get_billing_address_1')) { 340 $tds2Address = $order->get_billing_address_1(); 341 } else { 342 $tds2Address = $order->billing_address_1; 343 } 344 345 if (method_exists($order, 'get_billing_postcode')) { 346 $tds2Postcode = $order->get_billing_postcode(); 347 } else { 348 $tds2Postcode = $order->billing_postcode; 349 } 350 351 if (method_exists($order, 'get_billing_city')) { 352 $tds2City = $order->get_billing_city(); 353 } else { 354 $tds2City = $order->billing_city; 355 } 356 357 if (method_exists($order, 'get_billing_country')) { 358 $tds2Country = $order->get_billing_country(); 359 } else { 360 $tds2Country = $order->billing_country; 361 } 362 363 if (method_exists($order, 'get_billing_email')) { 364 $strEmail = $order->get_billing_email(); 365 } else { 366 $strEmail = $order->billing_email; 367 } 368 369 if (method_exists($order, 'get_shipping_address_1')) { 370 $shipAddressAddress = $order->get_shipping_address_1(); 371 } else { 372 $shipAddressAddress = $order->shipping_address_1; 373 } 374 375 if (method_exists($order, 'get_shipping_postcode')) { 376 $shipAddressPostcode = $order->get_shipping_postcode(); 377 } else { 378 $shipAddressPostcode = $order->shipping_postcode; 379 } 380 381 if (method_exists($order, 'get_shipping_city')) { 382 $shipAddressCity = $order->get_shipping_city(); 383 } else { 384 $shipAddressCity = $order->shipping_city; 385 } 386 387 if (method_exists($order, 'get_shipping_country')) { 388 $shipAddressCountry = $order->get_shipping_country(); 389 } else { 390 $shipAddressCountry = $order->shipping_country; 391 } 392 393 $aTdsOptionalInfo->email = $strEmail; // Optional email address 394 395 if ($tds2Address != $shipAddressAddress || $tds2City != $shipAddressCity || 396 $tds2Postcode != $shipAddressPostcode || $tds2Country != $shipAddressCountry) { 397 $aTdsOptionalInfo->shippingAddress = new stdClass(); 398 $aTdsOptionalInfo->shippingAddress->country = $shipAddressCountry; 399 $aTdsOptionalInfo->shippingAddress->line1 = $shipAddressAddress; 400 $aTdsOptionalInfo->shippingAddress->city = $shipAddressCity; 401 $aTdsOptionalInfo->shippingAddress->postcode = $shipAddressPostcode; 402 } 403 404 // Shipping address matches billing address, array( "true", "false" ); 405 if ($tds2Address == $shipAddressAddress && $tds2City == $shipAddressCity && 406 $tds2Postcode == $shipAddressPostcode && $tds2Country == $shipAddressCountry) { 407 $aTdsOptionalInfo->addressesMatch = "true"; 408 } else { 409 $aTdsOptionalInfo->addressesMatch = "false"; 410 } 411 328 412 $request = new GiroCheckout_SDK_Request('creditCardTransaction'); 329 413 $request->setSecret($password); 330 414 $request->addParam('merchantId', $merchantId) 331 ->addParam('projectId', $projectId) 332 ->addParam('merchantTxId', $transaction_id) 333 ->addParam('amount', round($amount * 100)) 334 ->addParam('currency', $currency) 335 ->addParam('purpose', GiroCheckout_Utility::getPurpose($this->purpose, $order)) 336 ->addParam('locale', $this->lang) 337 ->addParam('urlRedirect', $urlRedirect) 338 ->addParam('urlNotify', $urlNotify) 339 ->addParam('sourceId', GiroCheckout_Utility::getGcSource()) 340 ->addParam('orderId', $transaction_id) 341 ->addParam('customerId', get_current_user_id()) 342 ->addParam('type', $strTransType) 343 ->submit(); 415 ->addParam('projectId', $projectId) 416 ->addParam('merchantTxId', $transaction_id) 417 ->addParam('amount', round($amount * 100)) 418 ->addParam('currency', $currency) 419 ->addParam('purpose', GiroCheckout_Utility::getPurpose($this->purpose, $order)) 420 ->addParam('locale', $this->lang) 421 ->addParam('urlRedirect', $urlRedirect) 422 ->addParam('urlNotify', $urlNotify) 423 ->addParam('sourceId', GiroCheckout_Utility::getGcSource()) 424 ->addParam('orderId', $transaction_id) 425 ->addParam('customerId', get_current_user_id()) 426 ->addParam('type', $strTransType); 427 428 if (!empty($tds2Address) && !empty($tds2Postcode) && !empty($tds2City) && !empty($tds2Country)) { 429 $request->addParam('tds2Address', $tds2Address) 430 ->addParam('tds2Postcode',$tds2Postcode) 431 ->addParam('tds2City',$tds2City) 432 ->addParam('tds2Country',$tds2Country); 433 } 434 435 $request->addParam('tds2Optional',json_encode($aTdsOptionalInfo)); 436 $request->submit(); 344 437 345 438 if ($request->requestHasSucceeded()) { -
girocheckout/trunk/readme.txt
r2435416 r2457199 54 54 55 55 == Changelog == 56 57 = 4.1.2 = 58 * Added support for the mandatory 3-D Secure 2.0 address fields. 56 59 57 60 = 4.1.1 =
Note: See TracChangeset
for help on using the changeset viewer.