Skip to content

Commit

Permalink
Merge pull request #45 from myparcelnl/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
adem-demir authored Mar 23, 2018
2 parents f0e9807 + d3c0209 commit ba6585a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -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"],
Expand Down
10 changes: 8 additions & 2 deletions src/Model/Repository/MyParcelConsignmentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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(),
Expand All @@ -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,
Expand Down

0 comments on commit ba6585a

Please sign in to comment.