From c2598e606b61f4b1ec25ca69ec39ffb1ae34e20d Mon Sep 17 00:00:00 2001 From: Dmitry Vorobyev Date: Sat, 4 Mar 2023 18:59:45 -0500 Subject: [PATCH 1/3] fixed empty Pieces structure --- src/Datatype/AM/ShipmentInfo.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Datatype/AM/ShipmentInfo.php b/src/Datatype/AM/ShipmentInfo.php index 55db2c4..8824f1c 100644 --- a/src/Datatype/AM/ShipmentInfo.php +++ b/src/Datatype/AM/ShipmentInfo.php @@ -58,9 +58,10 @@ class ShipmentInfo extends Base 'subobject' => true, ], 'Pieces' => [ - 'type' => '', + 'type' => 'Piece', 'required' => false, 'subobject' => true, + 'multivalues' => true, ], 'Weight' => [ 'type' => 'string', From c3bd6fd0137267a7388c6d4cc86a72aa63348291 Mon Sep 17 00:00:00 2001 From: Dmitry Vorobyev Date: Sat, 4 Mar 2023 19:07:27 -0500 Subject: [PATCH 2/3] fixed datetime issue --- src/Datatype/AM/ShipmentInfo.php | 2 +- src/Datatype/EU/ShipmentInfo.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Datatype/AM/ShipmentInfo.php b/src/Datatype/AM/ShipmentInfo.php index 8824f1c..65d5d67 100644 --- a/src/Datatype/AM/ShipmentInfo.php +++ b/src/Datatype/AM/ShipmentInfo.php @@ -55,7 +55,7 @@ class ShipmentInfo extends Base 'ShipmentDate' => [ 'type' => 'dateTime', 'required' => false, - 'subobject' => true, + 'subobject' => false, ], 'Pieces' => [ 'type' => 'Piece', diff --git a/src/Datatype/EU/ShipmentInfo.php b/src/Datatype/EU/ShipmentInfo.php index 412a3f8..65196f9 100644 --- a/src/Datatype/EU/ShipmentInfo.php +++ b/src/Datatype/EU/ShipmentInfo.php @@ -49,7 +49,7 @@ class ShipmentInfo extends \Mtc\Dhl\Datatype\AM\ShipmentInfo 'ShipmentDate' => [ 'type' => 'dateTime', 'required' => false, - 'subobject' => true, + 'subobject' => false, ], 'Pieces' => [ 'type' => 'Piece', From 818bba6cbccc6d1e3c2013a7ebba5c4ee9444ed1 Mon Sep 17 00:00:00 2001 From: Dmitry Vorobyev Date: Sat, 4 Mar 2023 19:12:39 -0500 Subject: [PATCH 3/3] tracking response example --- docs/tracking.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/tracking.md b/docs/tracking.md index b6fd2ae..1888e8b 100644 --- a/docs/tracking.md +++ b/docs/tracking.md @@ -12,6 +12,10 @@ $tracking->PiecesEnabled = 'S'; $client = new Web($this->getEnvironment()); $xml_response = $client->call($tracking); + +$result = new TrackingResponse(); +$result->initFromXML($xml_response); +echo $result->AWBInfo->Status->ActionStatus; ``` If you need XML request for the DHL certification you can obtain by calling the following code