From 5245c7584558e9e17b119b04b0fae59a558189c9 Mon Sep 17 00:00:00 2001
From: Peter v Binsbergen
Date: Wed, 22 Jul 2020 11:22:44 +0200
Subject: [PATCH 1/2] 2_2 Jan 25, 2019 Current version The following
fields have been added to the interface for shipments to the USA:
-Shipment.Customs.TrustedShipperID
-Shipment.Customs.ImporterReferenceCode
-Shipment.Customs.TransactionCode
-Shipment.Customs.TransactionDescription
-Shipment.CodingText (response)
A Codingtext have been added to the labels for mailbox parcels (brievenbuspakjes).
---
src/ComplexTypes/Customs.php | 107 +++++++++++++++++++++++++-
src/ComplexTypes/ResponseShipment.php | 27 +++++++
src/LabellingClient.php | 4 +-
3 files changed, 135 insertions(+), 3 deletions(-)
diff --git a/src/ComplexTypes/Customs.php b/src/ComplexTypes/Customs.php
index f94dbbe..cc0adc3 100644
--- a/src/ComplexTypes/Customs.php
+++ b/src/ComplexTypes/Customs.php
@@ -53,6 +53,26 @@ class Customs extends BaseType
*/
protected $ShipmentType = null;
+ /**
+ * @var string
+ */
+ protected $TrustedShipperID = null;
+
+ /**
+ * @var string
+ */
+ protected $ImporterReferenceCode = null;
+
+ /**
+ * @var string
+ */
+ protected $TransactionCode = null;
+
+ /**
+ * @var string
+ */
+ protected $TransactionDescription = null;
+
/**
* @param string $Certificate
* @param string $CertificateNr
@@ -64,6 +84,10 @@ class Customs extends BaseType
* @param string $License
* @param string $LicenseNr
* @param string $ShipmentType
+ * @param string $TrustedShipperID
+ * @param string $ImporterReferenceCode
+ * @param string $TransactionCode
+ * @param string $TransactionDescription
*/
public function __construct(
$Certificate,
@@ -75,7 +99,11 @@ public function __construct(
$InvoiceNr,
$License,
$LicenseNr,
- $ShipmentType
+ $ShipmentType,
+ $TrustedShipperID,
+ $ImporterReferenceCode,
+ $TransactionCode,
+ $TransactionDescription
) {
$this->setCertificate($Certificate);
$this->setCertificateNr($CertificateNr);
@@ -87,6 +115,10 @@ public function __construct(
$this->setLicense($License);
$this->setLicenseNr($LicenseNr);
$this->setShipmentType($ShipmentType);
+ $this->setTrustedShipperID($TrustedShipperID);
+ $this->setImporterReferenceCode($ImporterReferenceCode);
+ $this->setTransactionCode($TransactionCode);
+ $this->setTransactionDescription($TransactionDescription);
}
/**
@@ -268,4 +300,77 @@ public function setShipmentType($ShipmentType)
$this->ShipmentType = $ShipmentType;
return $this;
}
+
+ /**
+ * @return string
+ */
+ public function getTrustedShipperID()
+ {
+ return $this->TrustedShipperID;
+ }
+
+ /**
+ * @param string $TrustedShipperID
+ * @return Customs
+ */
+ public function setTrustedShipperID($TrustedShipperID)
+ {
+ $this->TrustedShipperID = $TrustedShipperID;
+ return $this;
+ }
+
+ /**
+ * @return string
+ */
+ public function getImporterReferenceCode()
+ {
+ return $this->ImporterReferenceCode;
+ }
+
+ /**
+ * @param string $ImporterReferenceCode
+ * @return Customs
+ */
+ public function setImporterReferenceCode($ImporterReferenceCode)
+ {
+ $this->ImporterReferenceCode = $ImporterReferenceCode;
+ return $this;
+ }
+
+ /**
+ * @return string
+ */
+ public function getTransactionCode()
+ {
+ return $this->TransactionCode;
+ }
+
+ /**
+ * @param string $TransactionCode
+ * @return Customs
+ */
+ public function setTransactionCode($TransactionCode)
+ {
+ $this->TransactionCode = $TransactionCode;
+ return $this;
+ }
+
+ /**
+ * @return string
+ */
+ public function getTransactionDescription()
+ {
+ return $this->TransactionDescription;
+ }
+
+ /**
+ * @param string $TransactionDescription
+ * @return Customs
+ */
+ public function setTransactionDescription($TransactionDescription)
+ {
+ $this->TransactionDescription = $TransactionDescription;
+ return $this;
+ }
+
}
diff --git a/src/ComplexTypes/ResponseShipment.php b/src/ComplexTypes/ResponseShipment.php
index 5a73a7e..6569b0c 100644
--- a/src/ComplexTypes/ResponseShipment.php
+++ b/src/ComplexTypes/ResponseShipment.php
@@ -8,6 +8,11 @@ class ResponseShipment extends BaseType
*/
protected $Barcode = null;
+ /**
+ * @var string
+ */
+ protected $CodingText = null;
+
/**
* @var string
*/
@@ -40,6 +45,7 @@ class ResponseShipment extends BaseType
/**
* @param string $Barcode
+ * @param string $CodingText
* @param string $DownPartnerBarcode
* @param string $DownPartnerID
* @param string $DownPartnerLocation
@@ -49,6 +55,7 @@ class ResponseShipment extends BaseType
*/
public function __construct(
$Barcode,
+ $CodingText,
$DownPartnerBarcode,
$DownPartnerID,
$DownPartnerLocation,
@@ -57,6 +64,7 @@ public function __construct(
ArrayOfWarning $Warnings
) {
$this->setBarcode($Barcode);
+ $this->setCodingText($CodingText);
$this->setDownPartnerBarcode($DownPartnerBarcode);
$this->setDownPartnerID($DownPartnerID);
$this->setDownPartnerLocation($DownPartnerLocation);
@@ -83,6 +91,25 @@ public function setBarcode($Barcode)
return $this;
}
+ /**
+ * @return string
+ */
+ public function getCodingText()
+ {
+ return $this->CodingText;
+ }
+
+ /**
+ * @param string $CodingText
+ * @return ResponseShipment
+ */
+ public function setCodingText($CodingText)
+ {
+ $this->CodingText = $CodingText;
+ return $this;
+ }
+
+
/**
* @return string
*/
diff --git a/src/LabellingClient.php b/src/LabellingClient.php
index 238edd9..ba2e227 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_2/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_2/label/soap.wsdl';
/**
* @var array The complex types used by this client.
From 88cbe7ca06ee5f016b1c71e56554b94a46b74bcd Mon Sep 17 00:00:00 2001
From: Peter v Binsbergen
Date: Wed, 22 Jul 2020 12:59:16 +0200
Subject: [PATCH 2/2] Added EAN and ProductUrl for Labeling Service 2.1 and
Allow for Delivery on Demand (Mytime)
---
README.md | 4 +--
src/ComplexTypes/Customs.php | 53 ++++++++++++++++++++++++++++++++++
src/ComplexTypes/Shipment.php | 54 ++++++++++++++++++++++++++++++++++-
src/ConfirmingClient.php | 4 +--
src/LabellingClient.php | 2 +-
5 files changed, 111 insertions(+), 6 deletions(-)
diff --git a/README.md b/README.md
index 716def8..dda14ab 100644
--- a/README.md
+++ b/README.md
@@ -44,8 +44,8 @@ and which aren't. The list of existing services is taken from
| Kredietcheck Zakelijk | ✗ | N/A |
| **Send & Track** |||
| Barcode webservice | ✓ | 1_1 |
-| Confirming webservice | ✓ | 1_9 |
-| Labelling webservice | ✓ | 2_0 |
+| Confirming webservice | ✓ | 2_0 |
+| Labelling webservice | ✓ | 2_2 |
| Shippingstatus webservice | ✓ | 1_6 |
| **Delivery options** |||
| Deliverydate webservice | ✓ | 2_1 |
diff --git a/src/ComplexTypes/Customs.php b/src/ComplexTypes/Customs.php
index cc0adc3..d8fc0ca 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
*/
@@ -43,6 +48,11 @@ class Customs extends BaseType
*/
protected $License = null;
+ /**
+ * @var string
+ */
+ protected $ProductURL = null;
+
/**
* @var string
*/
@@ -78,11 +88,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
* @param string $TrustedShipperID
* @param string $ImporterReferenceCode
@@ -94,11 +106,13 @@ public function __construct(
$CertificateNr,
ArrayOfContent $Content,
$Currency,
+ $EAN,
$HandleAsNonDeliverable,
$Invoice,
$InvoiceNr,
$License,
$LicenseNr,
+ $ProductURL,
$ShipmentType,
$TrustedShipperID,
$ImporterReferenceCode,
@@ -109,11 +123,13 @@ public function __construct(
$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);
$this->setTrustedShipperID($TrustedShipperID);
$this->setImporterReferenceCode($ImporterReferenceCode);
@@ -193,6 +209,25 @@ 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
*/
@@ -283,6 +318,24 @@ public function setLicenseNr($LicenseNr)
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
*/
diff --git a/src/ComplexTypes/Shipment.php b/src/ComplexTypes/Shipment.php
index bc527c2..7519386 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/ConfirmingClient.php b/src/ConfirmingClient.php
index b2ac1aa..ac4ca37 100644
--- a/src/ConfirmingClient.php
+++ b/src/ConfirmingClient.php
@@ -9,12 +9,12 @@ class ConfirmingClient extends BaseClient
/**
* @var string The URL of the production WSDL.
*/
- const PRODUCTION_WSDL = 'https://api.postnl.nl/shipment/v1_9/confirm/soap.wsdl';
+ const PRODUCTION_WSDL = 'https://api.postnl.nl/shipment/v2/confirm/soap.wsdl';
/**
* @var string The URL of the sandbox WSDL.
*/
- const SANDBOX_WSDL = 'https://api-sandbox.postnl.nl/shipment/v1_9/confirm/soap.wsdl';
+ const SANDBOX_WSDL = 'https://api-sandbox.postnl.nl/shipment/v2/confirm/soap.wsdl';
/**
* @var array The complex types used by this client.
diff --git a/src/LabellingClient.php b/src/LabellingClient.php
index ba2e227..e0b1805 100644
--- a/src/LabellingClient.php
+++ b/src/LabellingClient.php
@@ -6,7 +6,7 @@
class LabellingClient extends BaseClient
{
- /**
+ /**
* @var string The URL of the production WSDL.
*/
const PRODUCTION_WSDL = 'https://api.postnl.nl/shipment/v2_2/label/soap.wsdl';