Skip to content

Commit

Permalink
Merge pull request #172 from myparcelnl/multicollo-multiple-consignments
Browse files Browse the repository at this point in the history
use multiple consignment
  • Loading branch information
RichardPerdaan authored Oct 23, 2019
2 parents 86ecfe2 + 756bee5 commit 0c3360c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 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.1",
"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
5 changes: 2 additions & 3 deletions src/Helper/MyParcelCollection.php
Original file line number Diff line number Diff line change
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 0c3360c

Please sign in to comment.