Skip to content

Commit

Permalink
Merge branch 'develop' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardPerdaan authored Oct 30, 2019
2 parents 1876008 + 7ceeaae commit 3125d3a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 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": "v3.0.0",
"version": "v3.0.2",
"description": "This package is designed to send and receive data from MyParcel by means of an API.",
"homepage": "https://www.myparcel.nl",
"keywords": ["MyParcel", "My Parcel", "Flespakket", "Post NL", "PostNL"],
Expand Down
7 changes: 3 additions & 4 deletions src/Helper/MyParcelCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function getConsignmentsByReferenceId($id): MyParcelCollection
}

if ($this->count() === 1) {
return $this;
return new static($this->items);
}

return $this->where('reference_identifier', $id);
Expand Down Expand Up @@ -746,11 +746,10 @@ private function getNewCollectionFromResult($result)
$newCollection->addConsignment($consignmentAdapter->getConsignment()->setMultiCollo($isMultiCollo));

foreach ($shipment['secondary_shipments'] as $secondaryShipment) {

$secondaryShipment = Arr::arrayMergeRecursiveDistinct($shipment, $secondaryShipment);
$consignmentAdapter = new ConsignmentAdapter($secondaryShipment, $this->getConsignmentsByReferenceId($secondaryShipment['reference_identifier'])->first());
$consignment = ConsignmentFactory::createByCarrierId($shipment['carrier_id'])->setApiKey($apiKey);
$consignmentAdapter = new ConsignmentAdapter($secondaryShipment, $consignment);
$newCollection->addConsignment($consignmentAdapter->getConsignment()->setMultiCollo($isMultiCollo));

}
}

Expand Down

0 comments on commit 3125d3a

Please sign in to comment.