diff --git a/src/DataMapper/ResponseDataMapper/PosNetResponseDataMapper.php b/src/DataMapper/ResponseDataMapper/PosNetResponseDataMapper.php index bdeff45e..fc4227ae 100644 --- a/src/DataMapper/ResponseDataMapper/PosNetResponseDataMapper.php +++ b/src/DataMapper/ResponseDataMapper/PosNetResponseDataMapper.php @@ -154,7 +154,7 @@ public function map3DPaymentData(array $raw3DAuthResponseData, ?array $rawPaymen */ public function map3DPayResponseData(array $raw3DAuthResponseData, string $txType, array $order): array { - return $this->map3DPaymentData($raw3DAuthResponseData, $raw3DAuthResponseData, $txType, $order); + throw new NotImplementedException(); } /** @@ -162,7 +162,7 @@ public function map3DPayResponseData(array $raw3DAuthResponseData, string $txTyp */ public function map3DHostResponseData(array $raw3DAuthResponseData, string $txType, array $order): array { - return $this->map3DPayResponseData($raw3DAuthResponseData, $txType, $order); + throw new NotImplementedException(); } /** diff --git a/src/DataMapper/ResponseDataMapper/PosNetV1PosResponseDataMapper.php b/src/DataMapper/ResponseDataMapper/PosNetV1PosResponseDataMapper.php index c62ad704..7d1c0514 100644 --- a/src/DataMapper/ResponseDataMapper/PosNetV1PosResponseDataMapper.php +++ b/src/DataMapper/ResponseDataMapper/PosNetV1PosResponseDataMapper.php @@ -158,7 +158,7 @@ public function map3DPaymentData(array $raw3DAuthResponseData, ?array $rawPaymen */ public function map3DPayResponseData(array $raw3DAuthResponseData, string $txType, array $order): array { - return $this->map3DPaymentData($raw3DAuthResponseData, $raw3DAuthResponseData, $txType, $order); + throw new NotImplementedException(); } /** @@ -166,7 +166,7 @@ public function map3DPayResponseData(array $raw3DAuthResponseData, string $txTyp */ public function map3DHostResponseData(array $raw3DAuthResponseData, string $txType, array $order): array { - return $this->map3DPayResponseData($raw3DAuthResponseData, $txType, $order); + throw new NotImplementedException(); } /** diff --git a/tests/Unit/DataMapper/ResponseDataMapper/PosNetResponseDataMapperTest.php b/tests/Unit/DataMapper/ResponseDataMapper/PosNetResponseDataMapperTest.php index cbc872cf..8dbbd31e 100644 --- a/tests/Unit/DataMapper/ResponseDataMapper/PosNetResponseDataMapperTest.php +++ b/tests/Unit/DataMapper/ResponseDataMapper/PosNetResponseDataMapperTest.php @@ -7,6 +7,7 @@ use Mews\Pos\DataMapper\RequestDataMapper\PosNetRequestDataMapper; use Mews\Pos\DataMapper\ResponseDataMapper\PosNetResponseDataMapper; +use Mews\Pos\Exceptions\NotImplementedException; use Mews\Pos\Factory\CryptFactory; use Mews\Pos\Gateways\PosNet; use Mews\Pos\PosInterface; @@ -139,6 +140,23 @@ public function testMapRefundResponse(array $responseData, array $expectedData): $this->assertSame($expectedData, $actualData); } + public function testMapHistoryResponse(): void + { + $this->expectException(NotImplementedException::class); + $this->responseDataMapper->mapHistoryResponse([]); + } + + public function testMap3DPayResponseData(): void + { + $this->expectException(NotImplementedException::class); + $this->responseDataMapper->map3DPayResponseData([], PosInterface::TX_TYPE_PAY_AUTH, []); + } + + public function testMap3DHostResponseData(): void + { + $this->expectException(NotImplementedException::class); + $this->responseDataMapper->map3DHostResponseData([], PosInterface::TX_TYPE_PAY_AUTH, []); + } public function paymentTestDataProvider(): array { diff --git a/tests/Unit/DataMapper/ResponseDataMapper/PosNetV1PosResponseDataMapperTest.php b/tests/Unit/DataMapper/ResponseDataMapper/PosNetV1PosResponseDataMapperTest.php index 421be0b2..164368c3 100644 --- a/tests/Unit/DataMapper/ResponseDataMapper/PosNetV1PosResponseDataMapperTest.php +++ b/tests/Unit/DataMapper/ResponseDataMapper/PosNetV1PosResponseDataMapperTest.php @@ -7,6 +7,7 @@ use Mews\Pos\DataMapper\RequestDataMapper\PosNetV1PosRequestDataMapper; use Mews\Pos\DataMapper\ResponseDataMapper\PosNetV1PosResponseDataMapper; +use Mews\Pos\Exceptions\NotImplementedException; use Mews\Pos\Factory\CryptFactory; use Mews\Pos\Gateways\PosNetV1Pos; use Mews\Pos\PosInterface; @@ -148,6 +149,29 @@ public function testMapRefundResponse(array $responseData, array $expectedData): $this->assertSame($expectedData, $actualData); } + public function testMapHistoryResponse(): void + { + $this->expectException(NotImplementedException::class); + $this->responseDataMapper->mapHistoryResponse([]); + } + + public function testMapOrderHistoryResponse(): void + { + $this->expectException(NotImplementedException::class); + $this->responseDataMapper->mapOrderHistoryResponse([]); + } + + public function testMap3DPayResponseData(): void + { + $this->expectException(NotImplementedException::class); + $this->responseDataMapper->map3DPayResponseData([], PosInterface::TX_TYPE_PAY_AUTH, []); + } + + public function testMap3DHostResponseData(): void + { + $this->expectException(NotImplementedException::class); + $this->responseDataMapper->map3DHostResponseData([], PosInterface::TX_TYPE_PAY_AUTH, []); + } public static function paymentTestDataProvider(): iterable { diff --git a/tests/Unit/DataMapper/ResponseDataMapper/ToslaPosResponseDataMapperTest.php b/tests/Unit/DataMapper/ResponseDataMapper/ToslaPosResponseDataMapperTest.php index 1b9a2463..37809300 100644 --- a/tests/Unit/DataMapper/ResponseDataMapper/ToslaPosResponseDataMapperTest.php +++ b/tests/Unit/DataMapper/ResponseDataMapper/ToslaPosResponseDataMapperTest.php @@ -7,6 +7,7 @@ use Mews\Pos\DataMapper\RequestDataMapper\ToslaPosRequestDataMapper; use Mews\Pos\DataMapper\ResponseDataMapper\ToslaPosResponseDataMapper; +use Mews\Pos\Exceptions\NotImplementedException; use Mews\Pos\Factory\CryptFactory; use Mews\Pos\Gateways\ToslaPos; use Mews\Pos\PosInterface; @@ -169,7 +170,7 @@ public function testMapCancelResponse(array $responseData, array $expectedData): /** * @dataProvider orderHistoryDataProvider */ - public function testMapHistoryResponse(array $responseData, array $expectedData): void + public function testMapOrderHistoryResponse(array $responseData, array $expectedData): void { $actualData = $this->responseDataMapper->mapOrderHistoryResponse($responseData); if (isset($responseData['Transactions'])) { @@ -203,6 +204,18 @@ public function testMapHistoryResponse(array $responseData, array $expectedData) $this->assertSame($expectedData, $actualData); } + public function testMap3DPaymentResponseData(): void + { + $this->expectException(NotImplementedException::class); + $this->responseDataMapper->map3DPaymentData([], [], PosInterface::TX_TYPE_PAY_AUTH, []); + } + + public function testMapHistoryResponse(): void + { + $this->expectException(NotImplementedException::class); + $this->responseDataMapper->mapHistoryResponse([]); + } + public static function paymentDataProvider(): iterable { yield 'success1' => [