From f242bfe40c7dce0cb350fcc3118975f73de9e74b Mon Sep 17 00:00:00 2001 From: jochemgravendeel Date: Mon, 25 Nov 2024 10:25:35 +0100 Subject: [PATCH] feat: allow receipt code to be used to BE --- .../Order/Calculator/PostNl/PostNLReceiptCodeCalculator.php | 2 +- .../Calculator/PostNl/PostNLReceiptCodeCalculatorTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/App/Order/Calculator/PostNl/PostNLReceiptCodeCalculator.php b/src/App/Order/Calculator/PostNl/PostNLReceiptCodeCalculator.php index 8f2183a70..07452caa8 100644 --- a/src/App/Order/Calculator/PostNl/PostNLReceiptCodeCalculator.php +++ b/src/App/Order/Calculator/PostNl/PostNLReceiptCodeCalculator.php @@ -33,7 +33,7 @@ public function calculate(): void return; } - if ($this->order->shippingAddress->cc !== CountryCodes::CC_NL) { + if (! in_array($this->order->shippingAddress->cc, [CountryCodes::CC_NL, CountryCodes::CC_BE])) { $shipmentOptions->receiptCode = TriStateService::DISABLED; return; } diff --git a/tests/Unit/App/Order/Calculator/PostNl/PostNLReceiptCodeCalculatorTest.php b/tests/Unit/App/Order/Calculator/PostNl/PostNLReceiptCodeCalculatorTest.php index 686cb6245..dbdde4119 100644 --- a/tests/Unit/App/Order/Calculator/PostNl/PostNLReceiptCodeCalculatorTest.php +++ b/tests/Unit/App/Order/Calculator/PostNl/PostNLReceiptCodeCalculatorTest.php @@ -78,10 +78,10 @@ ], ], - 'disables receipt code when shipping to a non-NL country' => [ + 'disables receipt code when shipping to a non-NL or BE country' => [ [ShipmentOptions::RECEIPT_CODE => TriStateService::ENABLED], [ShipmentOptions::RECEIPT_CODE => TriStateService::DISABLED], - 'BE', + 'FR', ], 'disables signature, only recipient, large format and return when receipt code is enabled' => [