From 87a6931bea4598cab9196319585f6cedde8df6f2 Mon Sep 17 00:00:00 2001 From: Mark Ernst <33826576+Mark-Ernst@users.noreply.github.com> Date: Wed, 4 Oct 2023 11:21:59 +0200 Subject: [PATCH] fix: ensure signature for europlus and parcel connect (#460) --- src/Services/ConsignmentEncode.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Services/ConsignmentEncode.php b/src/Services/ConsignmentEncode.php index c117e7c1..8cd135a0 100644 --- a/src/Services/ConsignmentEncode.php +++ b/src/Services/ConsignmentEncode.php @@ -14,7 +14,9 @@ use InvalidArgumentException; use MyParcelNL\Sdk\src\Exception\MissingFieldException; +use MyParcelNL\Sdk\src\Model\Carrier\CarrierDHLEuroplus; use MyParcelNL\Sdk\src\Model\Carrier\CarrierDHLForYou; +use MyParcelNL\Sdk\src\Model\Carrier\CarrierDHLParcelConnect; use MyParcelNL\Sdk\src\Model\Consignment\AbstractConsignment; use MyParcelNL\Sdk\src\Model\MyParcelCustomsItem; use MyParcelNL\Sdk\src\Support\Arr; @@ -107,6 +109,10 @@ public static function encodeExtraOptions(array $consignmentEncoded, AbstractCon $consignmentEncoded['options']['hide_sender'] = 0; } + if (in_array($consignment->getCarrierName(), [CarrierDHLEuroplus::NAME, CarrierDHLParcelConnect::NAME])) { + $consignmentEncoded['options']['signature'] = 1; + } + if ($consignment->getDeliveryDate()) { $consignmentEncoded['options']['delivery_date'] = $consignment->getDeliveryDate(); }