Skip to content

Commit

Permalink
Merge pull request #174 from mewebstudio/173-posnet-undefined-array-m…
Browse files Browse the repository at this point in the history
…erchantdataresponsekey-oosresolve

fix issue #173
  • Loading branch information
nuryagdym authored Jan 19, 2024
2 parents 5ff8f20 + ac06aa3 commit af54536
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,15 @@ public function map3DPaymentData(array $raw3DAuthResponseData, ?array $rawPaymen
$status = self::TX_APPROVED;
}

if (!isset($raw3DAuthResponseData['oosResolveMerchantDataResponse'])) {
$defaultResponse = $this->getDefaultPaymentResponse();
$defaultResponse['proc_return_code'] = $procReturnCode;
$defaultResponse['error_code'] = $raw3DAuthResponseData['respCode'];
$defaultResponse['error_message'] = $raw3DAuthResponseData['respText'];

return $defaultResponse;
}

/** @var array<string, string|null> $oosResolveMerchantDataResponse */
$oosResolveMerchantDataResponse = $raw3DAuthResponseData['oosResolveMerchantDataResponse'];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,25 @@ public function threeDPaymentDataProvider(): array
'status_detail' => null,
],
],
'fail_no_oosResolveMerchantDataResponse' => [
'threeDResponseData' => [
'approved' => '0',
'respCode' => 'E216',
'respText' => 'Mac Do\u011frulama hatal\u0131',
],
'paymentData' => [],
'expectedData' => [
'order_id' => null,
'trans_id' => null,
'auth_code' => null,
'ref_ret_num' => null,
'proc_return_code' => '0',
'status' => 'declined',
'status_detail' => null,
'error_code' => 'E216',
'error_message' => 'Mac Do\u011frulama hatal\u0131',
],
],
];
}

Expand Down

0 comments on commit af54536

Please sign in to comment.