Skip to content

Commit

Permalink
fix issue #207 - estpos undefined authcode index
Browse files Browse the repository at this point in the history
  • Loading branch information
nuryagdym committed May 17, 2024
1 parent 9be3781 commit 4defb5b
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function mapPaymentResponse(array $rawPaymentResponseData, string $txType
'group_id' => $rawPaymentResponseData['GroupId'],
'transaction_id' => $rawPaymentResponseData['TransId'],
'transaction_time' => self::TX_APPROVED === $status ? new \DateTimeImmutable($extra['TRXDATE']) : null,
'auth_code' => $rawPaymentResponseData['AuthCode'],
'auth_code' => $rawPaymentResponseData['AuthCode'] ?? null,
'ref_ret_num' => $rawPaymentResponseData['HostRefNum'],
'proc_return_code' => $procReturnCode,
'status' => $status,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ public static function paymentTestDataProvider(): iterable
public static function threeDPaymentDataProvider(): array
{
return [
'3d_auth_fail' => [
'3d_auth_fail' => [
'order' => [
'currency' => PosInterface::CURRENCY_TRY,
'amount' => 1.01,
Expand Down Expand Up @@ -497,7 +497,7 @@ public static function threeDPaymentDataProvider(): array
'installment_count' => 0,
],
],
'3d_auth_success_payment_fail' => [
'3d_auth_success_payment_fail' => [
'order' => [
'currency' => PosInterface::CURRENCY_TRY,
'amount' => 1.01,
Expand Down Expand Up @@ -591,7 +591,106 @@ public static function threeDPaymentDataProvider(): array
'payment_model' => '3d',
],
],
'success1' => [
'3d_auth_success_payment_fail_wong_cvv' => [
'order' => [
'currency' => PosInterface::CURRENCY_TRY,
'amount' => 1.01,
],
'txType' => PosInterface::TX_TYPE_PAY_AUTH,
'threeDResponseData' => [
'TRANID' => '',
'PAResSyntaxOK' => 'true',
'firmaadi' => 'John Doe',
'islemtipi' => 'Auth',
'lang' => 'tr',
'merchantID' => '190100000',
'maskedCreditCard' => '4355 08** **** 4358',
'amount' => '1.01',
'sID' => '1',
'ACQBIN' => '454672',
'Ecom_Payment_Card_ExpDate_Year' => '26',
'Email' => '[email protected]',
'MaskedPan' => '435508***4358',
'merchantName' => 'Ziraat 3D',
'clientIp' => '89.244.149.137',
'okUrl' => 'http://localhost/akbank/3d/response.php',
'md' => '435508:9716234382F9D9B630CC01452A6F160D31A2E1DBD41706C6AF8B8E6F730FE65D:3677:##190100000',
'taksit' => '12',
'Ecom_Payment_Card_ExpDate_Month' => '12',
'storetype' => '3d',
'mdErrorMsg' => 'Y-status/Challenge authentication via ACS: https://3ds-acs.test.modirum.com/mdpayacs/creq?token=214704701.1667119495.sIHzA7ckv-0',
'PAResVerified' => 'true',
'cavv' => 'ABABA##################AEJI=',
'digest' => 'digest',
'callbackCall' => 'true',
'failUrl' => 'http://localhost/akbank/3d/response.php',
'xid' => '2aeoSfQde3NyV2XjSeTL0sGNYSg=',
'encoding' => 'ISO-8859-9',
'currency' => '949',
'oid' => '20221030FE4C',
'mdStatus' => '1',
'dsId' => '1',
'eci' => '05',
'version' => '2.0',
'clientid' => '190100000',
'txstatus' => 'Y',
'HASH' => '+NYQKADaaWWUIAIg6U77nGIK+8k=',
'rnd' => 'IXa1XnlaOxpMCacqG/cB',
'HASHPARAMS' => 'clientid:oid:mdStatus:cavv:eci:md:rnd:',
'HASHPARAMSVAL' => '19010000020221030FE4C1ABABA##################AEJI=05435508:9716234382F9D9B630CC01452A6F160D31A2E1DBD41706C6AF8B8E6F730FE65D:3677:##190100000IXa1XnlaOxpMCacqG/cB',
],
'paymentData' => [
'OrderId' => '4c4',
'GroupId' => '4aa841c4',
'Response' => 'Declined',
'HostRefNum' => '4139489',
'ProcReturnCode' => '82',
'TransId' => '24138rt2596',
'ErrMsg' => 'CVV Hatasi veya girilen CVV gecersiz.',
'Extra' => [
'KULLANILANPUAN' => '000000000000',
'CARDBRAND' => 'VISA',
'CARDISSUER' => 'ZİRAAT BANKASI',
'ERRORCODE' => 'ISO8583-82',
'TRXDATE' => '20240517 13:17:31',
'KULLANILABILIRPUAN' => '000000000000',
'ACQSTAN' => '769489',
'KAZANILANPUAN' => '000000000105',
'TRACEID' => '2c4e0abd4560418ace038267fa57f5c9',
'NUMCODE' => '82',
],
],
'expectedData' => [
'transaction_id' => '24138rt2596',
'transaction_type' => 'pay',
'transaction_time' => null,
'transaction_security' => 'Full 3D Secure',
'md_status' => '1',
'masked_number' => '4355 08** **** 4358',
'month' => '12',
'year' => '26',
'amount' => 1.01,
'currency' => PosInterface::CURRENCY_TRY,
'eci' => '05',
'tx_status' => null,
'cavv' => 'ABABA##################AEJI=',
'md_error_message' => null,
'group_id' => '4aa841c4',
'auth_code' => null,
'ref_ret_num' => '4139489',
'batch_num' => null,
'proc_return_code' => '82',
'status' => 'declined',
'status_detail' => null,
'error_code' => 'ISO8583-82',
'error_message' => 'CVV Hatasi veya girilen CVV gecersiz.',
'recurring_id' => null,
'installment_count' => 12,
'order_id' => '4c4',
'payment_model' => '3d',
],
],
'success1' => [
'order' => [
'currency' => PosInterface::CURRENCY_TRY,
'amount' => 1.01,
Expand Down Expand Up @@ -1574,7 +1673,7 @@ public static function cancelTestDataProvider(): array
'status_detail' => 'general_error',
],
],
'success_recurring_1' => [
'success_recurring_1' => [
'responseData' => [
'RECURRINGOPERATION' => 'CANCEL',
'RECORDTYPE' => 'ORDER',
Expand Down

0 comments on commit 4defb5b

Please sign in to comment.