From 81172103da962364f3962e6d34d2bcf3347432e6 Mon Sep 17 00:00:00 2001 From: MartijnDB Date: Fri, 9 Aug 2019 09:47:33 +0200 Subject: [PATCH 1/3] Allow for Delivery on Demand (Mytime) --- src/ComplexTypes/Shipment.php | 54 ++++++++++++++++++++++++++++++++++- src/LabellingClient.php | 4 +-- 2 files changed, 55 insertions(+), 3 deletions(-) diff --git a/src/ComplexTypes/Shipment.php b/src/ComplexTypes/Shipment.php index bc527c2..752bf13 100644 --- a/src/ComplexTypes/Shipment.php +++ b/src/ComplexTypes/Shipment.php @@ -148,6 +148,16 @@ class Shipment extends BaseType */ protected $ReturnReference = null; + /** + * @var string + */ + protected $DeliveryTimeStampStart = null; + + /** + * @var string + */ + protected $DeliveryTimeStampEnd = null; + /** * @param ArrayOfAddress $Addresses * @param string $Barcode @@ -178,6 +188,8 @@ class Shipment extends BaseType * @param string $Remark Optional. * @param string $ReturnBarcode Optional. * @param string $ReturnReference Optional. + * @param string $DeliveryTimeStampStart Optional. + * @param string $DeliveryTimeStampEnd Optional. */ public function __construct( ArrayOfAddress $Addresses, @@ -208,7 +220,9 @@ public function __construct( $ReferenceCollect = null, $Remark = null, $ReturnBarcode = null, - $ReturnReference = null + $ReturnReference = null, + $DeliveryTimeStampStart = null, + $DeliveryTimeStampEnd = null ) { $this->setAddresses($Addresses); $this->setBarcode($Barcode); @@ -241,6 +255,8 @@ public function __construct( $this->setRemark($Remark); $this->setReturnBarcode($ReturnBarcode); $this->setReturnReference($ReturnReference); + $this->setDeliveryTimeStampStart($DeliveryTimeStampStart); + $this->setDeliveryTimeStampEnd($DeliveryTimeStampEnd); } /** @@ -764,4 +780,40 @@ public function setReturnReference($ReturnReference) $this->ReturnReference = $ReturnReference; return $this; } + + /** + * @return string + */ + public function getDeliveryTimeStampStart() + { + return $this->DeliveryTimeStampStart; + } + + /** + * @param string $DeliveryTimeStampStart + * @return Shipment + */ + public function setDeliveryTimeStampStart($DeliveryTimeStampStart) + { + $this->DeliveryTimeStampStart = $DeliveryTimeStampStart; + return $this; + } + + /** + * @return string + */ + public function getDeliveryTimeStampEnd() + { + return $this->DeliveryTimeStampEnd; + } + + /** + * @param string $DeliveryTimeStampEnd + * @return Shipment + */ + public function setDeliveryTimeStampEnd($DeliveryTimeStampEnd) + { + $this->DeliveryTimeStampEnd = $DeliveryTimeStampEnd; + return $this; + } } diff --git a/src/LabellingClient.php b/src/LabellingClient.php index 238edd9..d87d8e4 100644 --- a/src/LabellingClient.php +++ b/src/LabellingClient.php @@ -9,12 +9,12 @@ class LabellingClient extends BaseClient /** * @var string The URL of the production WSDL. */ - const PRODUCTION_WSDL = 'https://api.postnl.nl/shipment/v2_0/label/soap.wsdl'; + const PRODUCTION_WSDL = 'https://api.postnl.nl/shipment/v2_1/label/soap.wsdl'; /** * @var string The URL of the sandbox WSDL. */ - const SANDBOX_WSDL = 'https://api-sandbox.postnl.nl/shipment/v2_0/label/soap.wsdl'; + const SANDBOX_WSDL = 'https://api-sandbox.postnl.nl/shipment/v2_1/label/soap.wsdl'; /** * @var array The complex types used by this client. From 33acfd295d1b0f562e7cf454daab08274bb1f8a6 Mon Sep 17 00:00:00 2001 From: MartijnDB Date: Mon, 12 Aug 2019 10:43:17 +0200 Subject: [PATCH 2/3] Added EAN and ProductUrl for Labeling Service 2.1 --- src/ComplexTypes/Customs.php | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/src/ComplexTypes/Customs.php b/src/ComplexTypes/Customs.php index f94dbbe..7cbbb51 100644 --- a/src/ComplexTypes/Customs.php +++ b/src/ComplexTypes/Customs.php @@ -23,6 +23,11 @@ class Customs extends BaseType */ protected $Currency = null; + /** + * @var string + */ + protected $EAN = null; + /** * @var string */ @@ -48,6 +53,11 @@ class Customs extends BaseType */ protected $LicenseNr = null; + /** + * @var string + */ + protected $ProductURL = null; + /** * @var string */ @@ -58,11 +68,13 @@ class Customs extends BaseType * @param string $CertificateNr * @param ArrayOfContent $Content * @param string $Currency + * @param string $EAN * @param string $HandleAsNonDeliverable * @param string $Invoice * @param string $InvoiceNr * @param string $License * @param string $LicenseNr + * @param string $ProductURL * @param string $ShipmentType */ public function __construct( @@ -70,22 +82,26 @@ public function __construct( $CertificateNr, ArrayOfContent $Content, $Currency, + $EAN, $HandleAsNonDeliverable, $Invoice, $InvoiceNr, $License, $LicenseNr, + $ProductURL, $ShipmentType ) { $this->setCertificate($Certificate); $this->setCertificateNr($CertificateNr); $this->setContent($Content); $this->setCurrency($Currency); + $this->setEAN($EAN); $this->setHandleAsNonDeliverable($HandleAsNonDeliverable); $this->setInvoice($Invoice); $this->setInvoiceNr($InvoiceNr); $this->setLicense($License); $this->setLicenseNr($LicenseNr); + $this->setProductURL($ProductURL); $this->setShipmentType($ShipmentType); } @@ -161,6 +177,24 @@ public function setCurrency($Currency) return $this; } + /** + * @return string + */ + public function getEAN() + { + return $this->EAN; + } + + /** + * @param string $EAN + * @return Customs + */ + public function setEAN($EAN) + { + $this->EAN = $EAN; + return $this; + } + /** * @return string */ @@ -215,6 +249,24 @@ public function setInvoiceNr($InvoiceNr) return $this; } + /** + * @return string + */ + public function getProductURL() + { + return $this->ProductURL; + } + + /** + * @param string $ProductURL + * @return Customs + */ + public function setProductURL($ProductURL) + { + $this->ProductURL = $ProductURL; + return $this; + } + /** * @return string */ From 82be9c5528e407de13fee458e7ee6624edf45e8d Mon Sep 17 00:00:00 2001 From: MartijnDB Date: Mon, 12 Aug 2019 10:44:12 +0200 Subject: [PATCH 3/3] Changed DeliveryTimeStamp in DeliveryTimestamp. Replaced tabs by spaces --- src/ComplexTypes/Shipment.php | 98 +++++++++++++++++------------------ 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/src/ComplexTypes/Shipment.php b/src/ComplexTypes/Shipment.php index 752bf13..c67918a 100644 --- a/src/ComplexTypes/Shipment.php +++ b/src/ComplexTypes/Shipment.php @@ -148,15 +148,15 @@ class Shipment extends BaseType */ protected $ReturnReference = null; - /** - * @var string - */ - protected $DeliveryTimeStampStart = null; + /** + * @var string + */ + protected $DeliveryTimestampStart = null; - /** - * @var string - */ - protected $DeliveryTimeStampEnd = null; + /** + * @var string + */ + protected $DeliveryTimestampEnd = null; /** * @param ArrayOfAddress $Addresses @@ -188,8 +188,8 @@ class Shipment extends BaseType * @param string $Remark Optional. * @param string $ReturnBarcode Optional. * @param string $ReturnReference Optional. - * @param string $DeliveryTimeStampStart Optional. - * @param string $DeliveryTimeStampEnd Optional. + * @param string $DeliveryTimestampStart Optional. + * @param string $DeliveryTimestampEnd Optional. */ public function __construct( ArrayOfAddress $Addresses, @@ -221,8 +221,8 @@ public function __construct( $Remark = null, $ReturnBarcode = null, $ReturnReference = null, - $DeliveryTimeStampStart = null, - $DeliveryTimeStampEnd = null + $DeliveryTimestampStart = null, + $DeliveryTimestampEnd = null ) { $this->setAddresses($Addresses); $this->setBarcode($Barcode); @@ -255,8 +255,8 @@ public function __construct( $this->setRemark($Remark); $this->setReturnBarcode($ReturnBarcode); $this->setReturnReference($ReturnReference); - $this->setDeliveryTimeStampStart($DeliveryTimeStampStart); - $this->setDeliveryTimeStampEnd($DeliveryTimeStampEnd); + $this->setDeliveryTimestampStart($DeliveryTimestampStart); + $this->setDeliveryTimestampEnd($DeliveryTimestampEnd); } /** @@ -781,39 +781,39 @@ public function setReturnReference($ReturnReference) return $this; } - /** - * @return string - */ - public function getDeliveryTimeStampStart() - { - return $this->DeliveryTimeStampStart; - } - - /** - * @param string $DeliveryTimeStampStart - * @return Shipment - */ - public function setDeliveryTimeStampStart($DeliveryTimeStampStart) - { - $this->DeliveryTimeStampStart = $DeliveryTimeStampStart; - return $this; - } - - /** - * @return string - */ - public function getDeliveryTimeStampEnd() - { - return $this->DeliveryTimeStampEnd; - } - - /** - * @param string $DeliveryTimeStampEnd - * @return Shipment - */ - public function setDeliveryTimeStampEnd($DeliveryTimeStampEnd) - { - $this->DeliveryTimeStampEnd = $DeliveryTimeStampEnd; - return $this; - } + /** + * @return string + */ + public function getDeliveryTimestampStart() + { + return $this->DeliveryTimestampStart; + } + + /** + * @param string $DeliveryTimestampStart + * @return Shipment + */ + public function setDeliveryTimestampStart($DeliveryTimestampStart) + { + $this->DeliveryTimestampStart = $DeliveryTimestampStart; + return $this; + } + + /** + * @return string + */ + public function getDeliveryTimestampEnd() + { + return $this->DeliveryTimestampEnd; + } + + /** + * @param string $DeliveryTimestampEnd + * @return Shipment + */ + public function setDeliveryTimestampEnd($DeliveryTimestampEnd) + { + $this->DeliveryTimestampEnd = $DeliveryTimestampEnd; + return $this; + } }