@@ -110,12 +110,14 @@ public function processSecure3d(Secure3dBuilder $builder)
110
110
111
111
$ hash = GenerationUtils::generateHash ($ this ->sharedSecret , implode ('. ' , [$ timestamp , $ this ->merchantId , $ hashValue ]));
112
112
$ headers ['Authorization ' ] = sprintf ('securehash %s ' , $ hash );
113
+ $ headers ["X-GP-Version " ] = "2.2.0 " ;
113
114
114
115
$ rawResponse = $ this ->doTransaction ('POST ' , 'protocol-versions ' , json_encode ($ request ), null , $ headers );
115
116
return $ this ->mapResponse ($ rawResponse );
116
117
} elseif ($ transType === TransactionType::VERIFY_SIGNATURE ) {
117
118
$ hash = GenerationUtils::generateHash ($ this ->sharedSecret , implode ('. ' , [$ timestamp , $ this ->merchantId , $ builder ->getServerTransactionId ()]));
118
119
$ headers ['Authorization ' ] = sprintf ('securehash %s ' , $ hash );
120
+ $ headers ["X-GP-Version " ] = "2.2.0 " ;
119
121
120
122
$ queryValues = [];
121
123
$ queryValues ['merchant_id ' ] = $ this ->merchantId ;
@@ -143,18 +145,22 @@ public function processSecure3d(Secure3dBuilder $builder)
143
145
$ request = $ this ->maybeSetKey ($ request , 'method_url_completion ' , $ builder ->getMethodUrlCompletion ());
144
146
$ request = $ this ->maybeSetKey ($ request , 'merchant_contact_url ' , $ this ->merchantContactUrl );
145
147
$ request = $ this ->maybeSetKey ($ request , 'merchant_initiated_request_type ' , $ builder ->getMerchantInitiatedRequestType ());
148
+ $ request = $ this ->maybeSetKey ($ request , 'whitelist_status ' , $ builder ->getWhitelistStatus ());
149
+ $ request = $ this ->maybeSetKey ($ request , 'decoupled_flow_request ' , $ builder ->getDecoupledFlowRequest ());
150
+ $ request = $ this ->maybeSetKey ($ request , 'decoupled_flow_timeout ' , $ builder ->getDecoupledFlowTimeout ());
151
+ $ request = $ this ->maybeSetKey ($ request , 'decoupled_notification_url ' , $ builder ->getDecoupledNotificationUrl ());
146
152
147
153
// card details
148
154
$ hashValue = '' ;
149
155
$ request ['card_detail ' ] = [];
150
156
if ($ paymentMethod instanceof CreditCardData) {
151
157
$ cardData = $ paymentMethod ;
152
158
$ hashValue = $ cardData ->number ;
153
-
159
+
154
160
$ request ['card_detail ' ] = $ this ->maybeSetKey ($ request ['card_detail ' ], 'number ' , $ cardData ->number );
155
161
$ request ['card_detail ' ] = $ this ->maybeSetKey ($ request ['card_detail ' ], 'scheme ' , strtoupper ($ cardData ->getCardType ()));
156
162
$ request ['card_detail ' ] = $ this ->maybeSetKey ($ request ['card_detail ' ], 'expiry_month ' , $ cardData ->expMonth );
157
- $ request ['card_detail ' ] = $ this ->maybeSetKey ($ request ['card_detail ' ], 'expiry_year ' ,
163
+ $ request ['card_detail ' ] = $ this ->maybeSetKey ($ request ['card_detail ' ], 'expiry_year ' ,
158
164
substr (str_pad ($ cardData ->expYear , 4 , '0 ' , STR_PAD_LEFT ), 2 , 2 ));
159
165
$ request ['card_detail ' ] = $ this ->maybeSetKey ($ request ['card_detail ' ], 'full_name ' , $ cardData ->cardHolderName );
160
166
@@ -312,7 +318,7 @@ public function processSecure3d(Secure3dBuilder $builder)
312
318
$ request ['sdk_information ' ] = [];
313
319
$ request ['sdk_information ' ] = $ this ->maybeSetKey ($ request ['sdk_information ' ], 'application_id ' , $ builder ->getApplicationId ());
314
320
$ request ['sdk_information ' ] = $ this ->maybeSetKey ($ request ['sdk_information ' ], 'ephemeral_public_key ' , $ builder ->getEphemeralPublicKey ());
315
- $ request ['sdk_information ' ] = $ this ->maybeSetKey ($ request ['sdk_information ' ], 'maximum_timeout ' ,
321
+ $ request ['sdk_information ' ] = $ this ->maybeSetKey ($ request ['sdk_information ' ], 'maximum_timeout ' ,
316
322
(!empty ($ builder ->getMaximumTimeout ())) ? str_pad ($ builder ->getMaximumTimeout (), 2 , '0 ' , STR_PAD_LEFT ) : '' );
317
323
$ request ['sdk_information ' ] = $ this ->maybeSetKey ($ request ['sdk_information ' ], 'reference_number ' , $ builder ->getReferenceNumber ());
318
324
$ request ['sdk_information ' ] = $ this ->maybeSetKey ($ request ['sdk_information ' ], 'sdk_trans_id ' , $ builder ->getSdkTransactionId ());
@@ -328,6 +334,7 @@ public function processSecure3d(Secure3dBuilder $builder)
328
334
329
335
$ hash = GenerationUtils::generateHash ($ this ->sharedSecret , implode ('. ' , [$ timestamp , $ this ->merchantId , $ hashValue , $ secureEcom ->serverTransactionId ]));
330
336
$ headers ['Authorization ' ] = sprintf ('securehash %s ' , $ hash );
337
+ $ headers ["X-GP-Version " ] = "2.2.0 " ;
331
338
$ rawResponse = $ this ->doTransaction ('POST ' , 'authentications ' , json_encode ($ request , JSON_UNESCAPED_SLASHES ), null , $ headers );
332
339
return $ this ->mapResponse ($ rawResponse );
333
340
}
@@ -360,6 +367,10 @@ private function mapResponse($rawResponse)
360
367
$ secureEcom ->authenticationSource = isset ($ doc ['authentication_source ' ]) ? $ doc ['authentication_source ' ] : null ;
361
368
$ secureEcom ->messageCategory = isset ($ doc ['message_category ' ]) ? $ doc ['message_category ' ] : null ;
362
369
$ secureEcom ->messageVersion = isset ($ doc ['message_version ' ]) ? $ doc ['message_version ' ] : null ;
370
+ $ secureEcom ->acsInfoIndicator = isset ($ doc ['acs_info_indicator ' ]) ? $ doc ['acs_info_indicator ' ] : null ;
371
+ $ secureEcom ->decoupledResponseIndicator = isset ($ doc ['decoupled_response_indicator ' ]) ?
372
+ $ doc ['decoupled_response_indicator ' ] : null ;
373
+ $ secureEcom ->whitelistStatus = isset ($ doc ['whitelist_status ' ]) ? $ doc ['whitelist_status ' ] : null ;
363
374
364
375
// challenge mandated
365
376
if (array_key_exists ('challenge_mandated ' , $ doc )) {
@@ -382,6 +393,8 @@ private function mapResponse($rawResponse)
382
393
$ secureEcom ->criticalityIndicator =
383
394
isset ($ doc ['message_extension ' ]['criticality_indicator ' ]) ?
384
395
$ doc ['message_extension ' ]['criticality_indicator ' ] : null ;
396
+ $ secureEcom ->messageExtensionData = isset ($ doc ['message_extension ' ]['data ' ]) ?
397
+ $ doc ['message_extension ' ]['data ' ] : null ;
385
398
$ secureEcom ->messageExtensionId =
386
399
isset ($ doc ['message_extension ' ]['id ' ]) ? $ doc ['message_extension ' ]['id ' ] : null ;
387
400
$ secureEcom ->messageExtensionName =
0 commit comments