From fb51817fe0400a89ca0318d492b459b996e1fa96 Mon Sep 17 00:00:00 2001 From: Nuryagdy Mustapayev Date: Wed, 22 May 2024 12:52:57 +0200 Subject: [PATCH] PosNetResponseDataMapper - fix 3d_all data is not available in response data --- .../ResponseDataMapper/PosNetResponseDataMapper.php | 1 + .../ResponseDataMapper/PosNetResponseDataMapperTest.php | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/DataMapper/ResponseDataMapper/PosNetResponseDataMapper.php b/src/DataMapper/ResponseDataMapper/PosNetResponseDataMapper.php index aefa6a36..bdeff45e 100644 --- a/src/DataMapper/ResponseDataMapper/PosNetResponseDataMapper.php +++ b/src/DataMapper/ResponseDataMapper/PosNetResponseDataMapper.php @@ -107,6 +107,7 @@ public function map3DPaymentData(array $raw3DAuthResponseData, ?array $rawPaymen $defaultResponse['proc_return_code'] = $procReturnCode; $defaultResponse['error_code'] = $raw3DAuthResponseData['respCode']; $defaultResponse['error_message'] = $raw3DAuthResponseData['respText']; + $defaultResponse['3d_all'] = $raw3DAuthResponseData; return $defaultResponse; } diff --git a/tests/Unit/DataMapper/ResponseDataMapper/PosNetResponseDataMapperTest.php b/tests/Unit/DataMapper/ResponseDataMapper/PosNetResponseDataMapperTest.php index dd60d976..cbc872cf 100644 --- a/tests/Unit/DataMapper/ResponseDataMapper/PosNetResponseDataMapperTest.php +++ b/tests/Unit/DataMapper/ResponseDataMapper/PosNetResponseDataMapperTest.php @@ -98,6 +98,10 @@ public function testMap3DPaymentData(array $order, string $txType, array $threeD } unset($actualData['transaction_time'], $expectedData['transaction_time']); + + $this->assertArrayHasKey('3d_all', $actualData); + $this->assertIsArray($actualData['3d_all']); + $this->assertNotEmpty($actualData['3d_all']); unset($actualData['all'], $actualData['3d_all']); \ksort($expectedData); \ksort($actualData);