From 9ec2a1b660c1614223aa1e2f8e227b3fd80dc8e0 Mon Sep 17 00:00:00 2001 From: Richard Perdaan Date: Tue, 23 Mar 2021 18:29:22 +0100 Subject: [PATCH] fix: Bpost and DPD has a minimum of 1 gram (cherry picked from commit b3e70f98b1972a5cfb22b01717eeb6841dd94886) --- src/Model/Consignment/BpostConsignment.php | 4 ++-- src/Model/Consignment/DPDConsignment.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Model/Consignment/BpostConsignment.php b/src/Model/Consignment/BpostConsignment.php index d8d69bfa..9856d6be 100644 --- a/src/Model/Consignment/BpostConsignment.php +++ b/src/Model/Consignment/BpostConsignment.php @@ -247,8 +247,8 @@ public function setRetailNetworkId(string $retailNetworkId): AbstractConsignment */ public function validate(): bool { - if ($this->getTotalWeight() < 50) { - throw new InvalidConsignmentException('It is necessary to at a minimum weight of 50 grams'); + if ($this->getTotalWeight() < 1) { + throw new InvalidConsignmentException('It is necessary to at a minimum weight of 1 grams'); } /** @var \MyParcelNL\Sdk\src\Model\MyParcelCustomsItem $item */ diff --git a/src/Model/Consignment/DPDConsignment.php b/src/Model/Consignment/DPDConsignment.php index 977be9d8..d8111564 100644 --- a/src/Model/Consignment/DPDConsignment.php +++ b/src/Model/Consignment/DPDConsignment.php @@ -220,8 +220,8 @@ public function setRetailNetworkId(string $retailNetworkId): AbstractConsignment */ public function validate(): bool { - if ($this->getTotalWeight() < 10) { - throw new InvalidConsignmentException('It is necessary to at a minimum weight of 10 grams'); + if ($this->getTotalWeight() < 1) { + throw new InvalidConsignmentException('It is necessary to at a minimum weight of 1 grams'); } return parent::validate();