diff --git a/composer.json b/composer.json index dfa30f32..dc455335 100755 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "myparcelnl/sdk", - "version": "v1.3.7", + "version": "v1.3.8", "description": "This package is designed to send and receive data from MyParcel by means of an API.", "homepage": "https://www.myparcel.nl", "tags": ["MyParcel", "My Parcel", "Post NL", "PostNL"], diff --git a/src/Model/Repository/MyParcelConsignmentRepository.php b/src/Model/Repository/MyParcelConsignmentRepository.php index dd56195a..49e0c870 100755 --- a/src/Model/Repository/MyParcelConsignmentRepository.php +++ b/src/Model/Repository/MyParcelConsignmentRepository.php @@ -43,7 +43,7 @@ class MyParcelConsignmentRepository extends MyParcelConsignment const DELIVERY_TYPE_RETAIL = 4; const DELIVERY_TYPE_RETAIL_EXPRESS = 5; - const PACKAGE_TYPE_NORMAL = 2; + const PACKAGE_TYPE_NORMAL = 1; const DEFAULT_PACKAGE_TYPE = self::PACKAGE_TYPE_NORMAL; @@ -370,6 +370,12 @@ protected function isCdCountry() */ private function encodeBaseOptions() { + $packageType = $this->getPackageType(); + + if ($packageType == null) { + $packageType = self::DEFAULT_PACKAGE_TYPE; + } + $this->consignmentEncoded = [ 'recipient' => [ 'cc' => $this->getCountry(), @@ -380,7 +386,7 @@ private function encodeBaseOptions() 'phone' => (string) $this->getPhone(), ], 'options' => [ - 'package_type' => $this->getPackageType() ?: self::TYPE_STANDARD, + 'package_type' => $packageType, 'label_description' => $this->getLabelDescription(), ], 'carrier' => 1,