From 7159c79af18d11d91f1e4e20a4921faac7dd944b Mon Sep 17 00:00:00 2001 From: Jochem Gravendeel <119667571+GravendeelJochem@users.noreply.github.com> Date: Thu, 19 Sep 2024 16:59:27 +0200 Subject: [PATCH] fix: fix error physical properties DHLForYou (#504) --- src/Services/ConsignmentEncode.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Services/ConsignmentEncode.php b/src/Services/ConsignmentEncode.php index 6dbff040..0ef6032f 100644 --- a/src/Services/ConsignmentEncode.php +++ b/src/Services/ConsignmentEncode.php @@ -265,6 +265,13 @@ private function encodePhysicalProperties(): self throw new MissingFieldException('Weight in physical properties must be set for digital stamp shipments.'); } + if (CarrierDHLForYou::NAME === $consignment->getCarrier()->getName()) { + $consignment->setPhysicalProperties([ + 'weight' => $consignment->getTotalWeight(), + 'volume' => 1, + ]); + } + $this->consignmentEncoded['physical_properties'] = $consignment->getPhysicalProperties(); return $this;