Skip to content

Commit

Permalink
estpos - fix issue #239 undefined index mdErrorMsg
Browse files Browse the repository at this point in the history
  • Loading branch information
mustapayev committed Oct 12, 2024
1 parent e9a15fa commit 3447458
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/DataMapper/ResponseDataMapper/EstPosResponseDataMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,19 @@ public function map3DPaymentData(array $raw3DAuthResponseData, ?array $rawPaymen
'eci' => null,
'tx_status' => null,
'cavv' => null,
'md_error_message' => $this->is3dAuthSuccess($mdStatus) ? null : $raw3DAuthResponseData['mdErrorMsg'],
'md_error_message' => null,
'3d_all' => $raw3DAuthResponseData,
];

if (null !== $mdStatus) {
if (!$this->is3dAuthSuccess($mdStatus)) {
$threeDResponse['md_error_message'] = $raw3DAuthResponseData['mdErrorMsg'];
}
} else {
$threeDResponse['error_code'] = $raw3DAuthResponseData['ErrorCode'];
$threeDResponse['error_message'] = $raw3DAuthResponseData['ErrMsg'];
}

if ($this->is3dAuthSuccess($mdStatus)) {
$threeDResponse['eci'] = $raw3DAuthResponseData['eci'];
$threeDResponse['cavv'] = $raw3DAuthResponseData['cavv'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,64 @@ public static function threeDPaymentDataProvider(): array
'installment_count' => 0,
],
],
'3d_auth_fail_wrong_card_number_format' => [
'order' => [
'currency' => PosInterface::CURRENCY_TRY,
'amount' => 1.01,
],
'txType' => PosInterface::TX_TYPE_PAY_AUTH,
'threeDResponseData' => [
'amount' => 0.01,
'clientid' => '*',
'currency' => '*',
'Ecom_Payment_Card_ExpDate_Month' => 0,
'Ecom_Payment_Card_ExpDate_Year' => 0,
'ErrMsg' => 'Girilen kart numarası doğru formatta değildir. Kart numarasını kontrol ederek tekrar işlem deneyiniz.',
'ErrorCode' => 'HPP-1001',
'failUrl' => 'https://*.com/odeme/f05e81c8-4ea0-44a9-8fe8-d45b854c62d9',
'HASH' => '**/fxNKZvC4E2EbQOgiqNi9FeXBMj636Q==',
'hashAlgorithm' => 'ver3',
'lang' => 'tr',
'maskedCreditCard' => '***',
'MaskedPan' => '**',
'oid' => 'f05e81c8',
'okUrl' => 'https://*.com/odeme/d45b854c62d9',
'Response' => 'Error',
'rnd' => 'MZrcwoSd1+-*',
'storetype' => '3d',
'taksit' => '',
'traceId' => '****',
'TranType' => 'Auth',
],
'paymentData' => [],
'expectedData' => [
'amount' => 0.01,
'auth_code' => null,
'batch_num' => null,
'cavv' => null,
'currency' => '*',
'eci' => null,
'error_code' => 'HPP-1001',
'error_message' => 'Girilen kart numarası doğru formatta değildir. Kart numarasını kontrol ederek tekrar işlem deneyiniz.',
'installment_count' => 0,
'masked_number' => '***',
'md_error_message' => null,
'md_status' => null,
'month' => 0,
'order_id' => 'f05e81c8',
'payment_model' => '3d',
'proc_return_code' => null,
'ref_ret_num' => null,
'status' => 'declined',
'status_detail' => null,
'transaction_id' => null,
'transaction_security' => null,
'transaction_type' => 'pay',
'transaction_time' => null,
'tx_status' => null,
'year' => 0,
],
],
'3d_auth_success_payment_fail' => [
'order' => [
'currency' => PosInterface::CURRENCY_TRY,
Expand Down

0 comments on commit 3447458

Please sign in to comment.