diff --git a/DHL/Client/Web.php b/DHL/Client/Web.php deleted file mode 100644 index a5bf872..0000000 --- a/DHL/Client/Web.php +++ /dev/null @@ -1,109 +0,0 @@ -_mode = $mode; - } - - /** - * Call DHL Service - * - * @param Request $request Request to send - * - * @return string DHL XML response string - */ - public function call(Request $request) - { - if (!$ch = curl_init()) - { - throw new \Exception('could not initialize curl'); - } - - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_URL, $this->_getUrl()); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); - curl_setopt($ch, CURLOPT_PORT , 443); - curl_setopt($ch, CURLOPT_POSTFIELDS, $request->toXML()); - $result = curl_exec($ch); - - if (curl_error($ch)) - { - return false; - } - else - { - curl_close($ch); - } - - return $result; - } - - /** - * Get url associated to a specific service - * - * @return string URL for the service - */ - private function _getUrl() - { - return ('staging' == $this->_mode) ? $this->_stagingUrl : $this->_productionUrl; - } -} diff --git a/DHL/Datatype/AM/AWBInfo.php b/DHL/Datatype/AM/AWBInfo.php deleted file mode 100644 index 030774b..0000000 --- a/DHL/Datatype/AM/AWBInfo.php +++ /dev/null @@ -1,67 +0,0 @@ - array( - 'type' => 'AWBNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'Airway bill number', - 'maxLength' => '11', - ), - 'Status' => array( - 'type' => 'Status', - 'required' => false, - 'subobject' => true, - ), - 'ShipmentInfo' => array( - 'type' => 'ShipmentInfo', - 'required' => false, - 'subobject' => true, - ), - 'Pieces' => array( - 'type' => 'TrackingPieces', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AM/BarCodes.php b/DHL/Datatype/AM/BarCodes.php deleted file mode 100644 index ee50939..0000000 --- a/DHL/Datatype/AM/BarCodes.php +++ /dev/null @@ -1,51 +0,0 @@ - array( - 'type' => 'BarCode', - 'required' => false, - 'subobject' => false, - 'comment' => '', - ), - ); -} diff --git a/DHL/Datatype/AM/Billing.php b/DHL/Datatype/AM/Billing.php deleted file mode 100644 index 72dfb3a..0000000 --- a/DHL/Datatype/AM/Billing.php +++ /dev/null @@ -1,85 +0,0 @@ - array( - 'type' => 'AccountNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'DHL Account Number', - 'maxInclusive' => '9999999999', - 'minInclusive' => '100000000', - ), - 'ShippingPaymentType' => array( - 'type' => 'PaymentType', - 'required' => false, - 'subobject' => false, - 'comment' => 'payment type (S:Shipper,R:Recipient,T:Third Party,C:Credit Card)', - 'length' => '1', - 'enumeration' => 'S,R,T', - ), - 'BillingAccountNumber' => array( - 'type' => 'AccountNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'DHL Account Number', - 'maxInclusive' => '9999999999', - 'minInclusive' => '100000000', - ), - 'DutyPaymentType' => array( - 'type' => 'DutyTaxPaymentType', - 'required' => false, - 'subobject' => false, - 'comment' => 'Duty and tax charge payment type (S:Shipper, R:Recipient, T:Third Party/Other)', - 'length' => '1', - 'enumeration' => 'S,R,T', - ), - 'DutyAccountNumber' => array( - 'type' => 'AccountNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'DHL Account Number', - 'maxInclusive' => '9999999999', - 'minInclusive' => '100000000', - ), - ); -} diff --git a/DHL/Datatype/AM/Commodity.php b/DHL/Datatype/AM/Commodity.php deleted file mode 100644 index cb141ba..0000000 --- a/DHL/Datatype/AM/Commodity.php +++ /dev/null @@ -1,60 +0,0 @@ - array( - 'type' => 'CommodityCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'Commodity codes for shipment type', - 'minLength' => '1', - 'maxLength' => '20', - ), - 'CommodityName' => array( - 'type' => 'CommodityName', - 'required' => false, - 'subobject' => false, - 'comment' => 'Commodity name for shipment content', - 'maxLength' => '35', - ), - ); -} diff --git a/DHL/Datatype/AM/Condition.php b/DHL/Datatype/AM/Condition.php deleted file mode 100644 index 40bea59..0000000 --- a/DHL/Datatype/AM/Condition.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'ConditionData' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/AM/Consignee.php b/DHL/Datatype/AM/Consignee.php deleted file mode 100644 index 02aeca7..0000000 --- a/DHL/Datatype/AM/Consignee.php +++ /dev/null @@ -1,113 +0,0 @@ - array( - 'type' => 'CompanyNameValidator', - 'required' => false, - 'subobject' => false, - 'comment' => 'Name of company / business', - 'maxLength' => '35', - ), - 'AddressLine' => array( - 'type' => 'AddressLine', - 'required' => false, - 'subobject' => false, - 'comment' => 'Address Line', - 'maxLength' => '35', - ), - 'City' => array( - 'type' => 'City', - 'required' => false, - 'subobject' => false, - 'comment' => 'City name', - 'maxLength' => '35', - ), - 'Division' => array( - 'type' => 'Division', - 'required' => false, - 'subobject' => false, - 'comment' => 'Division (e.g. state, prefecture, etc.) name', - 'maxLength' => '35', - ), - 'DivisionCode' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'PostalCode' => array( - 'type' => 'PostalCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'Full postal/zip code for address', - ), - 'CountryCode' => array( - 'type' => 'CountryCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO country codes', - 'length' => '2', - ), - 'CountryName' => array( - 'type' => 'CountryName', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO country name', - 'maxLength' => '35', - ), - 'FederalTaxId' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'StateTaxId' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'Contact' => array( - 'type' => 'Contact', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AM/Customer.php b/DHL/Datatype/AM/Customer.php deleted file mode 100644 index cd1bcd7..0000000 --- a/DHL/Datatype/AM/Customer.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Name' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/AM/CustomerLogo.php b/DHL/Datatype/AM/CustomerLogo.php deleted file mode 100644 index d9bc1dc..0000000 --- a/DHL/Datatype/AM/CustomerLogo.php +++ /dev/null @@ -1,59 +0,0 @@ - array( - 'type' => 'LogoImage', - 'required' => false, - 'subobject' => false, - 'comment' => 'LogoImage', - 'maxLength' => '1048576', - ), - 'LogoImageFormat' => array( - 'type' => 'LogoImageFormat', - 'required' => false, - 'subobject' => false, - 'comment' => 'LogoImage Format', - 'enumeration' => 'PNG,GIF,JPEG,JPG', - ), - ); -} diff --git a/DHL/Datatype/AM/DCTDutiable.php b/DHL/Datatype/AM/DCTDutiable.php deleted file mode 100644 index fbe5530..0000000 --- a/DHL/Datatype/AM/DCTDutiable.php +++ /dev/null @@ -1,61 +0,0 @@ - array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'DeclaredValue' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/AM/DCTFrom.php b/DHL/Datatype/AM/DCTFrom.php deleted file mode 100644 index 223fb44..0000000 --- a/DHL/Datatype/AM/DCTFrom.php +++ /dev/null @@ -1,76 +0,0 @@ - array( - 'type' => '', - 'required' => true, - 'subobject' => false, - ), - 'Postalcode' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'City' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'Suburb' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'VatNo' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/AM/DCTTo.php b/DHL/Datatype/AM/DCTTo.php deleted file mode 100644 index 252fa7a..0000000 --- a/DHL/Datatype/AM/DCTTo.php +++ /dev/null @@ -1,76 +0,0 @@ - array( - 'type' => '', - 'required' => true, - 'subobject' => false, - ), - 'Postalcode' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'City' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'Suburb' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'VatNo' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/AM/DestinationServiceArea.php b/DHL/Datatype/AM/DestinationServiceArea.php deleted file mode 100644 index 839acfb..0000000 --- a/DHL/Datatype/AM/DestinationServiceArea.php +++ /dev/null @@ -1,71 +0,0 @@ - array( - 'type' => 'ServiceAreaCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'DHL service area code', - 'length' => '3', - ), - 'Description' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'FacilityCode' => array( - 'type' => 'FacilityCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'Destination Facility Code', - 'length' => '3', - ), - 'InboundSortCode' => array( - 'type' => 'InboundSortCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'InBound Sort Code', - 'length' => '4', - ), - ); -} diff --git a/DHL/Datatype/AM/DocImage.php b/DHL/Datatype/AM/DocImage.php deleted file mode 100644 index 1087797..0000000 --- a/DHL/Datatype/AM/DocImage.php +++ /dev/null @@ -1,67 +0,0 @@ - array( - 'type' => 'Type', - 'required' => false, - 'subobject' => false, - 'comment' => 'Image Type', - 'length' => '3', - 'enumeration' => 'HWB,INV,PNV,COO,NAF,CIN,DCL', - ), - 'Image' => array( - 'type' => 'Image', - 'required' => false, - 'subobject' => false, - 'comment' => 'Image', - ), - 'ImageFormat' => array( - 'type' => 'ImageFormat', - 'required' => false, - 'subobject' => false, - 'comment' => 'Image Format', - 'maxLength' => '5', - 'enumeration' => 'PDF,PNG,TIFF,GIF,JPEG', - ), - ); -} diff --git a/DHL/Datatype/AM/DocImages.php b/DHL/Datatype/AM/DocImages.php deleted file mode 100644 index 4106dcf..0000000 --- a/DHL/Datatype/AM/DocImages.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'type' => 'DocImage', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AM/Email.php b/DHL/Datatype/AM/Email.php deleted file mode 100644 index 5246415..0000000 --- a/DHL/Datatype/AM/Email.php +++ /dev/null @@ -1,81 +0,0 @@ - array( - 'type' => 'EmailAddress', - 'required' => false, - 'subobject' => false, - 'comment' => 'Email address containing \'@\'', - ), - 'To' => array( - 'type' => 'EmailAddress', - 'required' => false, - 'subobject' => false, - 'comment' => 'Email address containing \'@\'', - ), - 'cc' => array( - 'type' => 'EmailAddress', - 'required' => false, - 'subobject' => false, - 'comment' => 'Email address containing \'@\'', - ), - 'Subject' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'ReplyTo' => array( - 'type' => 'EmailAddress', - 'required' => false, - 'subobject' => false, - 'comment' => 'Email address containing \'@\'', - ), - 'Body' => array( - 'type' => 'EmailBody', - 'required' => false, - 'subobject' => false, - 'comment' => 'Body of an email message', - 'maxLength' => '255', - ), - ); -} diff --git a/DHL/Datatype/AM/ErrorResponse.php b/DHL/Datatype/AM/ErrorResponse.php deleted file mode 100644 index ebf3332..0000000 --- a/DHL/Datatype/AM/ErrorResponse.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'type' => 'ServiceHeader', - 'required' => false, - 'subobject' => true, - ), - 'Status' => array( - 'type' => 'Status', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AM/EventRemarks.php b/DHL/Datatype/AM/EventRemarks.php deleted file mode 100644 index a3bf702..0000000 --- a/DHL/Datatype/AM/EventRemarks.php +++ /dev/null @@ -1,57 +0,0 @@ - array( - 'type' => 'FurtherDetails', - 'required' => false, - 'subobject' => false, - 'comment' => 'FurtherDetails', - ), - 'NextSteps' => array( - 'type' => 'NextSteps', - 'required' => false, - 'subobject' => false, - 'comment' => 'NextSteps', - ), - ); -} diff --git a/DHL/Datatype/AM/ExportDeclaration.php b/DHL/Datatype/AM/ExportDeclaration.php deleted file mode 100644 index 22e481c..0000000 --- a/DHL/Datatype/AM/ExportDeclaration.php +++ /dev/null @@ -1,117 +0,0 @@ - array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'IsPartiesRelation' => array( - 'type' => 'YesNo', - 'required' => false, - 'subobject' => false, - 'comment' => 'Boolean flag', - 'length' => '1', - 'enumeration' => 'Y,N', - ), - 'ECCN' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'SignatureName' => array( - 'type' => 'SignatureName', - 'required' => false, - 'subobject' => false, - 'comment' => 'Signature name', - 'maxLength' => '35', - ), - 'SignatureTitle' => array( - 'type' => 'SignatureTitle', - 'required' => false, - 'subobject' => false, - 'comment' => 'Signature title', - 'maxLength' => '35', - ), - 'ExportReason' => array( - 'type' => 'ExportReason', - 'required' => false, - 'subobject' => false, - 'comment' => 'Export reason', - 'length' => '1', - ), - 'ExportReasonCode' => array( - 'type' => 'ExportReasonCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'Export reason code (P:Permanent, T:Temporary, R:Re-Export)', - 'length' => '1', - 'enumeration' => 'P,T,R', - ), - 'SedNumber' => array( - 'type' => 'SEDNumber', - 'required' => false, - 'subobject' => false, - 'comment' => '', - 'enumeration' => 'FTSR,XTN,SAS', - ), - 'SedNumberType' => array( - 'type' => 'SEDNumberType', - 'required' => false, - 'subobject' => false, - 'comment' => '', - 'length' => '1', - 'enumeration' => 'F,X,S', - ), - 'MxStateCode' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'ExportLineItem' => array( - 'type' => 'ExportLineItem', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AM/ExportLineItem.php b/DHL/Datatype/AM/ExportLineItem.php deleted file mode 100644 index a0d496f..0000000 --- a/DHL/Datatype/AM/ExportLineItem.php +++ /dev/null @@ -1,125 +0,0 @@ - array( - 'type' => 'LineNumber', - 'required' => false, - 'subobject' => false, - 'comment' => '', - 'minInclusive' => '1', - 'maxInclusive' => '200', - ), - 'Quantity' => array( - 'type' => 'Quantity', - 'required' => false, - 'subobject' => false, - 'comment' => 'Quantity', - 'maxInclusive' => '32000', - ), - 'QuantityUnit' => array( - 'type' => 'QuantityUnit', - 'required' => false, - 'subobject' => false, - 'comment' => 'Quantity unit of measure (tens, hundreds, thousands, etc.)', - 'maxLength' => '8', - ), - 'Description' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Value' => array( - 'type' => 'Money', - 'required' => false, - 'subobject' => false, - 'comment' => 'Monetary amount (with 2 decimal precision)', - 'minInclusive' => '0.00', - 'maxInclusive' => '9999999999.99', - ), - 'IsDomestic' => array( - 'type' => 'YesNo', - 'required' => false, - 'subobject' => false, - 'comment' => 'Boolean flag', - 'length' => '1', - 'enumeration' => 'Y,N', - ), - 'CommodityCode' => array( - 'type' => 'CommodityCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'Commodity codes for shipment type', - 'minLength' => '1', - 'maxLength' => '20', - ), - 'ScheduleB' => array( - 'type' => 'ScheduleB', - 'required' => false, - 'subobject' => false, - 'comment' => 'Schedule B numner', - 'maxLength' => '15', - ), - 'ECCN' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Weight' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'License' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'LicenseSymbol' => array( - 'type' => 'LicenseNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'Export license number', - 'maxLength' => '16', - ), - ); -} diff --git a/DHL/Datatype/AM/Fault.php b/DHL/Datatype/AM/Fault.php deleted file mode 100644 index 74ad3a4..0000000 --- a/DHL/Datatype/AM/Fault.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'type' => 'PieceFault', - 'required' => true, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AM/Label.php b/DHL/Datatype/AM/Label.php deleted file mode 100644 index 8dbd02f..0000000 --- a/DHL/Datatype/AM/Label.php +++ /dev/null @@ -1,73 +0,0 @@ - array( - 'type' => 'LabelTemplate', - 'required' => false, - 'subobject' => false, - 'comment' => 'LabelTemplate', - 'enumeration' => '8X4_A4_PDF,8X4_thermal,8X4_A4_TC_PDF,6X4_A4_PDF,6X4_thermal,8X4_CI_PDF,8X4_CI_thermal', - ), - 'Logo' => array( - 'type' => 'YesNo', - 'required' => false, - 'subobject' => false, - 'comment' => 'Boolean flag', - 'length' => '1', - 'enumeration' => 'Y,N', - ), - 'CustomerLogo' => array( - 'type' => 'CustomerLogo', - 'required' => false, - 'subobject' => true, - ), - 'Resolution' => array( - 'type' => 'Resolution', - 'required' => false, - 'subobject' => false, - 'comment' => 'Resolution', - 'minInclusive' => '200', - 'maxInclusive' => '300', - ), - ); -} diff --git a/DHL/Datatype/AM/LabelImage.php b/DHL/Datatype/AM/LabelImage.php deleted file mode 100644 index 57491de..0000000 --- a/DHL/Datatype/AM/LabelImage.php +++ /dev/null @@ -1,63 +0,0 @@ - array( - 'type' => 'OutputFormat', - 'required' => false, - 'subobject' => false, - 'comment' => 'OutputFormat', - 'enumeration' => 'PDF,PL2,ZPL2,JPG,PNG,EPL2,EPLN,ZPLN', - ), - 'OutputImage' => array( - 'type' => 'OutputImage', - 'required' => false, - 'subobject' => false, - 'comment' => 'OutputImage', - ), - 'OutputImageNPC' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/AM/Note.php b/DHL/Datatype/AM/Note.php deleted file mode 100644 index 0e4ae11..0000000 --- a/DHL/Datatype/AM/Note.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Condition' => array( - 'type' => 'Condition', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AM/OriginServiceArea.php b/DHL/Datatype/AM/OriginServiceArea.php deleted file mode 100644 index d2b2f01..0000000 --- a/DHL/Datatype/AM/OriginServiceArea.php +++ /dev/null @@ -1,64 +0,0 @@ - array( - 'type' => 'ServiceAreaCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'DHL service area code', - 'length' => '3', - ), - 'Description' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'OutboundSortCode' => array( - 'type' => 'OutboundSortCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'OutBound Sort Code', - 'length' => '4', - ), - ); -} diff --git a/DHL/Datatype/AM/Piece.php b/DHL/Datatype/AM/Piece.php deleted file mode 100644 index 7725922..0000000 --- a/DHL/Datatype/AM/Piece.php +++ /dev/null @@ -1,98 +0,0 @@ - array( - 'type' => 'PieceID', - 'required' => false, - 'subobject' => false, - 'comment' => 'Piece ID', - 'maxLength' => '35', - ), - 'PackageType' => array( - 'type' => 'PackageType', - 'required' => false, - 'subobject' => false, - 'comment' => 'Package Type (EE: DHL Express Envelope, OD:Other DHL Packaging, CP:Customer-provided.Ground shipments must choose CP)', - 'length' => '2', - 'enumeration' => 'EE,OD,CP', - ), - 'Weight' => array( - 'type' => 'Weight', - 'required' => false, - 'subobject' => false, - 'comment' => 'Weight of piece or shipment', - 'fractionDigits' => '1', - 'maxInclusive' => '999999.9', - 'totalDigits' => '7', - ), - 'DimWeight' => array( - 'type' => 'Weight', - 'required' => false, - 'subobject' => false, - 'comment' => 'Weight of piece or shipment', - 'fractionDigits' => '1', - 'maxInclusive' => '999999.9', - 'totalDigits' => '7', - ), - 'Width' => array( - 'type' => 'positiveInteger', - 'required' => false, - 'subobject' => false, - ), - 'Height' => array( - 'type' => 'positiveInteger', - 'required' => false, - 'subobject' => false, - ), - 'Depth' => array( - 'type' => 'positiveInteger', - 'required' => false, - 'subobject' => false, - ), - 'PieceContents' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/AM/PieceDetails.php b/DHL/Datatype/AM/PieceDetails.php deleted file mode 100644 index 369a0e1..0000000 --- a/DHL/Datatype/AM/PieceDetails.php +++ /dev/null @@ -1,126 +0,0 @@ - array( - 'type' => 'string', - 'required' => true, - 'subobject' => false, - ), - 'LicensePlate' => array( - 'type' => 'TrackingPieceID', - 'required' => true, - 'subobject' => false, - 'comment' => 'Piece ID', - 'minLength' => '1', - 'maxLength' => '35', - ), - 'PieceNumber' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'ActualDepth' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'ActualWidth' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'ActualHeight' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'ActualWeight' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Depth' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Width' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Height' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Weight' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'PackageType' => array( - 'type' => 'PackageType', - 'required' => false, - 'subobject' => false, - 'comment' => 'Package Type (EE: DHL Express Envelope, OD:Other DHL Packaging, CP:Customer-provided.Ground shipments must choose CP)', - 'length' => '2', - 'enumeration' => 'EE,OD,CP', - ), - 'DimWeight' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'WeightUnit' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'PieceContents' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/AM/PieceEvent.php b/DHL/Datatype/AM/PieceEvent.php deleted file mode 100644 index f43b32d..0000000 --- a/DHL/Datatype/AM/PieceEvent.php +++ /dev/null @@ -1,70 +0,0 @@ - array( - 'type' => 'date', - 'required' => false, - 'subobject' => false, - ), - 'Time' => array( - 'type' => 'time', - 'required' => false, - 'subobject' => false, - ), - 'ServiceEvent' => array( - 'type' => 'ServiceEvent', - 'required' => false, - 'subobject' => true, - ), - 'Signatory' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'ServiceArea' => array( - 'type' => 'ServiceArea', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AM/PieceFault.php b/DHL/Datatype/AM/PieceFault.php deleted file mode 100644 index 6f8e479..0000000 --- a/DHL/Datatype/AM/PieceFault.php +++ /dev/null @@ -1,63 +0,0 @@ - array( - 'type' => 'TrackingPieceID', - 'required' => true, - 'subobject' => false, - 'comment' => 'Piece ID', - 'minLength' => '1', - 'maxLength' => '35', - ), - 'ConditionCode' => array( - 'type' => 'string', - 'required' => true, - 'subobject' => false, - ), - 'ConditionData' => array( - 'type' => 'string', - 'required' => true, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/AM/PieceInfo.php b/DHL/Datatype/AM/PieceInfo.php deleted file mode 100644 index 0fbb0a7..0000000 --- a/DHL/Datatype/AM/PieceInfo.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'type' => 'PieceDetails', - 'required' => true, - 'subobject' => true, - ), - 'PieceEvent' => array( - 'type' => 'PieceEvent', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AM/PieceType.php b/DHL/Datatype/AM/PieceType.php deleted file mode 100644 index 956ccfb..0000000 --- a/DHL/Datatype/AM/PieceType.php +++ /dev/null @@ -1,81 +0,0 @@ - array( - 'type' => '', - 'required' => true, - 'subobject' => false, - ), - 'PackageTypeCode' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'Height' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'Depth' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'Width' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'Weight' => array( - 'type' => '', - 'required' => true, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/AM/Pieces.php b/DHL/Datatype/AM/Pieces.php deleted file mode 100644 index 167846e..0000000 --- a/DHL/Datatype/AM/Pieces.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'type' => 'Piece', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AM/QtdSInAdCur.php b/DHL/Datatype/AM/QtdSInAdCur.php deleted file mode 100644 index 5461b4d..0000000 --- a/DHL/Datatype/AM/QtdSInAdCur.php +++ /dev/null @@ -1,76 +0,0 @@ - array( - 'type' => 'CurrencyCode', - 'required' => true, - 'subobject' => false, - 'comment' => 'ISO currency code', - 'length' => '3', - ), - 'CurrencyRoleTypeCode' => array( - 'type' => 'CurrencyRoleTypeCode', - 'required' => true, - 'subobject' => false, - 'comment' => 'CurrencyRoleTypeCode', - 'maxLength' => '6', - 'enumeration' => 'BILLCU,PULCL,INVCU,BASEC', - ), - 'PackageCharge' => array( - 'type' => 'PackageCharge', - 'required' => true, - 'subobject' => false, - 'comment' => 'PackageCharge', - 'fractionDigits' => '3', - 'totalDigits' => '18', - ), - 'ShippingCharge' => array( - 'type' => 'ShippingCharge', - 'required' => true, - 'subobject' => false, - 'comment' => 'ShippingCharge', - 'fractionDigits' => '3', - 'totalDigits' => '18', - ), - ); -} diff --git a/DHL/Datatype/AM/QtdShpExChrgType.php b/DHL/Datatype/AM/QtdShpExChrgType.php deleted file mode 100644 index e61c7fe..0000000 --- a/DHL/Datatype/AM/QtdShpExChrgType.php +++ /dev/null @@ -1,61 +0,0 @@ - array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'LocalSpecialServiceType' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/AM/QtdShpType.php b/DHL/Datatype/AM/QtdShpType.php deleted file mode 100644 index 904d233..0000000 --- a/DHL/Datatype/AM/QtdShpType.php +++ /dev/null @@ -1,66 +0,0 @@ - array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'LocalProductCode' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'QtdShpExChrg' => array( - 'type' => 'QtdShpExChrgType', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AM/Reference.php b/DHL/Datatype/AM/Reference.php deleted file mode 100644 index 7f17196..0000000 --- a/DHL/Datatype/AM/Reference.php +++ /dev/null @@ -1,59 +0,0 @@ - array( - 'type' => 'ReferenceID', - 'required' => false, - 'subobject' => false, - 'comment' => 'Shipper reference ID', - 'maxLength' => '35', - ), - 'ReferenceType' => array( - 'type' => 'ReferenceType', - 'required' => false, - 'subobject' => false, - 'comment' => 'Shipment reference type', - 'length' => '2', - ), - ); -} diff --git a/DHL/Datatype/AM/Request.php b/DHL/Datatype/AM/Request.php deleted file mode 100644 index 6c4312a..0000000 --- a/DHL/Datatype/AM/Request.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'type' => 'ServiceHeader', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AM/Response.php b/DHL/Datatype/AM/Response.php deleted file mode 100644 index 91ee61a..0000000 --- a/DHL/Datatype/AM/Response.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'type' => 'ServiceHeader', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AM/ServiceArea.php b/DHL/Datatype/AM/ServiceArea.php deleted file mode 100644 index 8250f18..0000000 --- a/DHL/Datatype/AM/ServiceArea.php +++ /dev/null @@ -1,57 +0,0 @@ - array( - 'type' => 'ServiceAreaCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'DHL service area code', - 'length' => '3', - ), - 'Description' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/AM/ServiceEvent.php b/DHL/Datatype/AM/ServiceEvent.php deleted file mode 100644 index 74f186b..0000000 --- a/DHL/Datatype/AM/ServiceEvent.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'Description' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/AM/ServiceHeader.php b/DHL/Datatype/AM/ServiceHeader.php deleted file mode 100644 index c344176..0000000 --- a/DHL/Datatype/AM/ServiceHeader.php +++ /dev/null @@ -1,74 +0,0 @@ - array( - 'type' => 'dateTime', - 'required' => false, - 'subobject' => false, - ), - 'MessageReference' => array( - 'type' => 'MessageReference', - 'required' => false, - 'subobject' => false, - 'comment' => 'Reference to the requested Message', - 'minLength' => '28', - 'maxLength' => '32', - ), - 'SiteID' => array( - 'type' => 'SiteID', - 'required' => false, - 'subobject' => false, - 'comment' => 'Site ID used for verifying the sender', - 'minLength' => '6', - 'maxLength' => '20', - ), - 'Password' => array( - 'type' => 'Password', - 'required' => false, - 'subobject' => false, - 'comment' => 'Password used for verifying the sender', - 'minLength' => '8', - 'maxLength' => '20', - ), - ); -} diff --git a/DHL/Datatype/AM/ShipValResponsePiece.php b/DHL/Datatype/AM/ShipValResponsePiece.php deleted file mode 100644 index ddc8057..0000000 --- a/DHL/Datatype/AM/ShipValResponsePiece.php +++ /dev/null @@ -1,117 +0,0 @@ - array( - 'type' => 'PieceNumber', - 'required' => true, - 'subobject' => false, - 'comment' => 'Piece Number', - ), - 'Depth' => array( - 'type' => 'positiveInteger', - 'required' => false, - 'subobject' => false, - ), - 'Width' => array( - 'type' => 'positiveInteger', - 'required' => false, - 'subobject' => false, - ), - 'Height' => array( - 'type' => 'positiveInteger', - 'required' => false, - 'subobject' => false, - ), - 'Weight' => array( - 'type' => 'Weight', - 'required' => false, - 'subobject' => false, - 'comment' => 'Weight of piece or shipment', - 'fractionDigits' => '1', - 'maxInclusive' => '999999.9', - 'totalDigits' => '7', - ), - 'PackageType' => array( - 'type' => 'PackageType', - 'required' => false, - 'subobject' => false, - 'comment' => 'Package Type (EE: DHL Express Envelope, OD:Other DHL Packaging, CP:Customer-provided.Ground shipments must choose CP)', - 'length' => '2', - 'enumeration' => 'EE,OD,CP', - ), - 'DimWeight' => array( - 'type' => 'Weight', - 'required' => false, - 'subobject' => false, - 'comment' => 'Weight of piece or shipment', - 'fractionDigits' => '1', - 'maxInclusive' => '999999.9', - 'totalDigits' => '7', - ), - 'PieceContents' => array( - 'type' => 'PieceContents', - 'required' => false, - 'subobject' => false, - 'comment' => 'Piece contents description', - 'maxLength' => '90', - ), - 'DataIdentifier' => array( - 'type' => 'string', - 'required' => true, - 'subobject' => false, - ), - 'LicensePlate' => array( - 'type' => 'PieceID', - 'required' => true, - 'subobject' => false, - 'comment' => 'Piece ID', - 'maxLength' => '35', - ), - 'LicensePlateBarCode' => array( - 'type' => 'BarCode', - 'required' => true, - 'subobject' => false, - 'comment' => '', - ), - ); -} diff --git a/DHL/Datatype/AM/ShipValResponsePieces.php b/DHL/Datatype/AM/ShipValResponsePieces.php deleted file mode 100644 index 30fc9fb..0000000 --- a/DHL/Datatype/AM/ShipValResponsePieces.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'type' => 'ShipValResponsePiece', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AM/Shipment.php b/DHL/Datatype/AM/Shipment.php deleted file mode 100644 index 7d52572..0000000 --- a/DHL/Datatype/AM/Shipment.php +++ /dev/null @@ -1,156 +0,0 @@ - array( - 'type' => 'Weight', - 'required' => false, - 'subobject' => false, - 'comment' => 'Weight of piece or shipment', - 'fractionDigits' => '1', - 'maxInclusive' => '999999.9', - 'totalDigits' => '7', - ), - 'WeightUnit' => array( - 'type' => 'WeightUnit', - 'required' => false, - 'subobject' => false, - 'comment' => 'Unit of weight measurement (L:Pounds)', - 'length' => '1', - 'enumeration' => 'K,L', - ), - 'Pieces' => array( - 'type' => 'Pieces', - 'required' => false, - 'subobject' => true, - ), - 'DoorTo' => array( - 'type' => 'DoorTo', - 'required' => false, - 'subobject' => false, - 'comment' => 'Defines the type of delivery service that applies to the shipment', - 'length' => '2', - 'enumeration' => 'DD,DA,AA,DC', - ), - 'AirwarBillNumber' => array( - 'type' => 'AWBNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'Airway bill number', - 'maxLength' => '11', - ), - 'AccountType' => array( - 'type' => 'AccountType', - 'required' => false, - 'subobject' => false, - 'comment' => 'Account Type by method of payment ( DHL account vs. Credit card)', - 'enumeration' => 'D', - ), - 'ProductType' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'GlobalProductType' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'LocalProductType' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Commodity' => array( - 'type' => 'Commodity', - 'required' => false, - 'subobject' => true, - ), - 'DeclaredValue' => array( - 'type' => 'Money', - 'required' => false, - 'subobject' => false, - 'comment' => 'Monetary amount (with 2 decimal precision)', - 'minInclusive' => '0.00', - 'maxInclusive' => '9999999999.99', - ), - 'DeclaredCurrency' => array( - 'type' => 'CurrencyCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO currency code', - 'length' => '3', - ), - 'InsuredValue' => array( - 'type' => 'Money', - 'required' => false, - 'subobject' => false, - 'comment' => 'Monetary amount (with 2 decimal precision)', - 'minInclusive' => '0.00', - 'maxInclusive' => '9999999999.99', - ), - 'InsuredCurrency' => array( - 'type' => 'CurrencyCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO currency code', - 'length' => '3', - ), - 'DimensionalUnit' => array( - 'type' => 'WeightUnit', - 'required' => false, - 'subobject' => false, - 'comment' => 'Unit of weight measurement (L:Pounds)', - 'length' => '1', - 'enumeration' => 'K,L', - ), - 'DimensionalWeight' => array( - 'type' => 'Weight', - 'required' => false, - 'subobject' => false, - 'comment' => 'Weight of piece or shipment', - 'fractionDigits' => '1', - 'maxInclusive' => '999999.9', - 'totalDigits' => '7', - ), - ); -} diff --git a/DHL/Datatype/AM/ShipmentDate.php b/DHL/Datatype/AM/ShipmentDate.php deleted file mode 100644 index b8b60e7..0000000 --- a/DHL/Datatype/AM/ShipmentDate.php +++ /dev/null @@ -1,57 +0,0 @@ - array( - 'type' => 'Date', - 'required' => false, - 'subobject' => false, - 'comment' => 'Date only', - ), - 'ShipmentDateTo' => array( - 'type' => 'Date', - 'required' => false, - 'subobject' => false, - 'comment' => 'Date only', - ), - ); -} diff --git a/DHL/Datatype/AM/ShipmentEvent.php b/DHL/Datatype/AM/ShipmentEvent.php deleted file mode 100644 index 11b122b..0000000 --- a/DHL/Datatype/AM/ShipmentEvent.php +++ /dev/null @@ -1,75 +0,0 @@ - array( - 'type' => 'date', - 'required' => false, - 'subobject' => false, - ), - 'Time' => array( - 'type' => 'time', - 'required' => false, - 'subobject' => false, - ), - 'ServiceEvent' => array( - 'type' => 'ServiceEvent', - 'required' => false, - 'subobject' => true, - ), - 'Signatory' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'EventRemarks' => array( - 'type' => 'EventRemarks', - 'required' => false, - 'subobject' => true, - ), - 'ServiceArea' => array( - 'type' => 'ServiceArea', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AM/ShipmentInfo.php b/DHL/Datatype/AM/ShipmentInfo.php deleted file mode 100644 index 80ad9fa..0000000 --- a/DHL/Datatype/AM/ShipmentInfo.php +++ /dev/null @@ -1,135 +0,0 @@ - array( - 'type' => 'OriginServiceArea', - 'required' => false, - 'subobject' => true, - ), - 'DestinationServiceArea' => array( - 'type' => 'DestinationServiceArea', - 'required' => false, - 'subobject' => true, - ), - 'ShipperName' => array( - 'type' => 'PersonName', - 'required' => false, - 'subobject' => false, - 'comment' => 'Name', - 'maxLength' => '35', - ), - 'ShipperAccountNumber' => array( - 'type' => 'AccountNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'DHL Account Number', - 'maxInclusive' => '9999999999', - 'minInclusive' => '100000000', - ), - 'ConsigneeName' => array( - 'type' => 'PersonName', - 'required' => false, - 'subobject' => false, - 'comment' => 'Name', - 'maxLength' => '35', - ), - 'ShipmentDate' => array( - 'type' => 'dateTime', - 'required' => false, - 'subobject' => true, - ), - 'Pieces' => array( - 'type' => '', - 'required' => false, - 'subobject' => true, - ), - 'Weight' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'WeightUnit' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'EstDlvyDate' => array( - 'type' => 'dateTime', - 'required' => false, - 'subobject' => false, - ), - 'EstDlvyDateUTC' => array( - 'type' => 'dateTime', - 'required' => false, - 'subobject' => false, - ), - 'GlobalProductCode' => array( - 'type' => 'GlobalProductCode', - 'required' => false, - 'subobject' => false, - 'comment' => '', - 'minLength' => '1', - 'maxLength' => '4', - ), - 'ShipmentDesc' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'DlvyNotificationFlag' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'Shipper' => array( - 'type' => 'Shipper', - 'required' => false, - 'subobject' => true, - ), - 'Consignee' => array( - 'type' => 'Consignee', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AM/Status.php b/DHL/Datatype/AM/Status.php deleted file mode 100644 index 7335887..0000000 --- a/DHL/Datatype/AM/Status.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Condition' => array( - 'type' => 'Condition', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AM/TrackingPieces.php b/DHL/Datatype/AM/TrackingPieces.php deleted file mode 100644 index 26d1257..0000000 --- a/DHL/Datatype/AM/TrackingPieces.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'type' => 'PieceInfo', - 'required' => true, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AM/WeightSeg.php b/DHL/Datatype/AM/WeightSeg.php deleted file mode 100644 index b29cff2..0000000 --- a/DHL/Datatype/AM/WeightSeg.php +++ /dev/null @@ -1,62 +0,0 @@ - array( - 'type' => 'Weight', - 'required' => false, - 'subobject' => false, - 'comment' => 'Weight of piece or shipment', - 'fractionDigits' => '1', - 'maxInclusive' => '999999.9', - 'totalDigits' => '7', - ), - 'WeightUnit' => array( - 'type' => 'WeightUnit', - 'required' => false, - 'subobject' => false, - 'comment' => 'Unit of weight measurement (L:Pounds)', - 'length' => '1', - 'enumeration' => 'K,L', - ), - ); -} diff --git a/DHL/Datatype/AP/AWBInfo.php b/DHL/Datatype/AP/AWBInfo.php deleted file mode 100644 index 3c62127..0000000 --- a/DHL/Datatype/AP/AWBInfo.php +++ /dev/null @@ -1,67 +0,0 @@ - array( - 'type' => 'AWBNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'Airway bill number', - 'maxLength' => '11', - ), - 'Status' => array( - 'type' => 'Status', - 'required' => false, - 'subobject' => true, - ), - 'ShipmentInfo' => array( - 'type' => 'ShipmentInfo', - 'required' => false, - 'subobject' => true, - ), - 'Pieces' => array( - 'type' => 'TrackingPieces', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AP/BarCodes.php b/DHL/Datatype/AP/BarCodes.php deleted file mode 100644 index 9c158c9..0000000 --- a/DHL/Datatype/AP/BarCodes.php +++ /dev/null @@ -1,51 +0,0 @@ - array( - 'type' => 'BarCode', - 'required' => false, - 'subobject' => false, - 'comment' => '', - ), - ); -} diff --git a/DHL/Datatype/AP/Billing.php b/DHL/Datatype/AP/Billing.php deleted file mode 100644 index 80d055d..0000000 --- a/DHL/Datatype/AP/Billing.php +++ /dev/null @@ -1,85 +0,0 @@ - array( - 'type' => 'AccountNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'DHL Account Number', - 'maxInclusive' => '9999999999', - 'minInclusive' => '100000000', - ), - 'ShippingPaymentType' => array( - 'type' => 'PaymentType', - 'required' => false, - 'subobject' => false, - 'comment' => 'payment type (S:Shipper,R:Recipient,T:Third Party,C:Credit Card)', - 'length' => '1', - 'enumeration' => 'S,R,T', - ), - 'BillingAccountNumber' => array( - 'type' => 'AccountNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'DHL Account Number', - 'maxInclusive' => '9999999999', - 'minInclusive' => '100000000', - ), - 'DutyPaymentType' => array( - 'type' => 'DutyTaxPaymentType', - 'required' => false, - 'subobject' => false, - 'comment' => 'Duty and tax charge payment type (S:Shipper, R:Recipient, T:Third Party/Other)', - 'length' => '1', - 'enumeration' => 'S,R,T', - ), - 'DutyAccountNumber' => array( - 'type' => 'AccountNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'DHL Account Number', - 'maxInclusive' => '9999999999', - 'minInclusive' => '100000000', - ), - ); -} diff --git a/DHL/Datatype/AP/ChargeCard.php b/DHL/Datatype/AP/ChargeCard.php deleted file mode 100644 index 6948c76..0000000 --- a/DHL/Datatype/AP/ChargeCard.php +++ /dev/null @@ -1,76 +0,0 @@ - array( - 'type' => 'ChargeCardNo', - 'required' => false, - 'subobject' => false, - 'comment' => 'Charge card number', - 'minInclusive' => '1000000000000', - 'maxInclusive' => '9999999999999999', - 'pattern' => '\d{13,16}', - ), - 'ChargeCardType' => array( - 'type' => 'ChargeCardType', - 'required' => false, - 'subobject' => false, - 'comment' => 'Charge card issuer type', - 'length' => '2', - 'enumeration' => 'AM,DC,DI,MC,VI', - ), - 'ChargeCardConfNo' => array( - 'type' => 'ChargeCardConfNo', - 'required' => false, - 'subobject' => false, - 'comment' => 'Charge card approval number', - 'pattern' => '\d{0,6}', - ), - 'ChargeCardExpiryDate' => array( - 'type' => 'ChargeCardExpDateValidator', - 'required' => false, - 'subobject' => false, - 'comment' => 'Charge card expiration date', - 'pattern' => '(0[1-9]|1[0-2])\d{1}[0-9]', - ), - ); -} diff --git a/DHL/Datatype/AP/Commodity.php b/DHL/Datatype/AP/Commodity.php deleted file mode 100644 index 96970b5..0000000 --- a/DHL/Datatype/AP/Commodity.php +++ /dev/null @@ -1,60 +0,0 @@ - array( - 'type' => 'CommodityCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'Commodity codes for shipment type', - 'minLength' => '1', - 'maxLength' => '20', - ), - 'CommodityName' => array( - 'type' => 'CommodityName', - 'required' => false, - 'subobject' => false, - 'comment' => 'Commodity name for shipment content', - 'maxLength' => '35', - ), - ); -} diff --git a/DHL/Datatype/AP/Condition.php b/DHL/Datatype/AP/Condition.php deleted file mode 100644 index 6537ced..0000000 --- a/DHL/Datatype/AP/Condition.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'ConditionData' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/AP/Contact.php b/DHL/Datatype/AP/Contact.php deleted file mode 100644 index 021723d..0000000 --- a/DHL/Datatype/AP/Contact.php +++ /dev/null @@ -1,83 +0,0 @@ - array( - 'type' => 'PersonName', - 'required' => false, - 'subobject' => false, - 'comment' => 'Name', - 'maxLength' => '35', - ), - 'PhoneNumber' => array( - 'type' => 'PhoneNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'Phone Number', - ), - 'PhoneExtension' => array( - 'type' => 'PhoneExtension', - 'required' => false, - 'subobject' => false, - 'comment' => '', - 'maxLength' => '5', - ), - 'FaxNumber' => array( - 'type' => 'PhoneNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'Phone Number', - ), - 'Telex' => array( - 'type' => 'Telex', - 'required' => false, - 'subobject' => false, - 'comment' => 'Telex number and answer back code', - 'maxLength' => '25', - ), - 'Email' => array( - 'type' => 'Email', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AP/Customer.php b/DHL/Datatype/AP/Customer.php deleted file mode 100644 index 0276e4a..0000000 --- a/DHL/Datatype/AP/Customer.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Name' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/AP/CustomerLogo.php b/DHL/Datatype/AP/CustomerLogo.php deleted file mode 100644 index 6591d48..0000000 --- a/DHL/Datatype/AP/CustomerLogo.php +++ /dev/null @@ -1,59 +0,0 @@ - array( - 'type' => 'LogoImage', - 'required' => false, - 'subobject' => false, - 'comment' => 'LogoImage', - 'maxLength' => '1048576', - ), - 'LogoImageFormat' => array( - 'type' => 'LogoImageFormat', - 'required' => false, - 'subobject' => false, - 'comment' => 'LogoImage Format', - 'enumeration' => 'PNG,GIF,JPEG,JPG', - ), - ); -} diff --git a/DHL/Datatype/AP/DestinationServiceArea.php b/DHL/Datatype/AP/DestinationServiceArea.php deleted file mode 100644 index 867ade2..0000000 --- a/DHL/Datatype/AP/DestinationServiceArea.php +++ /dev/null @@ -1,71 +0,0 @@ - array( - 'type' => 'ServiceAreaCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'DHL service area code', - 'length' => '3', - ), - 'Description' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'FacilityCode' => array( - 'type' => 'FacilityCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'Destination Facility Code', - 'length' => '3', - ), - 'InboundSortCode' => array( - 'type' => 'InboundSortCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'InBound Sort Code', - 'length' => '4', - ), - ); -} diff --git a/DHL/Datatype/AP/DocImage.php b/DHL/Datatype/AP/DocImage.php deleted file mode 100644 index 95377d6..0000000 --- a/DHL/Datatype/AP/DocImage.php +++ /dev/null @@ -1,67 +0,0 @@ - array( - 'type' => 'Type', - 'required' => false, - 'subobject' => false, - 'comment' => 'Image Type', - 'length' => '3', - 'enumeration' => 'HWB,INV,PNV,COO,NAF,CIN,DCL', - ), - 'Image' => array( - 'type' => 'Image', - 'required' => false, - 'subobject' => false, - 'comment' => 'Image', - ), - 'ImageFormat' => array( - 'type' => 'ImageFormat', - 'required' => false, - 'subobject' => false, - 'comment' => 'Image Format', - 'maxLength' => '5', - 'enumeration' => 'PDF,PNG,TIFF,GIF,JPEG', - ), - ); -} diff --git a/DHL/Datatype/AP/DocImages.php b/DHL/Datatype/AP/DocImages.php deleted file mode 100644 index 9c766e2..0000000 --- a/DHL/Datatype/AP/DocImages.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'type' => 'DocImage', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AP/Dutiable.php b/DHL/Datatype/AP/Dutiable.php deleted file mode 100644 index e508daf..0000000 --- a/DHL/Datatype/AP/Dutiable.php +++ /dev/null @@ -1,102 +0,0 @@ - array( - 'type' => 'Money', - 'required' => false, - 'subobject' => false, - 'comment' => 'Monetary amount (with 2 decimal precision)', - 'minInclusive' => '0.00', - 'maxInclusive' => '9999999999.99', - ), - 'DeclaredCurrency' => array( - 'type' => 'CurrencyCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO currency code', - 'length' => '3', - ), - 'ScheduleB' => array( - 'type' => 'ScheduleB', - 'required' => false, - 'subobject' => false, - 'comment' => 'Schedule B numner', - 'maxLength' => '15', - ), - 'ExportLicense' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'ShipperEIN' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'ShipperIDType' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'ConsigneeIDType' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'ImportLicense' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'ConsigneeEIN' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'TermsOfTrade' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/AP/Email.php b/DHL/Datatype/AP/Email.php deleted file mode 100644 index 3625a9c..0000000 --- a/DHL/Datatype/AP/Email.php +++ /dev/null @@ -1,81 +0,0 @@ - array( - 'type' => 'EmailAddress', - 'required' => false, - 'subobject' => false, - 'comment' => 'Email address containing \'@\'', - ), - 'To' => array( - 'type' => 'EmailAddress', - 'required' => false, - 'subobject' => false, - 'comment' => 'Email address containing \'@\'', - ), - 'cc' => array( - 'type' => 'EmailAddress', - 'required' => false, - 'subobject' => false, - 'comment' => 'Email address containing \'@\'', - ), - 'Subject' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'ReplyTo' => array( - 'type' => 'EmailAddress', - 'required' => false, - 'subobject' => false, - 'comment' => 'Email address containing \'@\'', - ), - 'Body' => array( - 'type' => 'EmailBody', - 'required' => false, - 'subobject' => false, - 'comment' => 'Body of an email message', - 'maxLength' => '255', - ), - ); -} diff --git a/DHL/Datatype/AP/ErrorResponse.php b/DHL/Datatype/AP/ErrorResponse.php deleted file mode 100644 index e4ff289..0000000 --- a/DHL/Datatype/AP/ErrorResponse.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'type' => 'ServiceHeader', - 'required' => false, - 'subobject' => true, - ), - 'Status' => array( - 'type' => 'Status', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AP/EventRemarks.php b/DHL/Datatype/AP/EventRemarks.php deleted file mode 100644 index 8542c4a..0000000 --- a/DHL/Datatype/AP/EventRemarks.php +++ /dev/null @@ -1,57 +0,0 @@ - array( - 'type' => 'FurtherDetails', - 'required' => false, - 'subobject' => false, - 'comment' => 'FurtherDetails', - ), - 'NextSteps' => array( - 'type' => 'NextSteps', - 'required' => false, - 'subobject' => false, - 'comment' => 'NextSteps', - ), - ); -} diff --git a/DHL/Datatype/AP/ExportDeclaration.php b/DHL/Datatype/AP/ExportDeclaration.php deleted file mode 100644 index 1d8fbe9..0000000 --- a/DHL/Datatype/AP/ExportDeclaration.php +++ /dev/null @@ -1,117 +0,0 @@ - array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'IsPartiesRelation' => array( - 'type' => 'YesNo', - 'required' => false, - 'subobject' => false, - 'comment' => 'Boolean flag', - 'length' => '1', - 'enumeration' => 'Y,N', - ), - 'ECCN' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'SignatureName' => array( - 'type' => 'SignatureName', - 'required' => false, - 'subobject' => false, - 'comment' => 'Signature name', - 'maxLength' => '35', - ), - 'SignatureTitle' => array( - 'type' => 'SignatureTitle', - 'required' => false, - 'subobject' => false, - 'comment' => 'Signature title', - 'maxLength' => '35', - ), - 'ExportReason' => array( - 'type' => 'ExportReason', - 'required' => false, - 'subobject' => false, - 'comment' => 'Export reason', - 'length' => '1', - ), - 'ExportReasonCode' => array( - 'type' => 'ExportReasonCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'Export reason code (P:Permanent, T:Temporary, R:Re-Export)', - 'length' => '1', - 'enumeration' => 'P,T,R', - ), - 'SedNumber' => array( - 'type' => 'SEDNumber', - 'required' => false, - 'subobject' => false, - 'comment' => '', - 'enumeration' => 'FTSR,XTN,SAS', - ), - 'SedNumberType' => array( - 'type' => 'SEDNumberType', - 'required' => false, - 'subobject' => false, - 'comment' => '', - 'length' => '1', - 'enumeration' => 'F,X,S', - ), - 'MxStateCode' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'ExportLineItem' => array( - 'type' => 'ExportLineItem', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AP/Fault.php b/DHL/Datatype/AP/Fault.php deleted file mode 100644 index ad97cb4..0000000 --- a/DHL/Datatype/AP/Fault.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'type' => 'PieceFault', - 'required' => true, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AP/Label.php b/DHL/Datatype/AP/Label.php deleted file mode 100644 index b7e8b31..0000000 --- a/DHL/Datatype/AP/Label.php +++ /dev/null @@ -1,73 +0,0 @@ - array( - 'type' => 'LabelTemplate', - 'required' => false, - 'subobject' => false, - 'comment' => 'LabelTemplate', - 'enumeration' => '8X4_A4_PDF,8X4_thermal,8X4_A4_TC_PDF,6X4_A4_PDF,6X4_thermal,8X4_CI_PDF,8X4_CI_thermal', - ), - 'Logo' => array( - 'type' => 'YesNo', - 'required' => false, - 'subobject' => false, - 'comment' => 'Boolean flag', - 'length' => '1', - 'enumeration' => 'Y,N', - ), - 'CustomerLogo' => array( - 'type' => 'CustomerLogo', - 'required' => false, - 'subobject' => true, - ), - 'Resolution' => array( - 'type' => 'Resolution', - 'required' => false, - 'subobject' => false, - 'comment' => 'Resolution', - 'minInclusive' => '200', - 'maxInclusive' => '300', - ), - ); -} diff --git a/DHL/Datatype/AP/LabelImage.php b/DHL/Datatype/AP/LabelImage.php deleted file mode 100644 index 1a70cb1..0000000 --- a/DHL/Datatype/AP/LabelImage.php +++ /dev/null @@ -1,63 +0,0 @@ - array( - 'type' => 'OutputFormat', - 'required' => false, - 'subobject' => false, - 'comment' => 'OutputFormat', - 'enumeration' => 'PDF,PL2,ZPL2,JPG,PNG,EPL2,EPLN,ZPLN', - ), - 'OutputImage' => array( - 'type' => 'OutputImage', - 'required' => false, - 'subobject' => false, - 'comment' => 'OutputImage', - ), - 'OutputImageNPC' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/AP/Note.php b/DHL/Datatype/AP/Note.php deleted file mode 100644 index d25f715..0000000 --- a/DHL/Datatype/AP/Note.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Condition' => array( - 'type' => 'Condition', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AP/OriginServiceArea.php b/DHL/Datatype/AP/OriginServiceArea.php deleted file mode 100644 index dbc3310..0000000 --- a/DHL/Datatype/AP/OriginServiceArea.php +++ /dev/null @@ -1,64 +0,0 @@ - array( - 'type' => 'ServiceAreaCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'DHL service area code', - 'length' => '3', - ), - 'Description' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'OutboundSortCode' => array( - 'type' => 'OutboundSortCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'OutBound Sort Code', - 'length' => '4', - ), - ); -} diff --git a/DHL/Datatype/AP/PieceDetails.php b/DHL/Datatype/AP/PieceDetails.php deleted file mode 100644 index ff18b0e..0000000 --- a/DHL/Datatype/AP/PieceDetails.php +++ /dev/null @@ -1,126 +0,0 @@ - array( - 'type' => 'string', - 'required' => true, - 'subobject' => false, - ), - 'LicensePlate' => array( - 'type' => 'TrackingPieceID', - 'required' => true, - 'subobject' => false, - 'comment' => 'Piece ID', - 'minLength' => '1', - 'maxLength' => '35', - ), - 'PieceNumber' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'ActualDepth' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'ActualWidth' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'ActualHeight' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'ActualWeight' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Depth' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Width' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Height' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Weight' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'PackageType' => array( - 'type' => 'PackageType', - 'required' => false, - 'subobject' => false, - 'comment' => 'Package Type (EE: DHL Express Envelope, OD:Other DHL Packaging, CP:Customer-provided.Ground shipments must choose CP)', - 'length' => '2', - 'enumeration' => 'EE,OD,CP', - ), - 'DimWeight' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'WeightUnit' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'PieceContents' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/AP/PieceEvent.php b/DHL/Datatype/AP/PieceEvent.php deleted file mode 100644 index 4873811..0000000 --- a/DHL/Datatype/AP/PieceEvent.php +++ /dev/null @@ -1,70 +0,0 @@ - array( - 'type' => 'date', - 'required' => false, - 'subobject' => false, - ), - 'Time' => array( - 'type' => 'time', - 'required' => false, - 'subobject' => false, - ), - 'ServiceEvent' => array( - 'type' => 'ServiceEvent', - 'required' => false, - 'subobject' => true, - ), - 'Signatory' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'ServiceArea' => array( - 'type' => 'ServiceArea', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AP/PieceFault.php b/DHL/Datatype/AP/PieceFault.php deleted file mode 100644 index 027484f..0000000 --- a/DHL/Datatype/AP/PieceFault.php +++ /dev/null @@ -1,63 +0,0 @@ - array( - 'type' => 'TrackingPieceID', - 'required' => true, - 'subobject' => false, - 'comment' => 'Piece ID', - 'minLength' => '1', - 'maxLength' => '35', - ), - 'ConditionCode' => array( - 'type' => 'string', - 'required' => true, - 'subobject' => false, - ), - 'ConditionData' => array( - 'type' => 'string', - 'required' => true, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/AP/PieceInfo.php b/DHL/Datatype/AP/PieceInfo.php deleted file mode 100644 index 7103730..0000000 --- a/DHL/Datatype/AP/PieceInfo.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'type' => 'PieceDetails', - 'required' => true, - 'subobject' => true, - ), - 'PieceEvent' => array( - 'type' => 'PieceEvent', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AP/Pieces.php b/DHL/Datatype/AP/Pieces.php deleted file mode 100644 index 92320a8..0000000 --- a/DHL/Datatype/AP/Pieces.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'type' => 'Piece', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AP/Place.php b/DHL/Datatype/AP/Place.php deleted file mode 100644 index d54feea..0000000 --- a/DHL/Datatype/AP/Place.php +++ /dev/null @@ -1,102 +0,0 @@ - array( - 'type' => 'ResidenceOrBusiness', - 'required' => false, - 'subobject' => false, - 'comment' => 'Identifies if a location is a business, residence, or both (B:Business, R:Residence, C:Business Residence)', - 'length' => '1', - 'enumeration' => 'B,R,C', - ), - 'CompanyName' => array( - 'type' => 'CompanyNameValidator', - 'required' => false, - 'subobject' => false, - 'comment' => 'Name of company / business', - 'maxLength' => '35', - ), - 'AddressLine' => array( - 'type' => 'AddressLine', - 'required' => false, - 'subobject' => false, - 'comment' => 'Address Line', - 'maxLength' => '35', - ), - 'City' => array( - 'type' => 'City', - 'required' => false, - 'subobject' => false, - 'comment' => 'City name', - 'maxLength' => '35', - ), - 'CountryCode' => array( - 'type' => 'CountryCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO country codes', - 'length' => '2', - ), - 'DivisionCode' => array( - 'type' => 'StateCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'Division (state) code.', - 'maxLength' => '2', - 'minLength' => '2', - ), - 'Division' => array( - 'type' => 'State', - 'required' => false, - 'subobject' => false, - 'comment' => 'State', - 'maxLength' => '35', - ), - 'PostalCode' => array( - 'type' => 'PostalCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'Full postal/zip code for address', - ), - ); -} diff --git a/DHL/Datatype/AP/QtdSInAdCur.php b/DHL/Datatype/AP/QtdSInAdCur.php deleted file mode 100644 index 5966a21..0000000 --- a/DHL/Datatype/AP/QtdSInAdCur.php +++ /dev/null @@ -1,76 +0,0 @@ - array( - 'type' => 'CurrencyCode', - 'required' => true, - 'subobject' => false, - 'comment' => 'ISO currency code', - 'length' => '3', - ), - 'CurrencyRoleTypeCode' => array( - 'type' => 'CurrencyRoleTypeCode', - 'required' => true, - 'subobject' => false, - 'comment' => 'CurrencyRoleTypeCode', - 'maxLength' => '6', - 'enumeration' => 'BILLCU,PULCL,INVCU,BASEC', - ), - 'PackageCharge' => array( - 'type' => 'PackageCharge', - 'required' => true, - 'subobject' => false, - 'comment' => 'PackageCharge', - 'fractionDigits' => '3', - 'totalDigits' => '18', - ), - 'ShippingCharge' => array( - 'type' => 'ShippingCharge', - 'required' => true, - 'subobject' => false, - 'comment' => 'ShippingCharge', - 'fractionDigits' => '3', - 'totalDigits' => '18', - ), - ); -} diff --git a/DHL/Datatype/AP/Reference.php b/DHL/Datatype/AP/Reference.php deleted file mode 100644 index 6110be2..0000000 --- a/DHL/Datatype/AP/Reference.php +++ /dev/null @@ -1,59 +0,0 @@ - array( - 'type' => 'ReferenceID', - 'required' => false, - 'subobject' => false, - 'comment' => 'Shipper reference ID', - 'maxLength' => '35', - ), - 'ReferenceType' => array( - 'type' => 'ReferenceType', - 'required' => false, - 'subobject' => false, - 'comment' => 'Shipment reference type', - 'length' => '2', - ), - ); -} diff --git a/DHL/Datatype/AP/Request.php b/DHL/Datatype/AP/Request.php deleted file mode 100644 index c26712f..0000000 --- a/DHL/Datatype/AP/Request.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'type' => 'ServiceHeader', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AP/Response.php b/DHL/Datatype/AP/Response.php deleted file mode 100644 index d22ca28..0000000 --- a/DHL/Datatype/AP/Response.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'type' => 'ServiceHeader', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AP/ServiceArea.php b/DHL/Datatype/AP/ServiceArea.php deleted file mode 100644 index 88d2e44..0000000 --- a/DHL/Datatype/AP/ServiceArea.php +++ /dev/null @@ -1,57 +0,0 @@ - array( - 'type' => 'ServiceAreaCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'DHL service area code', - 'length' => '3', - ), - 'Description' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/AP/ServiceEvent.php b/DHL/Datatype/AP/ServiceEvent.php deleted file mode 100644 index 9c4280b..0000000 --- a/DHL/Datatype/AP/ServiceEvent.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'Description' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/AP/ServiceHeader.php b/DHL/Datatype/AP/ServiceHeader.php deleted file mode 100644 index 8a16b3d..0000000 --- a/DHL/Datatype/AP/ServiceHeader.php +++ /dev/null @@ -1,74 +0,0 @@ - array( - 'type' => 'dateTime', - 'required' => false, - 'subobject' => false, - ), - 'MessageReference' => array( - 'type' => 'MessageReference', - 'required' => false, - 'subobject' => false, - 'comment' => 'Reference to the requested Message', - 'minLength' => '28', - 'maxLength' => '32', - ), - 'SiteID' => array( - 'type' => 'SiteID', - 'required' => false, - 'subobject' => false, - 'comment' => 'Site ID used for verifying the sender', - 'minLength' => '6', - 'maxLength' => '20', - ), - 'Password' => array( - 'type' => 'Password', - 'required' => false, - 'subobject' => false, - 'comment' => 'Password used for verifying the sender', - 'minLength' => '8', - 'maxLength' => '20', - ), - ); -} diff --git a/DHL/Datatype/AP/ShipValResponsePieces.php b/DHL/Datatype/AP/ShipValResponsePieces.php deleted file mode 100644 index 464884a..0000000 --- a/DHL/Datatype/AP/ShipValResponsePieces.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'type' => 'ShipValResponsePiece', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AP/ShipmentDate.php b/DHL/Datatype/AP/ShipmentDate.php deleted file mode 100644 index 9962fe9..0000000 --- a/DHL/Datatype/AP/ShipmentDate.php +++ /dev/null @@ -1,57 +0,0 @@ - array( - 'type' => 'Date', - 'required' => false, - 'subobject' => false, - 'comment' => 'Date only', - ), - 'ShipmentDateTo' => array( - 'type' => 'Date', - 'required' => false, - 'subobject' => false, - 'comment' => 'Date only', - ), - ); -} diff --git a/DHL/Datatype/AP/ShipmentEvent.php b/DHL/Datatype/AP/ShipmentEvent.php deleted file mode 100644 index 30c325c..0000000 --- a/DHL/Datatype/AP/ShipmentEvent.php +++ /dev/null @@ -1,75 +0,0 @@ - array( - 'type' => 'date', - 'required' => false, - 'subobject' => false, - ), - 'Time' => array( - 'type' => 'time', - 'required' => false, - 'subobject' => false, - ), - 'ServiceEvent' => array( - 'type' => 'ServiceEvent', - 'required' => false, - 'subobject' => true, - ), - 'Signatory' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'EventRemarks' => array( - 'type' => 'EventRemarks', - 'required' => false, - 'subobject' => true, - ), - 'ServiceArea' => array( - 'type' => 'ServiceArea', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AP/Shipper.php b/DHL/Datatype/AP/Shipper.php deleted file mode 100644 index d5325ae..0000000 --- a/DHL/Datatype/AP/Shipper.php +++ /dev/null @@ -1,142 +0,0 @@ - array( - 'type' => 'ShipperID', - 'required' => false, - 'subobject' => false, - 'comment' => 'Shipper\'s ID', - 'maxLength' => '30', - ), - 'CompanyName' => array( - 'type' => 'CompanyNameValidator', - 'required' => false, - 'subobject' => false, - 'comment' => 'Name of company / business', - 'maxLength' => '35', - ), - 'RegisteredAccount' => array( - 'type' => 'AccountNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'DHL Account Number', - 'maxInclusive' => '9999999999', - 'minInclusive' => '100000000', - ), - 'AddressLine' => array( - 'type' => 'AddressLine', - 'required' => false, - 'subobject' => false, - 'comment' => 'Address Line', - 'maxLength' => '35', - ), - 'City' => array( - 'type' => 'City', - 'required' => false, - 'subobject' => false, - 'comment' => 'City name', - 'maxLength' => '35', - ), - 'Division' => array( - 'type' => 'Division', - 'required' => false, - 'subobject' => false, - 'comment' => 'Division (e.g. state, prefecture, etc.) name', - 'maxLength' => '35', - ), - 'DivisionCode' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'PostalCode' => array( - 'type' => 'PostalCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'Full postal/zip code for address', - ), - 'OriginServiceAreaCode' => array( - 'type' => 'OriginServiceAreaCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'OriginServiceAreaCode', - 'maxLength' => '3', - ), - 'OriginFacilityCode' => array( - 'type' => 'OriginFacilityCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'OriginFacilityCode', - 'maxLength' => '3', - ), - 'CountryCode' => array( - 'type' => 'CountryCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO country codes', - 'length' => '2', - ), - 'CountryName' => array( - 'type' => 'CountryName', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO country name', - 'maxLength' => '35', - ), - 'FederalTaxId' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'StateTaxId' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'Contact' => array( - 'type' => 'Contact', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AP/SpecialService.php b/DHL/Datatype/AP/SpecialService.php deleted file mode 100644 index 85c30f4..0000000 --- a/DHL/Datatype/AP/SpecialService.php +++ /dev/null @@ -1,97 +0,0 @@ - array( - 'type' => 'SpecialServiceType', - 'required' => false, - 'subobject' => false, - 'comment' => 'Special Service codes', - 'maxLength' => '3', - ), - 'CommunicationAddress' => array( - 'type' => 'CommunicationAddress', - 'required' => false, - 'subobject' => false, - 'comment' => 'Communications line number: phone number, fax number', - 'maxLength' => '50', - ), - 'CommunicationType' => array( - 'type' => 'CommunicationType', - 'required' => false, - 'subobject' => false, - 'comment' => 'Communications line type (P: phone, F: fax)', - 'length' => '1', - 'enumeration' => 'P,F', - ), - 'SpecialServiceDesc' => array( - 'type' => 'SpecialServiceDesc', - 'required' => false, - 'subobject' => false, - 'comment' => 'Special Service Description', - 'maxLength' => '45', - ), - 'ChargeValue' => array( - 'type' => 'Money', - 'required' => false, - 'subobject' => false, - 'comment' => 'Monetary amount (with 2 decimal precision)', - 'minInclusive' => '0.00', - 'maxInclusive' => '9999999999.99', - ), - 'CurrencyCode' => array( - 'type' => 'CurrencyCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO currency code', - 'length' => '3', - ), - 'IsWaived' => array( - 'type' => 'YesNo', - 'required' => false, - 'subobject' => false, - 'comment' => 'Boolean flag', - 'length' => '1', - 'enumeration' => 'Y,N', - ), - ); -} diff --git a/DHL/Datatype/AP/Status.php b/DHL/Datatype/AP/Status.php deleted file mode 100644 index 27e7b8c..0000000 --- a/DHL/Datatype/AP/Status.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Condition' => array( - 'type' => 'Condition', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AP/TrackingPieces.php b/DHL/Datatype/AP/TrackingPieces.php deleted file mode 100644 index 67c0d85..0000000 --- a/DHL/Datatype/AP/TrackingPieces.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'type' => 'PieceInfo', - 'required' => true, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/AP/WeightSeg.php b/DHL/Datatype/AP/WeightSeg.php deleted file mode 100644 index 59fa294..0000000 --- a/DHL/Datatype/AP/WeightSeg.php +++ /dev/null @@ -1,62 +0,0 @@ - array( - 'type' => 'Weight', - 'required' => false, - 'subobject' => false, - 'comment' => 'Weight of piece or shipment', - 'fractionDigits' => '1', - 'maxInclusive' => '999999.9', - 'totalDigits' => '7', - ), - 'WeightUnit' => array( - 'type' => 'WeightUnit', - 'required' => false, - 'subobject' => false, - 'comment' => 'Unit of weight measurement (L:Pounds)', - 'length' => '1', - 'enumeration' => 'K,L', - ), - ); -} diff --git a/DHL/Datatype/Base.php b/DHL/Datatype/Base.php deleted file mode 100644 index dd30b7a..0000000 --- a/DHL/Datatype/Base.php +++ /dev/null @@ -1,505 +0,0 @@ -initializeValues(); - } - - /** - * Check if current object is empty or not - * - * @return boolean True if it is, false otherwise - */ - public function isEmpty() - { - foreach ($this->_values as $k => $v) - { - if (is_object($v)) - { - if (!$v->isEmpty()) - { - return false; - } - } - elseif (!empty($v) && $v !== null) - { - return false; - } - } - - return true; - } - - /** - * Generates the XML to be sent to DHL - * - * @param \XMLWriter $xmlWriter XMl Writer instance - * - * @return void - */ - public function toXML(\XMLWriter $xmlWriter = null) - { - if ($this->isEmpty()) - { - return; - } - - $displayedParentNode = false; - $this->validateParameters(); - - if (null !== $this->_xmlNodeName) - { - $parentNode = $this->_xmlNodeName; - } - else - { - $parts = explode('\\', get_class($this)); - $parentNode = array_pop($parts); - } - - $xmlWriter->startElement($parentNode); - - foreach ($this->_params as $name => $infos) - { - if ($this->$name) - { - if (is_object($this->$name)) - { - $this->$name->toXML($xmlWriter); - } - elseif (is_array($this->$name)) - { - if ('string' == $this->_params[$name]['type']) - { - foreach ($this->$name as $subelement) - { - $xmlWriter->writeElement($name, $subelement); - } - } - else - { - if (!isset($this->_params[$name]['disableParentNode']) || false == $this->_params[$name]['disableParentNode']) - { - $xmlWriter->startElement($name); - } - - foreach ($this->$name as $subelement) - { - $subelement->toXML($xmlWriter); - } - - if (!isset($this->_params[$name]['disableParentNode']) || false == $this->_params[$name]['disableParentNode']) - { - $xmlWriter->endElement(); - } - } - } - else - { - $xmlWriter->writeElement($name, $this->$name); - } - } - } - - $xmlWriter->endElement(); // End of parent node - } - - /** - * Initialize object from an XML string - * - * @param string $xml XML String - * - * @return void - */ - public function initFromXML($xml) - { - $xml = simplexml_load_string(str_replace('req:', '', $xml)); - $parts = explode('\\', get_class($this)); - $className = array_pop($parts); - foreach ($xml->children() as $child) - { - $childName = $child->getName(); - - if (isset($this->$childName) && is_object($this->$childName)) - { - $this->$childName->initFromXml($child->asXML()); - } - elseif (isset($this->_params[$childName]['multivalues']) && $this->_params[$childName]['multivalues']) - { - foreach ($child->children() as $subchild) - { - $subchildName = $subchild->getName(); - $childClassname = implode('\\', $parts) . '\\' . $this->_params[$subchildName]['type']; - $childClassname = str_replace('Entity', 'Datatype', $childClassname); - if ('string' == $this->_params[$subchildName]['type']) - { - $childObj = trim((string) $subchild); - } - else - { - $childObj = new $childClassname(); - $childObj->initFromXml($subchild->asXML()); - } - $addMethodName = 'add' . ucfirst($subchildName); - $this->$addMethodName($childObj); - } - } - elseif (isset($this->$childName) && ((string) $child)) - { - $this->$childName = trim((string) $child); - } - } - } - - /** - * Setter for multivalues field - * - * @param string $key Key to set - * @param mixed $value Value to set - * - * @return void - * @throws \InvalidArgumentException Throws exception if key is not valid - */ - public function __call($name, $arguments) - { - $key = str_replace('add', '', $name); - - if (isset($this->_params[$key . 's']) - && $this->_params[$key . 's']['type'] != 'string' - && isset($this->_params[$key. 's']['multivalues']) - && true === $this->_params[$key . 's']['multivalues']) - { - $key .= 's'; - } - - if (!array_key_exists($key, $this->_values)) - { - throw new \InvalidArgumentException('Field : ' . $key . ' is not defined for ' . get_class($this)); - } - - if (empty($arguments) && count($arguments) > 1) - { - throw new \InvalidArgumentException($name . ' method takes only 1 argument'); - } - - $this->validateParameterType($key, $arguments[0]); - $this->validateParameterValue($key, $arguments[0]); - - if (isset($this->_params[$key]['multivalues']) && $this->_params[$key]['multivalues']) - { - $this->_values[$key][] = $arguments[0]; - } - else - { - throw new \InvalidArgumentException('This is not a multivalues field : ' . $key . ' called via method ' . $name); - } - } - - /** - * Magic isset function - * - * @param string $key Key to check - * - * @return bolean True if it exsits, false otherwise - */ - final public function __isset($key) - { - return array_key_exists($key, $this->_values); - } - - /** - * Magic getter function - * - * @param string $key Key to get - * - * @return mixed Value of the property - * @throws \InvalidArgumentException Throws exceptin if key is not valid - */ - final public function __get($key) - { - if (!array_key_exists($key, $this->_values)) - { - throw new \InvalidArgumentException('Field : ' . $key . ' is not defined for ' . get_class($this)); - } - - return $this->_values[$key]; - } - - /** - * Magic setter function - * - * @param string $key Key to set - * @param mixed $value Value to set - * - * @return void - * @throws \InvalidArgumentException Throws exception if key is not valid - */ - final public function __set($key, $value) - { - if (!array_key_exists($key, $this->_values)) - { - throw new \InvalidArgumentException('Field : ' . $key . ' is not defined for ' . get_class($this)); - } - - $this->validateParameterType($key, $value); - $this->validateParameterValue($key, $value); - $this->_values[$key] = $value; - } - - /** - * Initialize property values bag - * - * @return void - */ - protected function initializeValues() - { - foreach ($this->_params as $name => $infos) - { - if (isset($infos['multivalues']) && $infos['multivalues']) - { - $this->_values[$name] = array(); - } - elseif (isset($infos['subobject']) && $infos['subobject']) - { - $tmp = get_class($this); - $parts = explode('\\', $tmp); - array_pop($parts); - $className = implode('\\', $parts) . '\\' . $infos['type']; - $this->_values[$name] = new $className(); - } - else - { - $this->_values[$name] = null; - } - } - } - - /** - * Validate all parameters - * - * @return boolean True upon success - * @throws \InvalidArgumentException Throws exception if type not valid or if value are missing - */ - protected function validateParameters() - { - foreach ($this->_params as $name => $infos) - { - if ($this->_values[$name]) - { - if (is_array($this->_values[$name]) && isset($infos['subobject']) && true === $infos['subobject']) - { - foreach ($this->_values[$name] as $subelement) - { - $subelement->validateParameters(); - } - } - else - { - $this->validateParameterType($name, $this->_values[$name]); - $this->validateParameterValue($name, $this->_values[$name]); - } - } - } - - return true; - } - - /** - * Validate the type of a parameter - * - * @param string $key Key to check - * @param mixed $value Value to check - * - * @return boolean True upon success - * @throws \InvalidArgumentException Throws exception if type is not valid - */ - protected function validateParameterType($key, $value) - { - if (null === $value) - { - return true; - } - - switch ($this->_params[$key]['type']) - { - case 'string': - if (is_array($value) && isset($this->_params[$key]['multivalues']) && true === $this->_params[$key]['multivalues']) - { - foreach ($value as $subvalue) - { - if (null !== $subvalue && $subvalue !== (string) $subvalue) - { - throw new \InvalidArgumentException('Invalid type for ' . $key . '. It should be of type : ' - . $this->_params[$key]['type'] . ' but it has a value of : ' . $subvalue); - } - } - } - elseif ($value !== (string) $value) - { - throw new \InvalidArgumentException('Invalid type for ' . $key . '. It should be of type : ' - . $this->_params[$key]['type'] . ' but it has a value of : ' . $value); - } - break; - - case 'datetime': - case 'date-iso8601': - $timestamp = strtotime($value); - $date = date(DATE_ISO8601, $timestamp); - if (strtotime($date) !== strtotime($value)) - { - throw new \InvalidArgumentException('Invalid type for ' . $key . '. It should be of type : ' - . $this->_params[$key]['type'] . ' but it has a value of : ' . $value); - } - break; - - case 'positiveInteger': - case 'negativeInteger': - case 'integer': - if (false === filter_var((int) $value, FILTER_VALIDATE_INT) && ((int) $value != $value)) - { - throw new \InvalidArgumentException('Invalid type for ' . $key . '. It should be of type : ' - . $this->_params[$key]['type'] . ' but it has a value of : ' . $value); - } - break; - - default: - if (isset($this->_params[$key]['subobject']) && $this->_params[$key]['subobject']) - { - $currentClass = get_class($value); - $parts = explode('\\', $currentClass); - array_pop($parts); - $className = str_replace('Entity', 'DataType', implode('\\', $parts) . '\\' . $this->_params[$key]['type']); - if (!$value instanceof $className) - { - throw new \InvalidArgumentException('Invalid type for ' . $key . '. It should be of type : ' - . $this->_params[$key]['type'] . ' but it has a value of : "' . print_r($value, true) . '"'); - } - } - break; - } - - return true; - } - - /** - * Validate the value of a parameter - * - * @param string $key Key to check - * @param mixed $value Value to check - * - * @return boolean True upon success - * @throws \InvalidArgumentException Throws exception if value is not valid - */ - protected function validateParameterValue($key, $value) - { - foreach ($this->_params[$key] as $type => $typeValue) - { - switch ($type) - { - case 'enumeration': - $acceptedValues = explode(',', $typeValue); - if (!in_array($value, $acceptedValues)) - { - throw new \InvalidArgumentException('Field ' . $key . ' cannot be set to value : ' . $value . '. Accepted values are : ' . $typeValue); - } - break; - - case 'length': - if (strlen($value) != $typeValue) - { - throw new \InvalidArgumentException('Field ' . $key . ' has a size of ' . strlen($value) . ' and it should be that size : ' . $typeValue); - } - break; - - case 'maxLength': - if (strlen($value) > $typeValue) - { - throw new \InvalidArgumentException('Field ' . $key . ' has a size of ' . strlen($value) . ' and it cannot exceed this size : ' . $typeValue); - } - break; - - case 'minLength': - if (strlen($value) < $typeValue) - { - throw new \InvalidArgumentException('Field ' . $key . ' has a size of ' . strlen($value) . ' and it cannot be less than this size : ' . $typeValue); - } - break; - - case 'minInclusive': - if ($value < $typeValue) - { - throw new \InvalidArgumentException('Field ' . $key . ' cannot be smaller than ' . $typeValue); - } - break; - - case 'maxInclusive': - if ($value > $typeValue) - { - throw new \InvalidArgumentException('Field ' . $key . ' cannot be higher than ' . $typeValue); - } - break; - - case 'pattern': - $matches = array(); - $typeValue = "/" . $typeValue . "/"; - if (1 !== preg_match($typeValue, $value, $matches) || (strlen($value) > 0 && !$matches[0])) - { - throw new \InvalidArgumentException('Field ' . $key . ' should match regex pattern : ' . $typeValue . ' and it has a value of ' . $value); - } - break; - } - } - - return true; - } -} diff --git a/DHL/Datatype/EA/AWBInfo.php b/DHL/Datatype/EA/AWBInfo.php deleted file mode 100644 index c8546ee..0000000 --- a/DHL/Datatype/EA/AWBInfo.php +++ /dev/null @@ -1,67 +0,0 @@ - array( - 'type' => 'AWBNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'Airway bill number', - 'maxLength' => '11', - ), - 'Status' => array( - 'type' => 'Status', - 'required' => false, - 'subobject' => true, - ), - 'ShipmentInfo' => array( - 'type' => 'ShipmentInfo', - 'required' => false, - 'subobject' => true, - ), - 'Pieces' => array( - 'type' => 'TrackingPieces', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/EA/BarCodes.php b/DHL/Datatype/EA/BarCodes.php deleted file mode 100644 index 562df7a..0000000 --- a/DHL/Datatype/EA/BarCodes.php +++ /dev/null @@ -1,51 +0,0 @@ - array( - 'type' => 'BarCode', - 'required' => false, - 'subobject' => false, - 'comment' => '', - ), - ); -} diff --git a/DHL/Datatype/EA/ChargeCard.php b/DHL/Datatype/EA/ChargeCard.php deleted file mode 100644 index 43a40ea..0000000 --- a/DHL/Datatype/EA/ChargeCard.php +++ /dev/null @@ -1,76 +0,0 @@ - array( - 'type' => 'ChargeCardNo', - 'required' => false, - 'subobject' => false, - 'comment' => 'Charge card number', - 'minInclusive' => '1000000000000', - 'maxInclusive' => '9999999999999999', - 'pattern' => '\d{13,16}', - ), - 'ChargeCardType' => array( - 'type' => 'ChargeCardType', - 'required' => false, - 'subobject' => false, - 'comment' => 'Charge card issuer type', - 'length' => '2', - 'enumeration' => 'AM,DC,DI,MC,VI', - ), - 'ChargeCardConfNo' => array( - 'type' => 'ChargeCardConfNo', - 'required' => false, - 'subobject' => false, - 'comment' => 'Charge card approval number', - 'pattern' => '\d{0,6}', - ), - 'ChargeCardExpiryDate' => array( - 'type' => 'ChargeCardExpDateValidator', - 'required' => false, - 'subobject' => false, - 'comment' => 'Charge card expiration date', - 'pattern' => '(0[1-9]|1[0-2])\d{1}[0-9]', - ), - ); -} diff --git a/DHL/Datatype/EA/Commodity.php b/DHL/Datatype/EA/Commodity.php deleted file mode 100644 index e63451a..0000000 --- a/DHL/Datatype/EA/Commodity.php +++ /dev/null @@ -1,60 +0,0 @@ - array( - 'type' => 'CommodityCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'Commodity codes for shipment type', - 'minLength' => '1', - 'maxLength' => '20', - ), - 'CommodityName' => array( - 'type' => 'CommodityName', - 'required' => false, - 'subobject' => false, - 'comment' => 'Commodity name for shipment content', - 'maxLength' => '35', - ), - ); -} diff --git a/DHL/Datatype/EA/Condition.php b/DHL/Datatype/EA/Condition.php deleted file mode 100644 index 29e64f3..0000000 --- a/DHL/Datatype/EA/Condition.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'ConditionData' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/EA/Consignee.php b/DHL/Datatype/EA/Consignee.php deleted file mode 100644 index 4118125..0000000 --- a/DHL/Datatype/EA/Consignee.php +++ /dev/null @@ -1,113 +0,0 @@ - array( - 'type' => 'CompanyNameValidator', - 'required' => false, - 'subobject' => false, - 'comment' => 'Name of company / business', - 'maxLength' => '35', - ), - 'AddressLine' => array( - 'type' => 'AddressLine', - 'required' => false, - 'subobject' => false, - 'comment' => 'Address Line', - 'maxLength' => '35', - ), - 'City' => array( - 'type' => 'City', - 'required' => false, - 'subobject' => false, - 'comment' => 'City name', - 'maxLength' => '35', - ), - 'Division' => array( - 'type' => 'Division', - 'required' => false, - 'subobject' => false, - 'comment' => 'Division (e.g. state, prefecture, etc.) name', - 'maxLength' => '35', - ), - 'DivisionCode' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'PostalCode' => array( - 'type' => 'PostalCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'Full postal/zip code for address', - ), - 'CountryCode' => array( - 'type' => 'CountryCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO country codes', - 'length' => '2', - ), - 'CountryName' => array( - 'type' => 'CountryName', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO country name', - 'maxLength' => '35', - ), - 'FederalTaxId' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'StateTaxId' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'Contact' => array( - 'type' => 'Contact', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/EA/Contact.php b/DHL/Datatype/EA/Contact.php deleted file mode 100644 index c4b09ca..0000000 --- a/DHL/Datatype/EA/Contact.php +++ /dev/null @@ -1,83 +0,0 @@ - array( - 'type' => 'PersonName', - 'required' => false, - 'subobject' => false, - 'comment' => 'Name', - 'maxLength' => '35', - ), - 'PhoneNumber' => array( - 'type' => 'PhoneNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'Phone Number', - ), - 'PhoneExtension' => array( - 'type' => 'PhoneExtension', - 'required' => false, - 'subobject' => false, - 'comment' => '', - 'maxLength' => '5', - ), - 'FaxNumber' => array( - 'type' => 'PhoneNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'Phone Number', - ), - 'Telex' => array( - 'type' => 'Telex', - 'required' => false, - 'subobject' => false, - 'comment' => 'Telex number and answer back code', - 'maxLength' => '25', - ), - 'Email' => array( - 'type' => 'Email', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/EA/Customer.php b/DHL/Datatype/EA/Customer.php deleted file mode 100644 index a405b7a..0000000 --- a/DHL/Datatype/EA/Customer.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Name' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/EA/CustomerLogo.php b/DHL/Datatype/EA/CustomerLogo.php deleted file mode 100644 index 455fd84..0000000 --- a/DHL/Datatype/EA/CustomerLogo.php +++ /dev/null @@ -1,59 +0,0 @@ - array( - 'type' => 'LogoImage', - 'required' => false, - 'subobject' => false, - 'comment' => 'LogoImage', - 'maxLength' => '1048576', - ), - 'LogoImageFormat' => array( - 'type' => 'LogoImageFormat', - 'required' => false, - 'subobject' => false, - 'comment' => 'LogoImage Format', - 'enumeration' => 'PNG,GIF,JPEG,JPG', - ), - ); -} diff --git a/DHL/Datatype/EA/DestinationServiceArea.php b/DHL/Datatype/EA/DestinationServiceArea.php deleted file mode 100644 index d62481f..0000000 --- a/DHL/Datatype/EA/DestinationServiceArea.php +++ /dev/null @@ -1,71 +0,0 @@ - array( - 'type' => 'ServiceAreaCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'DHL service area code', - 'length' => '3', - ), - 'Description' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'FacilityCode' => array( - 'type' => 'FacilityCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'Destination Facility Code', - 'length' => '3', - ), - 'InboundSortCode' => array( - 'type' => 'InboundSortCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'InBound Sort Code', - 'length' => '4', - ), - ); -} diff --git a/DHL/Datatype/EA/DocImage.php b/DHL/Datatype/EA/DocImage.php deleted file mode 100644 index fc2614d..0000000 --- a/DHL/Datatype/EA/DocImage.php +++ /dev/null @@ -1,67 +0,0 @@ - array( - 'type' => 'Type', - 'required' => false, - 'subobject' => false, - 'comment' => 'Image Type', - 'length' => '3', - 'enumeration' => 'HWB,INV,PNV,COO,NAF,CIN,DCL', - ), - 'Image' => array( - 'type' => 'Image', - 'required' => false, - 'subobject' => false, - 'comment' => 'Image', - ), - 'ImageFormat' => array( - 'type' => 'ImageFormat', - 'required' => false, - 'subobject' => false, - 'comment' => 'Image Format', - 'maxLength' => '5', - 'enumeration' => 'PDF,PNG,TIFF,GIF,JPEG', - ), - ); -} diff --git a/DHL/Datatype/EA/DocImages.php b/DHL/Datatype/EA/DocImages.php deleted file mode 100644 index bee1b95..0000000 --- a/DHL/Datatype/EA/DocImages.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'type' => 'DocImage', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/EA/Dutiable.php b/DHL/Datatype/EA/Dutiable.php deleted file mode 100644 index 595a570..0000000 --- a/DHL/Datatype/EA/Dutiable.php +++ /dev/null @@ -1,102 +0,0 @@ - array( - 'type' => 'Money', - 'required' => false, - 'subobject' => false, - 'comment' => 'Monetary amount (with 2 decimal precision)', - 'minInclusive' => '0.00', - 'maxInclusive' => '9999999999.99', - ), - 'DeclaredCurrency' => array( - 'type' => 'CurrencyCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO currency code', - 'length' => '3', - ), - 'ScheduleB' => array( - 'type' => 'ScheduleB', - 'required' => false, - 'subobject' => false, - 'comment' => 'Schedule B numner', - 'maxLength' => '15', - ), - 'ExportLicense' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'ShipperEIN' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'ShipperIDType' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'ConsigneeIDType' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'ImportLicense' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'ConsigneeEIN' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'TermsOfTrade' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/EA/ErrorResponse.php b/DHL/Datatype/EA/ErrorResponse.php deleted file mode 100644 index 30d9b2e..0000000 --- a/DHL/Datatype/EA/ErrorResponse.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'type' => 'ServiceHeader', - 'required' => false, - 'subobject' => true, - ), - 'Status' => array( - 'type' => 'Status', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/EA/EventRemarks.php b/DHL/Datatype/EA/EventRemarks.php deleted file mode 100644 index 7257403..0000000 --- a/DHL/Datatype/EA/EventRemarks.php +++ /dev/null @@ -1,57 +0,0 @@ - array( - 'type' => 'FurtherDetails', - 'required' => false, - 'subobject' => false, - 'comment' => 'FurtherDetails', - ), - 'NextSteps' => array( - 'type' => 'NextSteps', - 'required' => false, - 'subobject' => false, - 'comment' => 'NextSteps', - ), - ); -} diff --git a/DHL/Datatype/EA/ExportLineItem.php b/DHL/Datatype/EA/ExportLineItem.php deleted file mode 100644 index 4a1a98c..0000000 --- a/DHL/Datatype/EA/ExportLineItem.php +++ /dev/null @@ -1,125 +0,0 @@ - array( - 'type' => 'LineNumber', - 'required' => false, - 'subobject' => false, - 'comment' => '', - 'minInclusive' => '1', - 'maxInclusive' => '200', - ), - 'Quantity' => array( - 'type' => 'Quantity', - 'required' => false, - 'subobject' => false, - 'comment' => 'Quantity', - 'maxInclusive' => '32000', - ), - 'QuantityUnit' => array( - 'type' => 'QuantityUnit', - 'required' => false, - 'subobject' => false, - 'comment' => 'Quantity unit of measure (tens, hundreds, thousands, etc.)', - 'maxLength' => '8', - ), - 'Description' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Value' => array( - 'type' => 'Money', - 'required' => false, - 'subobject' => false, - 'comment' => 'Monetary amount (with 2 decimal precision)', - 'minInclusive' => '0.00', - 'maxInclusive' => '9999999999.99', - ), - 'IsDomestic' => array( - 'type' => 'YesNo', - 'required' => false, - 'subobject' => false, - 'comment' => 'Boolean flag', - 'length' => '1', - 'enumeration' => 'Y,N', - ), - 'CommodityCode' => array( - 'type' => 'CommodityCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'Commodity codes for shipment type', - 'minLength' => '1', - 'maxLength' => '20', - ), - 'ScheduleB' => array( - 'type' => 'ScheduleB', - 'required' => false, - 'subobject' => false, - 'comment' => 'Schedule B numner', - 'maxLength' => '15', - ), - 'ECCN' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Weight' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'License' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'LicenseSymbol' => array( - 'type' => 'LicenseNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'Export license number', - 'maxLength' => '16', - ), - ); -} diff --git a/DHL/Datatype/EA/Fault.php b/DHL/Datatype/EA/Fault.php deleted file mode 100644 index a8972e4..0000000 --- a/DHL/Datatype/EA/Fault.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'type' => 'PieceFault', - 'required' => true, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/EA/Label.php b/DHL/Datatype/EA/Label.php deleted file mode 100644 index e98ed06..0000000 --- a/DHL/Datatype/EA/Label.php +++ /dev/null @@ -1,73 +0,0 @@ - array( - 'type' => 'LabelTemplate', - 'required' => false, - 'subobject' => false, - 'comment' => 'LabelTemplate', - 'enumeration' => '8X4_A4_PDF,8X4_thermal,8X4_A4_TC_PDF,6X4_A4_PDF,8X4_CI_PDF,8X4_CI_thermal', - ), - 'Logo' => array( - 'type' => 'YesNo', - 'required' => false, - 'subobject' => false, - 'comment' => 'Boolean flag', - 'length' => '1', - 'enumeration' => 'Y,N', - ), - 'CustomerLogo' => array( - 'type' => 'CustomerLogo', - 'required' => false, - 'subobject' => true, - ), - 'Resolution' => array( - 'type' => 'Resolution', - 'required' => false, - 'subobject' => false, - 'comment' => 'Resolution', - 'minInclusive' => '200', - 'maxInclusive' => '300', - ), - ); -} diff --git a/DHL/Datatype/EA/LabelImage.php b/DHL/Datatype/EA/LabelImage.php deleted file mode 100644 index cd2e5f6..0000000 --- a/DHL/Datatype/EA/LabelImage.php +++ /dev/null @@ -1,63 +0,0 @@ - array( - 'type' => 'OutputFormat', - 'required' => false, - 'subobject' => false, - 'comment' => 'OutputFormat', - 'enumeration' => 'PDF,PL2,ZPL2,JPG,PNG,EPL2,EPLN,ZPLN', - ), - 'OutputImage' => array( - 'type' => 'OutputImage', - 'required' => false, - 'subobject' => false, - 'comment' => 'OutputImage', - ), - 'OutputImageNPC' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/EA/Note.php b/DHL/Datatype/EA/Note.php deleted file mode 100644 index a941355..0000000 --- a/DHL/Datatype/EA/Note.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Condition' => array( - 'type' => 'Condition', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/EA/OriginServiceArea.php b/DHL/Datatype/EA/OriginServiceArea.php deleted file mode 100644 index d04004a..0000000 --- a/DHL/Datatype/EA/OriginServiceArea.php +++ /dev/null @@ -1,64 +0,0 @@ - array( - 'type' => 'ServiceAreaCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'DHL service area code', - 'length' => '3', - ), - 'Description' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'OutboundSortCode' => array( - 'type' => 'OutboundSortCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'OutBound Sort Code', - 'length' => '4', - ), - ); -} diff --git a/DHL/Datatype/EA/Piece.php b/DHL/Datatype/EA/Piece.php deleted file mode 100644 index 94d8ff8..0000000 --- a/DHL/Datatype/EA/Piece.php +++ /dev/null @@ -1,98 +0,0 @@ - array( - 'type' => 'PieceID', - 'required' => false, - 'subobject' => false, - 'comment' => 'Piece ID', - 'maxLength' => '35', - ), - 'PackageType' => array( - 'type' => 'PackageType', - 'required' => false, - 'subobject' => false, - 'comment' => 'Package Type (EE: DHL Express Envelope, OD:Other DHL Packaging, CP:Customer-provided.Ground shipments must choose CP)', - 'length' => '2', - 'enumeration' => 'EE,OD,CP', - ), - 'Weight' => array( - 'type' => 'Weight', - 'required' => false, - 'subobject' => false, - 'comment' => 'Weight of piece or shipment', - 'fractionDigits' => '1', - 'maxInclusive' => '999999.9', - 'totalDigits' => '7', - ), - 'DimWeight' => array( - 'type' => 'Weight', - 'required' => false, - 'subobject' => false, - 'comment' => 'Weight of piece or shipment', - 'fractionDigits' => '1', - 'maxInclusive' => '999999.9', - 'totalDigits' => '7', - ), - 'Width' => array( - 'type' => 'positiveInteger', - 'required' => false, - 'subobject' => false, - ), - 'Height' => array( - 'type' => 'positiveInteger', - 'required' => false, - 'subobject' => false, - ), - 'Depth' => array( - 'type' => 'positiveInteger', - 'required' => false, - 'subobject' => false, - ), - 'PieceContents' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/EA/PieceEvent.php b/DHL/Datatype/EA/PieceEvent.php deleted file mode 100644 index c65eca5..0000000 --- a/DHL/Datatype/EA/PieceEvent.php +++ /dev/null @@ -1,70 +0,0 @@ - array( - 'type' => 'date', - 'required' => false, - 'subobject' => false, - ), - 'Time' => array( - 'type' => 'time', - 'required' => false, - 'subobject' => false, - ), - 'ServiceEvent' => array( - 'type' => 'ServiceEvent', - 'required' => false, - 'subobject' => true, - ), - 'Signatory' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'ServiceArea' => array( - 'type' => 'ServiceArea', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/EA/PieceFault.php b/DHL/Datatype/EA/PieceFault.php deleted file mode 100644 index 594bcbf..0000000 --- a/DHL/Datatype/EA/PieceFault.php +++ /dev/null @@ -1,63 +0,0 @@ - array( - 'type' => 'TrackingPieceID', - 'required' => true, - 'subobject' => false, - 'comment' => 'Piece ID', - 'minLength' => '1', - 'maxLength' => '35', - ), - 'ConditionCode' => array( - 'type' => 'string', - 'required' => true, - 'subobject' => false, - ), - 'ConditionData' => array( - 'type' => 'string', - 'required' => true, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/EA/PieceInfo.php b/DHL/Datatype/EA/PieceInfo.php deleted file mode 100644 index 6f4897d..0000000 --- a/DHL/Datatype/EA/PieceInfo.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'type' => 'PieceDetails', - 'required' => true, - 'subobject' => true, - ), - 'PieceEvent' => array( - 'type' => 'PieceEvent', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/EA/Pieces.php b/DHL/Datatype/EA/Pieces.php deleted file mode 100644 index 2b4d538..0000000 --- a/DHL/Datatype/EA/Pieces.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'type' => 'Piece', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/EA/Place.php b/DHL/Datatype/EA/Place.php deleted file mode 100644 index 955262a..0000000 --- a/DHL/Datatype/EA/Place.php +++ /dev/null @@ -1,102 +0,0 @@ - array( - 'type' => 'ResidenceOrBusiness', - 'required' => false, - 'subobject' => false, - 'comment' => 'Identifies if a location is a business, residence, or both (B:Business, R:Residence, C:Business Residence)', - 'length' => '1', - 'enumeration' => 'B,R,C', - ), - 'CompanyName' => array( - 'type' => 'CompanyNameValidator', - 'required' => false, - 'subobject' => false, - 'comment' => 'Name of company / business', - 'maxLength' => '35', - ), - 'AddressLine' => array( - 'type' => 'AddressLine', - 'required' => false, - 'subobject' => false, - 'comment' => 'Address Line', - 'maxLength' => '35', - ), - 'City' => array( - 'type' => 'City', - 'required' => false, - 'subobject' => false, - 'comment' => 'City name', - 'maxLength' => '35', - ), - 'CountryCode' => array( - 'type' => 'CountryCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO country codes', - 'length' => '2', - ), - 'DivisionCode' => array( - 'type' => 'StateCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'Division (state) code.', - 'maxLength' => '2', - 'minLength' => '2', - ), - 'Division' => array( - 'type' => 'State', - 'required' => false, - 'subobject' => false, - 'comment' => 'State', - 'maxLength' => '35', - ), - 'PostalCode' => array( - 'type' => 'PostalCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'Full postal/zip code for address', - ), - ); -} diff --git a/DHL/Datatype/EA/Reference.php b/DHL/Datatype/EA/Reference.php deleted file mode 100644 index 40f4eb3..0000000 --- a/DHL/Datatype/EA/Reference.php +++ /dev/null @@ -1,59 +0,0 @@ - array( - 'type' => 'ReferenceID', - 'required' => false, - 'subobject' => false, - 'comment' => 'Shipper reference ID', - 'maxLength' => '35', - ), - 'ReferenceType' => array( - 'type' => 'ReferenceType', - 'required' => false, - 'subobject' => false, - 'comment' => 'Shipment reference type', - 'length' => '2', - ), - ); -} diff --git a/DHL/Datatype/EA/Request.php b/DHL/Datatype/EA/Request.php deleted file mode 100644 index 3221199..0000000 --- a/DHL/Datatype/EA/Request.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'type' => 'ServiceHeader', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/EA/Response.php b/DHL/Datatype/EA/Response.php deleted file mode 100644 index 28dec45..0000000 --- a/DHL/Datatype/EA/Response.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'type' => 'ServiceHeader', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/EA/ServiceArea.php b/DHL/Datatype/EA/ServiceArea.php deleted file mode 100644 index a239c54..0000000 --- a/DHL/Datatype/EA/ServiceArea.php +++ /dev/null @@ -1,57 +0,0 @@ - array( - 'type' => 'ServiceAreaCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'DHL service area code', - 'length' => '3', - ), - 'Description' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/EA/ServiceHeader.php b/DHL/Datatype/EA/ServiceHeader.php deleted file mode 100644 index 79bb6a9..0000000 --- a/DHL/Datatype/EA/ServiceHeader.php +++ /dev/null @@ -1,74 +0,0 @@ - array( - 'type' => 'dateTime', - 'required' => false, - 'subobject' => false, - ), - 'MessageReference' => array( - 'type' => 'MessageReference', - 'required' => false, - 'subobject' => false, - 'comment' => 'Reference to the requested Message', - 'minLength' => '28', - 'maxLength' => '32', - ), - 'SiteID' => array( - 'type' => 'SiteID', - 'required' => false, - 'subobject' => false, - 'comment' => 'Site ID used for verifying the sender', - 'minLength' => '6', - 'maxLength' => '20', - ), - 'Password' => array( - 'type' => 'Password', - 'required' => false, - 'subobject' => false, - 'comment' => 'Password used for verifying the sender', - 'minLength' => '8', - 'maxLength' => '20', - ), - ); -} diff --git a/DHL/Datatype/EA/ShipValResponsePiece.php b/DHL/Datatype/EA/ShipValResponsePiece.php deleted file mode 100644 index 3aa4457..0000000 --- a/DHL/Datatype/EA/ShipValResponsePiece.php +++ /dev/null @@ -1,117 +0,0 @@ - array( - 'type' => 'PieceNumber', - 'required' => true, - 'subobject' => false, - 'comment' => 'Piece Number', - ), - 'Depth' => array( - 'type' => 'positiveInteger', - 'required' => false, - 'subobject' => false, - ), - 'Width' => array( - 'type' => 'positiveInteger', - 'required' => false, - 'subobject' => false, - ), - 'Height' => array( - 'type' => 'positiveInteger', - 'required' => false, - 'subobject' => false, - ), - 'Weight' => array( - 'type' => 'Weight', - 'required' => false, - 'subobject' => false, - 'comment' => 'Weight of piece or shipment', - 'fractionDigits' => '1', - 'maxInclusive' => '999999.9', - 'totalDigits' => '7', - ), - 'PackageType' => array( - 'type' => 'PackageType', - 'required' => false, - 'subobject' => false, - 'comment' => 'Package Type (EE: DHL Express Envelope, OD:Other DHL Packaging, CP:Customer-provided.Ground shipments must choose CP)', - 'length' => '2', - 'enumeration' => 'EE,OD,CP', - ), - 'DimWeight' => array( - 'type' => 'Weight', - 'required' => false, - 'subobject' => false, - 'comment' => 'Weight of piece or shipment', - 'fractionDigits' => '1', - 'maxInclusive' => '999999.9', - 'totalDigits' => '7', - ), - 'PieceContents' => array( - 'type' => 'PieceContents', - 'required' => false, - 'subobject' => false, - 'comment' => 'Piece contents description', - 'maxLength' => '90', - ), - 'DataIdentifier' => array( - 'type' => 'string', - 'required' => true, - 'subobject' => false, - ), - 'LicensePlate' => array( - 'type' => 'PieceID', - 'required' => true, - 'subobject' => false, - 'comment' => 'Piece ID', - 'maxLength' => '35', - ), - 'LicensePlateBarCode' => array( - 'type' => 'BarCode', - 'required' => true, - 'subobject' => false, - 'comment' => '', - ), - ); -} diff --git a/DHL/Datatype/EA/ShipValResponsePieces.php b/DHL/Datatype/EA/ShipValResponsePieces.php deleted file mode 100644 index 0b1518f..0000000 --- a/DHL/Datatype/EA/ShipValResponsePieces.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'type' => 'ShipValResponsePiece', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/EA/Shipment.php b/DHL/Datatype/EA/Shipment.php deleted file mode 100644 index 5cf7c10..0000000 --- a/DHL/Datatype/EA/Shipment.php +++ /dev/null @@ -1,156 +0,0 @@ - array( - 'type' => 'Weight', - 'required' => false, - 'subobject' => false, - 'comment' => 'Weight of piece or shipment', - 'fractionDigits' => '1', - 'maxInclusive' => '999999.9', - 'totalDigits' => '7', - ), - 'WeightUnit' => array( - 'type' => 'WeightUnit', - 'required' => false, - 'subobject' => false, - 'comment' => 'Unit of weight measurement (L:Pounds)', - 'length' => '1', - 'enumeration' => 'K,L', - ), - 'Pieces' => array( - 'type' => 'Pieces', - 'required' => false, - 'subobject' => true, - ), - 'DoorTo' => array( - 'type' => 'DoorTo', - 'required' => false, - 'subobject' => false, - 'comment' => 'Defines the type of delivery service that applies to the shipment', - 'length' => '2', - 'enumeration' => 'DD,DA,AA,DC', - ), - 'AirwarBillNumber' => array( - 'type' => 'AWBNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'Airway bill number', - 'maxLength' => '11', - ), - 'AccountType' => array( - 'type' => 'AccountType', - 'required' => false, - 'subobject' => false, - 'comment' => 'Account Type by method of payment ( DHL account vs. Credit card)', - 'enumeration' => 'D', - ), - 'ProductType' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'GlobalProductType' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'LocalProductType' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Commodity' => array( - 'type' => 'Commodity', - 'required' => false, - 'subobject' => true, - ), - 'DeclaredValue' => array( - 'type' => 'Money', - 'required' => false, - 'subobject' => false, - 'comment' => 'Monetary amount (with 2 decimal precision)', - 'minInclusive' => '0.00', - 'maxInclusive' => '9999999999.99', - ), - 'DeclaredCurrency' => array( - 'type' => 'CurrencyCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO currency code', - 'length' => '3', - ), - 'InsuredValue' => array( - 'type' => 'Money', - 'required' => false, - 'subobject' => false, - 'comment' => 'Monetary amount (with 2 decimal precision)', - 'minInclusive' => '0.00', - 'maxInclusive' => '9999999999.99', - ), - 'InsuredCurrency' => array( - 'type' => 'CurrencyCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO currency code', - 'length' => '3', - ), - 'DimensionalUnit' => array( - 'type' => 'WeightUnit', - 'required' => false, - 'subobject' => false, - 'comment' => 'Unit of weight measurement (L:Pounds)', - 'length' => '1', - 'enumeration' => 'K,L', - ), - 'DimensionalWeight' => array( - 'type' => 'Weight', - 'required' => false, - 'subobject' => false, - 'comment' => 'Weight of piece or shipment', - 'fractionDigits' => '1', - 'maxInclusive' => '999999.9', - 'totalDigits' => '7', - ), - ); -} diff --git a/DHL/Datatype/EA/ShipmentDate.php b/DHL/Datatype/EA/ShipmentDate.php deleted file mode 100644 index 79575d2..0000000 --- a/DHL/Datatype/EA/ShipmentDate.php +++ /dev/null @@ -1,57 +0,0 @@ - array( - 'type' => 'Date', - 'required' => false, - 'subobject' => false, - 'comment' => 'Date only', - ), - 'ShipmentDateTo' => array( - 'type' => 'Date', - 'required' => false, - 'subobject' => false, - 'comment' => 'Date only', - ), - ); -} diff --git a/DHL/Datatype/EA/ShipmentEvent.php b/DHL/Datatype/EA/ShipmentEvent.php deleted file mode 100644 index b3868db..0000000 --- a/DHL/Datatype/EA/ShipmentEvent.php +++ /dev/null @@ -1,75 +0,0 @@ - array( - 'type' => 'date', - 'required' => false, - 'subobject' => false, - ), - 'Time' => array( - 'type' => 'time', - 'required' => false, - 'subobject' => false, - ), - 'ServiceEvent' => array( - 'type' => 'ServiceEvent', - 'required' => false, - 'subobject' => true, - ), - 'Signatory' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'EventRemarks' => array( - 'type' => 'EventRemarks', - 'required' => false, - 'subobject' => true, - ), - 'ServiceArea' => array( - 'type' => 'ServiceArea', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/EA/Shipper.php b/DHL/Datatype/EA/Shipper.php deleted file mode 100644 index d5ebe7a..0000000 --- a/DHL/Datatype/EA/Shipper.php +++ /dev/null @@ -1,142 +0,0 @@ - array( - 'type' => 'ShipperID', - 'required' => false, - 'subobject' => false, - 'comment' => 'Shipper\'s ID', - 'maxLength' => '30', - ), - 'CompanyName' => array( - 'type' => 'CompanyNameValidator', - 'required' => false, - 'subobject' => false, - 'comment' => 'Name of company / business', - 'maxLength' => '35', - ), - 'RegisteredAccount' => array( - 'type' => 'AccountNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'DHL Account Number', - 'maxInclusive' => '9999999999', - 'minInclusive' => '100000000', - ), - 'AddressLine' => array( - 'type' => 'AddressLine', - 'required' => false, - 'subobject' => false, - 'comment' => 'Address Line', - 'maxLength' => '35', - ), - 'City' => array( - 'type' => 'City', - 'required' => false, - 'subobject' => false, - 'comment' => 'City name', - 'maxLength' => '35', - ), - 'Division' => array( - 'type' => 'Division', - 'required' => false, - 'subobject' => false, - 'comment' => 'Division (e.g. state, prefecture, etc.) name', - 'maxLength' => '35', - ), - 'DivisionCode' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'PostalCode' => array( - 'type' => 'PostalCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'Full postal/zip code for address', - ), - 'OriginServiceAreaCode' => array( - 'type' => 'OriginServiceAreaCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'OriginServiceAreaCode', - 'maxLength' => '3', - ), - 'OriginFacilityCode' => array( - 'type' => 'OriginFacilityCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'OriginFacilityCode', - 'maxLength' => '3', - ), - 'CountryCode' => array( - 'type' => 'CountryCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO country codes', - 'length' => '2', - ), - 'CountryName' => array( - 'type' => 'CountryName', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO country name', - 'maxLength' => '35', - ), - 'FederalTaxId' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'StateTaxId' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'Contact' => array( - 'type' => 'Contact', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/EA/Status.php b/DHL/Datatype/EA/Status.php deleted file mode 100644 index 41aeb08..0000000 --- a/DHL/Datatype/EA/Status.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Condition' => array( - 'type' => 'Condition', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/EA/TrackingPieces.php b/DHL/Datatype/EA/TrackingPieces.php deleted file mode 100644 index 07f20f2..0000000 --- a/DHL/Datatype/EA/TrackingPieces.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'type' => 'PieceInfo', - 'required' => true, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/EA/WeightSeg.php b/DHL/Datatype/EA/WeightSeg.php deleted file mode 100644 index 2e9eaa0..0000000 --- a/DHL/Datatype/EA/WeightSeg.php +++ /dev/null @@ -1,62 +0,0 @@ - array( - 'type' => 'Weight', - 'required' => false, - 'subobject' => false, - 'comment' => 'Weight of piece or shipment', - 'fractionDigits' => '1', - 'maxInclusive' => '999999.9', - 'totalDigits' => '7', - ), - 'WeightUnit' => array( - 'type' => 'WeightUnit', - 'required' => false, - 'subobject' => false, - 'comment' => 'Unit of weight measurement (L:Pounds)', - 'length' => '1', - 'enumeration' => 'K,L', - ), - ); -} diff --git a/DHL/Datatype/GB/AWBInfo.php b/DHL/Datatype/GB/AWBInfo.php deleted file mode 100644 index 956b431..0000000 --- a/DHL/Datatype/GB/AWBInfo.php +++ /dev/null @@ -1,67 +0,0 @@ - array( - 'type' => 'AWBNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'Airway bill number', - 'maxLength' => '10', - ), - 'Status' => array( - 'type' => 'Status', - 'required' => false, - 'subobject' => true, - ), - 'ShipmentInfo' => array( - 'type' => 'ShipmentInfo', - 'required' => false, - 'subobject' => true, - ), - 'PieceInfo' => array( - 'type' => 'PieceInfo', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/GB/AdditionalProtection.php b/DHL/Datatype/GB/AdditionalProtection.php deleted file mode 100644 index 80a2da4..0000000 --- a/DHL/Datatype/GB/AdditionalProtection.php +++ /dev/null @@ -1,60 +0,0 @@ - array( - 'type' => 'Code', - 'required' => false, - 'subobject' => false, - 'comment' => 'Code', - 'length' => '2', - 'enumeration' => 'AP,NR', - ), - 'Value' => array( - 'type' => 'Value', - 'required' => false, - 'subobject' => false, - 'comment' => 'Value', - 'maxInclusive' => '9999999.99', - ), - ); -} diff --git a/DHL/Datatype/GB/BarCode.php b/DHL/Datatype/GB/BarCode.php deleted file mode 100644 index 1f0dd37..0000000 --- a/DHL/Datatype/GB/BarCode.php +++ /dev/null @@ -1,51 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => '', - ), - ); -} diff --git a/DHL/Datatype/GB/BarCodes.php b/DHL/Datatype/GB/BarCodes.php deleted file mode 100644 index 4d7d3b8..0000000 --- a/DHL/Datatype/GB/BarCodes.php +++ /dev/null @@ -1,69 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => '', - ), - 'OriginDestnBarcode' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => '', - ), - 'ClientIDBarCode' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => '', - ), - 'DHLRoutingBarCode' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => '', - ), - ); -} diff --git a/DHL/Datatype/GB/Billing.php b/DHL/Datatype/GB/Billing.php deleted file mode 100644 index 9440249..0000000 --- a/DHL/Datatype/GB/Billing.php +++ /dev/null @@ -1,82 +0,0 @@ - array( - 'type' => 'AccountNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'DHL Account Number', - 'maxLength' => '12', - ), - 'ShippingPaymentType' => array( - 'type' => 'ShipmentPaymentType', - 'required' => false, - 'subobject' => false, - 'comment' => 'Shipment payment type (S:Shipper)', - 'length' => '1', - 'enumeration' => 'S,R,T', - ), - 'BillingAccountNumber' => array( - 'type' => 'AccountNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'DHL Account Number', - 'maxLength' => '12', - ), - 'DutyPaymentType' => array( - 'type' => 'DutyTaxPaymentType', - 'required' => false, - 'subobject' => false, - 'comment' => 'Duty and tax charge payment type (R:Recipient)', - 'length' => '1', - 'enumeration' => 'S,R,T', - ), - 'DutyAccountNumber' => array( - 'type' => 'AccountNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'DHL Account Number', - 'maxLength' => '12', - ), - ); -} diff --git a/DHL/Datatype/GB/ChargeCard.php b/DHL/Datatype/GB/ChargeCard.php deleted file mode 100644 index f2b642b..0000000 --- a/DHL/Datatype/GB/ChargeCard.php +++ /dev/null @@ -1,76 +0,0 @@ - array( - 'type' => 'ChargeCardNo', - 'required' => false, - 'subobject' => false, - 'comment' => 'Charge card number', - 'minInclusive' => '1000000000000', - 'maxInclusive' => '9999999999999999', - 'pattern' => '\d{13,16}', - ), - 'ChargeCardType' => array( - 'type' => 'ChargeCardType', - 'required' => false, - 'subobject' => false, - 'comment' => 'Charge card issuer type', - 'length' => '2', - 'enumeration' => 'AM,DC,DI,MC,VI', - ), - 'ChargeCardConfNo' => array( - 'type' => 'ChargeCardConfNo', - 'required' => false, - 'subobject' => false, - 'comment' => 'Charge card confirmation number', - 'pattern' => '\d{0,6}', - ), - 'ChargeCardExpiryDate' => array( - 'type' => 'ChargeCardExpDateValidator', - 'required' => false, - 'subobject' => false, - 'comment' => 'Charge card expiration date', - 'pattern' => '(0[1-9]|1[0-2])\d{1}[0-9]', - ), - ); -} diff --git a/DHL/Datatype/GB/Commodity.php b/DHL/Datatype/GB/Commodity.php deleted file mode 100644 index 1ba88bf..0000000 --- a/DHL/Datatype/GB/Commodity.php +++ /dev/null @@ -1,60 +0,0 @@ - array( - 'type' => 'CommodityCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'Commodity codes for shipment type', - 'minLength' => '1', - 'maxLength' => '20', - ), - 'CommodityName' => array( - 'type' => 'CommodityName', - 'required' => false, - 'subobject' => false, - 'comment' => 'Commodity name for shipment content', - 'maxLength' => '35', - ), - ); -} diff --git a/DHL/Datatype/GB/Condition.php b/DHL/Datatype/GB/Condition.php deleted file mode 100644 index eb510bb..0000000 --- a/DHL/Datatype/GB/Condition.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'ConditionData' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/GB/Consignee.php b/DHL/Datatype/GB/Consignee.php deleted file mode 100644 index 734d4ce..0000000 --- a/DHL/Datatype/GB/Consignee.php +++ /dev/null @@ -1,117 +0,0 @@ - array( - 'type' => 'CompanyNameValidator', - 'required' => false, - 'subobject' => false, - 'comment' => 'Name of company / business', - 'minLength' => '0', - ), - 'SuiteDepartmentName' => array( - 'type' => 'SuiteDepartmentName', - 'required' => false, - 'subobject' => false, - 'comment' => 'SuiteDepartmentName', - ), - 'AddressLine' => array( - 'type' => 'string', - 'required' => true, - 'subobject' => false, - 'comment' => 'Address Line', - 'multivalues' => true, - ), - 'City' => array( - 'type' => 'City', - 'required' => false, - 'subobject' => false, - 'comment' => 'City name', - ), - 'Division' => array( - 'type' => 'Division', - 'required' => false, - 'subobject' => false, - 'comment' => 'Division (e.g. state, prefecture, etc.) name', - ), - 'DivisionCode' => array( - 'type' => 'DivisionCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'Division (e.g. state, prefecture, etc.) code', - ), - 'PostalCode' => array( - 'type' => 'PostalCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'Full postal/zip code for address', - ), - 'CountryCode' => array( - 'type' => 'CountryCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO country codes', - 'length' => '2', - ), - 'CountryName' => array( - 'type' => 'CountryName', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO country name', - ), - 'FederalTaxId' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'StateTaxId' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'Contact' => array( - 'type' => 'Contact', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/GB/Customer.php b/DHL/Datatype/GB/Customer.php deleted file mode 100644 index ebf7292..0000000 --- a/DHL/Datatype/GB/Customer.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Name' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/GB/CustomerLogo.php b/DHL/Datatype/GB/CustomerLogo.php deleted file mode 100644 index 99ed9ea..0000000 --- a/DHL/Datatype/GB/CustomerLogo.php +++ /dev/null @@ -1,59 +0,0 @@ - array( - 'type' => 'LogoImage', - 'required' => false, - 'subobject' => false, - 'comment' => 'LogoImage', - 'maxLength' => '1048576', - ), - 'LogoImageFormat' => array( - 'type' => 'LogoImageFormat', - 'required' => false, - 'subobject' => false, - 'comment' => 'LogoImage Format', - 'enumeration' => 'PNG,GIF,JPEG,JPG', - ), - ); -} diff --git a/DHL/Datatype/GB/DestinationServiceArea.php b/DHL/Datatype/GB/DestinationServiceArea.php deleted file mode 100644 index 2851496..0000000 --- a/DHL/Datatype/GB/DestinationServiceArea.php +++ /dev/null @@ -1,71 +0,0 @@ - array( - 'type' => 'ServiceAreaCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'DHL service area code', - 'length' => '3', - ), - 'Description' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'FacilityCode' => array( - 'type' => 'FacilityCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'Destination Facility Code', - 'length' => '3', - ), - 'InboundSortCode' => array( - 'type' => 'InboundSortCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'InBound Sort Code', - 'maxLength' => '4', - ), - ); -} diff --git a/DHL/Datatype/GB/DocImage.php b/DHL/Datatype/GB/DocImage.php deleted file mode 100644 index 9022394..0000000 --- a/DHL/Datatype/GB/DocImage.php +++ /dev/null @@ -1,67 +0,0 @@ - array( - 'type' => 'Type', - 'required' => false, - 'subobject' => false, - 'comment' => 'Image Type', - 'length' => '3', - 'enumeration' => 'HWB,INV,PNV,COO,NAF,CIN,DCL', - ), - 'Image' => array( - 'type' => 'Image', - 'required' => false, - 'subobject' => false, - 'comment' => 'Image', - ), - 'ImageFormat' => array( - 'type' => 'ImageFormat', - 'required' => false, - 'subobject' => false, - 'comment' => 'Image Format', - 'maxLength' => '5', - 'enumeration' => 'PDF,PNG,TIFF,GIF,JPEG', - ), - ); -} diff --git a/DHL/Datatype/GB/ErrorResponse.php b/DHL/Datatype/GB/ErrorResponse.php deleted file mode 100644 index a1d3631..0000000 --- a/DHL/Datatype/GB/ErrorResponse.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'type' => 'ServiceHeader', - 'required' => false, - 'subobject' => true, - ), - 'Status' => array( - 'type' => 'Status', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/GB/Fault.php b/DHL/Datatype/GB/Fault.php deleted file mode 100644 index 7629ddb..0000000 --- a/DHL/Datatype/GB/Fault.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'type' => 'PieceFault', - 'required' => true, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/GB/Label.php b/DHL/Datatype/GB/Label.php deleted file mode 100644 index 4f514c5..0000000 --- a/DHL/Datatype/GB/Label.php +++ /dev/null @@ -1,73 +0,0 @@ - array( - 'type' => 'LabelTemplate', - 'required' => false, - 'subobject' => false, - 'comment' => 'LabelTemplate', - 'enumeration' => '8X4_A4_PDF,8X4_thermal,8X4_A4_TC_PDF,6X4_A4_PDF,6X4_thermal,8X4_CI_PDF,8X4_CI_thermal', - ), - 'Logo' => array( - 'type' => 'YesNo', - 'required' => false, - 'subobject' => false, - 'comment' => 'Boolean flag', - 'length' => '1', - 'enumeration' => 'Y,N', - ), - 'CustomerLogo' => array( - 'type' => 'CustomerLogo', - 'required' => false, - 'subobject' => true, - ), - 'Resolution' => array( - 'type' => 'Resolution', - 'required' => false, - 'subobject' => false, - 'comment' => 'Resolution', - 'minInclusive' => '200', - 'maxInclusive' => '300', - ), - ); -} diff --git a/DHL/Datatype/GB/LabelImage.php b/DHL/Datatype/GB/LabelImage.php deleted file mode 100644 index c5d8da8..0000000 --- a/DHL/Datatype/GB/LabelImage.php +++ /dev/null @@ -1,63 +0,0 @@ - array( - 'type' => 'OutputFormat', - 'required' => false, - 'subobject' => false, - 'comment' => 'OutputFormat', - 'enumeration' => 'PDF,PL2,ZPL2,JPG,PNG,EPL2,EPLN,ZPLN', - ), - 'OutputImage' => array( - 'type' => 'OutputImage', - 'required' => false, - 'subobject' => false, - 'comment' => 'OutputImage', - ), - 'OutputImageNPC' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/GB/Note.php b/DHL/Datatype/GB/Note.php deleted file mode 100644 index d7cd32c..0000000 --- a/DHL/Datatype/GB/Note.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Condition' => array( - 'type' => 'Condition', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/GB/OriginServiceArea.php b/DHL/Datatype/GB/OriginServiceArea.php deleted file mode 100644 index 3a0ac08..0000000 --- a/DHL/Datatype/GB/OriginServiceArea.php +++ /dev/null @@ -1,64 +0,0 @@ - array( - 'type' => 'ServiceAreaCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'DHL service area code', - 'length' => '3', - ), - 'Description' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'OutboundSortCode' => array( - 'type' => 'OutboundSortCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'OutBound Sort Code', - 'maxLength' => '4', - ), - ); -} diff --git a/DHL/Datatype/GB/PieceDetails.php b/DHL/Datatype/GB/PieceDetails.php deleted file mode 100644 index 1646df4..0000000 --- a/DHL/Datatype/GB/PieceDetails.php +++ /dev/null @@ -1,93 +0,0 @@ - array( - 'type' => 'TrackingPieceID', - 'required' => false, - 'subobject' => false, - 'comment' => 'Piece ID', - 'minLength' => '20', - 'maxLength' => '35', - ), - 'PackageType' => array( - 'type' => 'PackageType', - 'required' => false, - 'subobject' => false, - 'comment' => 'Package Type (EE: DHL Express Envelope, OD:Other - DHL Packaging, CP:Customer-provided, JB-Jumbo box, JJ-Junior jumbo - Box, DF-DHL Flyer, YP-Your packaging)', - 'length' => '2', - 'enumeration' => 'BD,BP,CP,DC,DF,DM,ED,EE,FR,JB,JD,JJ,JP,OD,PA,YP', - ), - 'Weight' => array( - 'type' => 'Weight', - 'required' => false, - 'subobject' => false, - 'comment' => 'Weight of piece or shipment', - 'fractionDigits' => '3', - 'minInclusive' => '0.000', - 'maxInclusive' => '999999.999', - 'totalDigits' => '10', - ), - 'DimWeight' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Width' => array( - 'type' => 'positiveInteger', - 'required' => false, - 'subobject' => false, - ), - 'Height' => array( - 'type' => 'positiveInteger', - 'required' => false, - 'subobject' => false, - ), - 'Depth' => array( - 'type' => 'positiveInteger', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/GB/PieceEvent.php b/DHL/Datatype/GB/PieceEvent.php deleted file mode 100644 index d1db424..0000000 --- a/DHL/Datatype/GB/PieceEvent.php +++ /dev/null @@ -1,70 +0,0 @@ - array( - 'type' => 'date', - 'required' => false, - 'subobject' => false, - ), - 'Time' => array( - 'type' => 'time', - 'required' => false, - 'subobject' => false, - ), - 'ServiceEvent' => array( - 'type' => 'ServiceEvent', - 'required' => false, - 'subobject' => true, - ), - 'Signatory' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'ServiceArea' => array( - 'type' => 'ServiceArea', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/GB/PieceFault.php b/DHL/Datatype/GB/PieceFault.php deleted file mode 100644 index 70eebb8..0000000 --- a/DHL/Datatype/GB/PieceFault.php +++ /dev/null @@ -1,63 +0,0 @@ - array( - 'type' => 'TrackingPieceID', - 'required' => true, - 'subobject' => false, - 'comment' => 'Piece ID', - 'minLength' => '20', - 'maxLength' => '35', - ), - 'ConditionCode' => array( - 'type' => 'string', - 'required' => true, - 'subobject' => false, - ), - 'ConditionData' => array( - 'type' => 'string', - 'required' => true, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/GB/PieceInfo.php b/DHL/Datatype/GB/PieceInfo.php deleted file mode 100644 index 677a08d..0000000 --- a/DHL/Datatype/GB/PieceInfo.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'type' => 'PieceDetails', - 'required' => true, - 'subobject' => true, - ), - 'PieceEvent' => array( - 'type' => 'PieceEvent', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/GB/Pieces.php b/DHL/Datatype/GB/Pieces.php deleted file mode 100644 index 1936863..0000000 --- a/DHL/Datatype/GB/Pieces.php +++ /dev/null @@ -1,51 +0,0 @@ - array( - 'type' => 'Piece', - 'required' => false, - 'subobject' => true, - 'multivalues' => true, - ), - ); -} diff --git a/DHL/Datatype/GB/Place.php b/DHL/Datatype/GB/Place.php deleted file mode 100644 index 8dcc0f6..0000000 --- a/DHL/Datatype/GB/Place.php +++ /dev/null @@ -1,111 +0,0 @@ - array( - 'type' => 'ResidenceOrBusiness', - 'required' => false, - 'subobject' => false, - 'comment' => 'Identifies if a location is a business, residence, - or both (B:Business, R:Residence, C:Business Residence)', - 'length' => '1', - 'enumeration' => 'B,R,C', - ), - 'CompanyName' => array( - 'type' => 'CompanyNameValidator', - 'required' => false, - 'subobject' => false, - 'comment' => 'Name of company / business', - 'minLength' => '0', - 'maxLength' => '35', - ), - 'AddressLine' => array( - 'type' => 'AddressLine', - 'required' => true, - 'subobject' => false, - 'comment' => 'Address Line', - 'maxLength' => '35', - ), - 'City' => array( - 'type' => 'City', - 'required' => false, - 'subobject' => false, - 'comment' => 'City name', - 'maxLength' => '35', - ), - 'CountryCode' => array( - 'type' => 'CountryCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO country codes', - 'length' => '2', - ), - 'DivisionCode' => array( - 'type' => 'StateCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'Division (state) code.', - 'maxLength' => '35', - ), - 'Division' => array( - 'type' => 'State', - 'required' => false, - 'subobject' => false, - 'comment' => 'State', - 'maxLength' => '35', - ), - 'PostalCode' => array( - 'type' => 'PostalCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'Full postal/zip code for address', - 'maxLength' => '12', - ), - 'PackageLocation' => array( - 'type' => 'PackageLocation', - 'required' => false, - 'subobject' => false, - 'comment' => 'PackageLocation', - 'maxLength' => '40', - ), - ); -} diff --git a/DHL/Datatype/GB/QtdSInAdCur.php b/DHL/Datatype/GB/QtdSInAdCur.php deleted file mode 100644 index 0987fd3..0000000 --- a/DHL/Datatype/GB/QtdSInAdCur.php +++ /dev/null @@ -1,76 +0,0 @@ - array( - 'type' => 'CurrencyCode', - 'required' => true, - 'subobject' => false, - 'comment' => 'ISO currency code', - 'length' => '3', - ), - 'CurrencyRoleTypeCode' => array( - 'type' => 'CurrencyRoleTypeCode', - 'required' => true, - 'subobject' => false, - 'comment' => 'CurrencyRoleTypeCode', - 'maxLength' => '6', - 'enumeration' => 'BILLC,BILLCU,PULCL,INVCU,BASEC', - ), - 'PackageCharge' => array( - 'type' => 'PackageCharge', - 'required' => true, - 'subobject' => false, - 'comment' => 'PackageCharge', - 'fractionDigits' => '3', - 'totalDigits' => '18', - ), - 'ShippingCharge' => array( - 'type' => 'ShippingCharge', - 'required' => true, - 'subobject' => false, - 'comment' => 'ShippingCharge', - 'fractionDigits' => '3', - 'totalDigits' => '18', - ), - ); -} diff --git a/DHL/Datatype/GB/Reference.php b/DHL/Datatype/GB/Reference.php deleted file mode 100644 index c830a0f..0000000 --- a/DHL/Datatype/GB/Reference.php +++ /dev/null @@ -1,59 +0,0 @@ - array( - 'type' => 'ReferenceID', - 'required' => false, - 'subobject' => false, - 'comment' => 'Shipper reference ID', - 'maxLength' => '35', - ), - 'ReferenceType' => array( - 'type' => 'ReferenceType', - 'required' => false, - 'subobject' => false, - 'comment' => 'Shipment reference type', - 'length' => '2', - ), - ); -} diff --git a/DHL/Datatype/GB/Request.php b/DHL/Datatype/GB/Request.php deleted file mode 100644 index 452896b..0000000 --- a/DHL/Datatype/GB/Request.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'type' => 'ServiceHeader', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/GB/Requestor.php b/DHL/Datatype/GB/Requestor.php deleted file mode 100644 index e034ce4..0000000 --- a/DHL/Datatype/GB/Requestor.php +++ /dev/null @@ -1,112 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'Account type', - ), - 'AccountNumber' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'Account number', - ), - - - - 'PackageType' => array( - 'type' => 'PackageType', - 'required' => false, - 'subobject' => false, - 'comment' => 'Package Type (EE: DHL Express Envelope, OD:Other - DHL Packaging, CP:Customer-provided, JB-Jumbo box, JJ-Junior jumbo - Box, DF-DHL Flyer, YP-Your packaging)', - 'length' => '2', - 'enumeration' => 'BD,BP,CP,DC,DF,DM,ED,EE,FR,JB,JD,JJ,JP,OD,PA,YP', - ), - 'Weight' => array( - 'type' => 'Weight', - 'required' => false, - 'subobject' => false, - 'comment' => 'Weight of piece or shipment', - 'fractionDigits' => '3', - 'minInclusive' => '0.000', - 'maxInclusive' => '999999.999', - 'totalDigits' => '10', - ), - 'DimWeight' => array( - 'type' => 'Weight', - 'required' => false, - 'subobject' => false, - 'comment' => 'Weight of piece or shipment', - 'fractionDigits' => '3', - 'minInclusive' => '0.000', - 'maxInclusive' => '999999.999', - 'totalDigits' => '10', - ), - 'Width' => array( - 'type' => 'positiveInteger', - 'required' => false, - 'subobject' => false, - ), - 'Height' => array( - 'type' => 'positiveInteger', - 'required' => false, - 'subobject' => false, - ), - 'Depth' => array( - 'type' => 'positiveInteger', - 'required' => false, - 'subobject' => false, - ), - 'RequestorContents' => array( - 'type' => 'RequestorContents', - 'required' => false, - 'subobject' => false, - 'comment' => 'Requestor contents description', - 'maxLength' => '35', - ), - ); -} diff --git a/DHL/Datatype/GB/Response.php b/DHL/Datatype/GB/Response.php deleted file mode 100644 index b048ac4..0000000 --- a/DHL/Datatype/GB/Response.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'type' => 'ResponseServiceHeader', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/GB/ResponseServiceHeader.php b/DHL/Datatype/GB/ResponseServiceHeader.php deleted file mode 100644 index af16f72..0000000 --- a/DHL/Datatype/GB/ResponseServiceHeader.php +++ /dev/null @@ -1,66 +0,0 @@ - array( - 'type' => 'dateTime', - 'required' => false, - 'subobject' => false, - ), - 'MessageReference' => array( - 'type' => 'MessageReference', - 'required' => false, - 'subobject' => false, - 'comment' => 'Reference to the requested Message', - 'minLength' => '28', - 'maxLength' => '32', - ), - 'SiteID' => array( - 'type' => 'SiteID', - 'required' => false, - 'subobject' => false, - 'comment' => 'Site ID used for verifying the sender', - 'minLength' => '6', - 'maxLength' => '20', - ), - ); -} diff --git a/DHL/Datatype/GB/ServiceArea.php b/DHL/Datatype/GB/ServiceArea.php deleted file mode 100644 index 0c49316..0000000 --- a/DHL/Datatype/GB/ServiceArea.php +++ /dev/null @@ -1,57 +0,0 @@ - array( - 'type' => 'ServiceAreaCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'DHL service area code', - 'length' => '3', - ), - 'Description' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/GB/ServiceEvent.php b/DHL/Datatype/GB/ServiceEvent.php deleted file mode 100644 index 5fe18bf..0000000 --- a/DHL/Datatype/GB/ServiceEvent.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'Description' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/GB/ServiceHeader.php b/DHL/Datatype/GB/ServiceHeader.php deleted file mode 100644 index a567d59..0000000 --- a/DHL/Datatype/GB/ServiceHeader.php +++ /dev/null @@ -1,74 +0,0 @@ - array( - 'type' => 'dateTime', - 'required' => false, - 'subobject' => false, - ), - 'MessageReference' => array( - 'type' => 'MessageReference', - 'required' => false, - 'subobject' => false, - 'comment' => 'Reference to the requested Message', - 'minLength' => '28', - 'maxLength' => '32', - ), - 'SiteID' => array( - 'type' => 'SiteID', - 'required' => false, - 'subobject' => false, - 'comment' => 'Site ID used for verifying the sender', - 'minLength' => '6', - 'maxLength' => '20', - ), - 'Password' => array( - 'type' => 'Password', - 'required' => false, - 'subobject' => false, - 'comment' => 'Password used for verifying the sender', - 'minLength' => '8', - 'maxLength' => '20', - ), - ); -} diff --git a/DHL/Datatype/GB/ShipValResponsePieces.php b/DHL/Datatype/GB/ShipValResponsePieces.php deleted file mode 100644 index 9913697..0000000 --- a/DHL/Datatype/GB/ShipValResponsePieces.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'type' => 'ShipValResponsePiece', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/GB/ShipmentDate.php b/DHL/Datatype/GB/ShipmentDate.php deleted file mode 100644 index 4a170c7..0000000 --- a/DHL/Datatype/GB/ShipmentDate.php +++ /dev/null @@ -1,59 +0,0 @@ - array( - 'type' => 'Date', - 'required' => false, - 'subobject' => false, - 'comment' => 'Date only', - 'pattern' => '[0-9][0-9][0-9][0-9](-)[0-9][0-9](-)[0-9][0-9]', - ), - 'ShipmentDateTo' => array( - 'type' => 'Date', - 'required' => false, - 'subobject' => false, - 'comment' => 'Date only', - 'pattern' => '[0-9][0-9][0-9][0-9](-)[0-9][0-9](-)[0-9][0-9]', - ), - ); -} diff --git a/DHL/Datatype/GB/ShipmentEvent.php b/DHL/Datatype/GB/ShipmentEvent.php deleted file mode 100644 index b87ed93..0000000 --- a/DHL/Datatype/GB/ShipmentEvent.php +++ /dev/null @@ -1,70 +0,0 @@ - array( - 'type' => 'date', - 'required' => false, - 'subobject' => false, - ), - 'Time' => array( - 'type' => 'time', - 'required' => false, - 'subobject' => false, - ), - 'ServiceEvent' => array( - 'type' => 'ServiceEvent', - 'required' => false, - 'subobject' => true, - ), - 'Signatory' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'ServiceArea' => array( - 'type' => 'ServiceArea', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/GB/ShipmentInfo.php b/DHL/Datatype/GB/ShipmentInfo.php deleted file mode 100644 index 290b667..0000000 --- a/DHL/Datatype/GB/ShipmentInfo.php +++ /dev/null @@ -1,102 +0,0 @@ - array( - 'type' => 'ServiceArea', - 'required' => false, - 'subobject' => true, - ), - 'DestinationServiceArea' => array( - 'type' => 'ServiceArea', - 'required' => false, - 'subobject' => true, - ), - 'ShipperName' => array( - 'type' => 'PersonName', - 'required' => false, - 'subobject' => false, - 'comment' => 'Name', - 'maxLength' => '35', - ), - 'ShipperAccountNumber' => array( - 'type' => 'AccountNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'DHL Account Number', - 'maxLength' => '12', - ), - 'ConsigneeName' => array( - 'type' => 'PersonName', - 'required' => false, - 'subobject' => false, - 'comment' => 'Name', - 'maxLength' => '35', - ), - 'ShipmentDate' => array( - 'type' => 'dateTime', - 'required' => false, - 'subobject' => true, - ), - 'Pieces' => array( - 'type' => 'Piece', - 'required' => false, - 'subobject' => true, - 'multivalues' => true, - ), - 'Weight' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'WeightUnit' => array( - 'type' => '', - 'required' => false, - 'subobject' => false, - ), - 'EstDlvyDate' => array( - 'type' => 'dateTime', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Datatype/GB/Status.php b/DHL/Datatype/GB/Status.php deleted file mode 100644 index e37d7de..0000000 --- a/DHL/Datatype/GB/Status.php +++ /dev/null @@ -1,55 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Condition' => array( - 'type' => 'Condition', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/GB/TrackingPieces.php b/DHL/Datatype/GB/TrackingPieces.php deleted file mode 100644 index abd9c3c..0000000 --- a/DHL/Datatype/GB/TrackingPieces.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'type' => 'PieceInfo', - 'required' => true, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Datatype/GB/WeightSeg.php b/DHL/Datatype/GB/WeightSeg.php deleted file mode 100644 index 3369380..0000000 --- a/DHL/Datatype/GB/WeightSeg.php +++ /dev/null @@ -1,64 +0,0 @@ - array( - 'type' => 'Weight', - 'required' => false, - 'subobject' => false, - 'comment' => 'Weight of piece or shipment', - 'fractionDigits' => '3', - 'minInclusive' => '0.000', - 'maxInclusive' => '999999.999', - 'totalDigits' => '10', - ), - 'WeightUnit' => array( - 'type' => 'WeightUnit', - 'required' => false, - 'subobject' => false, - 'comment' => 'Unit of weight measurement (K:KiloGram)', - 'minLength' => '0', - 'maxLength' => '1', - 'enumeration' => 'K,L', - ), - ); -} diff --git a/DHL/Entity/AM/BookPickupRequest.php b/DHL/Entity/AM/BookPickupRequest.php deleted file mode 100644 index 0a13a11..0000000 --- a/DHL/Entity/AM/BookPickupRequest.php +++ /dev/null @@ -1,92 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Place' => array( - 'type' => 'Place', - 'required' => false, - 'subobject' => true, - ), - 'Pickup' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'PickupContact' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'ShipmentDetails' => array( - 'type' => 'ShipmentDetails', - 'required' => false, - 'subobject' => true, - ), - 'PickupType' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'LargestPiece' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Entity/AM/CancelPickupRequest.php b/DHL/Entity/AM/CancelPickupRequest.php deleted file mode 100644 index 3533b5f..0000000 --- a/DHL/Entity/AM/CancelPickupRequest.php +++ /dev/null @@ -1,84 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'minInclusive' => '1', - 'maxInclusive' => '999999999', - ), - 'RequestorName' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'maxLength' => '35', - ), - 'OriginSvcArea' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'maxLength' => '5', - ), - 'Reason' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'maxLength' => '3', - 'minLength' => '3', - 'enumeration' => '001,002,003,004,005,006,007,008', - ), - ); -} diff --git a/DHL/Entity/AM/DCTRequest.php b/DHL/Entity/AM/DCTRequest.php deleted file mode 100644 index a70aca9..0000000 --- a/DHL/Entity/AM/DCTRequest.php +++ /dev/null @@ -1,64 +0,0 @@ - array( - 'type' => 'GetCapability', - 'required' => false, - 'subobject' => true, - 'multivalues' => false, - 'minOccurs' => 0, - ), - ); -} diff --git a/DHL/Entity/AM/ErrorResponse.php b/DHL/Entity/AM/ErrorResponse.php deleted file mode 100644 index bf0584a..0000000 --- a/DHL/Entity/AM/ErrorResponse.php +++ /dev/null @@ -1,62 +0,0 @@ - array( - 'type' => 'Response', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Entity/AM/GetCapability.php b/DHL/Entity/AM/GetCapability.php deleted file mode 100644 index 534bad5..0000000 --- a/DHL/Entity/AM/GetCapability.php +++ /dev/null @@ -1,85 +0,0 @@ - array( - 'type' => 'DCTFrom', - 'required' => false, - 'subobject' => true, - 'multivalues' => false, - 'minOccurs' => 1, - ), - 'BkgDetails' => array( - 'type' => 'BkgDetailsType', - 'required' => false, - 'subobject' => true, - 'multivalues' => false, - 'minOccurs' => 1, - ), - 'To' => array( - 'type' => 'DCTTo', - 'required' => false, - 'subobject' => true, - 'multivalues' => false, - 'minOccurs' => 1, - ), - 'Dutiable' => array( - 'type' => 'DCTDutiable', - 'required' => false, - 'subobject' => true, - 'multivalues' => false, - 'minOccurs' => 0, - ), - ); -} diff --git a/DHL/Entity/AM/GetQuote.php b/DHL/Entity/AM/GetQuote.php deleted file mode 100644 index 6e00f01..0000000 --- a/DHL/Entity/AM/GetQuote.php +++ /dev/null @@ -1,85 +0,0 @@ - array( - 'type' => 'DCTFrom', - 'required' => false, - 'subobject' => true, - 'multivalues' => false, - 'minOccurs' => 1, - ), - 'BkgDetails' => array( - 'type' => 'BkgDetailsType', - 'required' => false, - 'subobject' => true, - 'multivalues' => false, - 'minOccurs' => 1, - ), - 'To' => array( - 'type' => 'DCTTo', - 'required' => false, - 'subobject' => true, - 'multivalues' => false, - 'minOccurs' => 1, - ), - 'Dutiable' => array( - 'type' => 'DCTDutiable', - 'required' => false, - 'subobject' => true, - 'multivalues' => false, - 'minOccurs' => 0, - ), - ); -} diff --git a/DHL/Entity/AM/ModifyPickupRequest.php b/DHL/Entity/AM/ModifyPickupRequest.php deleted file mode 100644 index b9e4b1e..0000000 --- a/DHL/Entity/AM/ModifyPickupRequest.php +++ /dev/null @@ -1,90 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'minInclusive' => '1', - 'maxInclusive' => '999999999', - ), - 'Requestor' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Place' => array( - 'type' => 'Place', - 'required' => false, - 'subobject' => true, - ), - 'Pickup' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'PickupContact' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'OriginSvcArea' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'maxLength' => '5', - ), - ); -} diff --git a/DHL/Entity/AM/PickupErrorResponse.php b/DHL/Entity/AM/PickupErrorResponse.php deleted file mode 100644 index 00423c3..0000000 --- a/DHL/Entity/AM/PickupErrorResponse.php +++ /dev/null @@ -1,62 +0,0 @@ - array( - 'type' => 'Response', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Entity/AM/PickupResponse.php b/DHL/Entity/AM/PickupResponse.php deleted file mode 100644 index 5d7972d..0000000 --- a/DHL/Entity/AM/PickupResponse.php +++ /dev/null @@ -1,125 +0,0 @@ - array( - 'type' => 'Response', - 'required' => false, - 'subobject' => true, - ), - 'Note' => array( - 'type' => 'Note', - 'required' => false, - 'subobject' => true, - ), - 'ConfirmationNumber' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'minInclusive' => '1', - 'maxInclusive' => '999999999', - ), - 'ReadyByTime' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'SecondReadyByTime' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'NextPickupDate' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'PickupCharge' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'CurrencyCode' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO currency code', - 'length' => '3', - ), - 'CallInTime' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'SecondCallInTime' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'OriginSvcArea' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'minLength' => '3', - 'maxLength' => '3', - ), - 'CountryCode' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO country codes', - 'length' => '2', - ), - ); -} diff --git a/DHL/Entity/AM/RoutingErrorResponse.php b/DHL/Entity/AM/RoutingErrorResponse.php deleted file mode 100644 index 009038a..0000000 --- a/DHL/Entity/AM/RoutingErrorResponse.php +++ /dev/null @@ -1,62 +0,0 @@ - array( - 'type' => 'Response', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Entity/AM/RoutingResponse.php b/DHL/Entity/AM/RoutingResponse.php deleted file mode 100644 index d2719da..0000000 --- a/DHL/Entity/AM/RoutingResponse.php +++ /dev/null @@ -1,86 +0,0 @@ - array( - 'type' => 'Response', - 'required' => false, - 'subobject' => true, - ), - 'GMTNegativeIndicator' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'GMTOffset' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'RegionCode' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'RegionCode', - 'minLength' => '2', - 'maxLength' => '2', - 'enumeration' => 'AP,EA,AM', - ), - 'ServiceArea' => array( - 'type' => 'ServiceArea', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Entity/AM/ShipmentBookRatingRequest.php b/DHL/Entity/AM/ShipmentBookRatingRequest.php deleted file mode 100644 index e7f12e2..0000000 --- a/DHL/Entity/AM/ShipmentBookRatingRequest.php +++ /dev/null @@ -1,77 +0,0 @@ - array( - 'type' => 'Shipper', - 'required' => false, - 'subobject' => true, - ), - 'Consignee' => array( - 'type' => 'Consignee', - 'required' => false, - 'subobject' => true, - ), - 'ShipmentDetails' => array( - 'type' => 'ShipmentDetails', - 'required' => false, - 'subobject' => true, - ), - 'SpecialService' => array( - 'type' => 'SpecialService', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Entity/AM/ShipmentCustRatingRequest.php b/DHL/Entity/AM/ShipmentCustRatingRequest.php deleted file mode 100644 index c1e5055..0000000 --- a/DHL/Entity/AM/ShipmentCustRatingRequest.php +++ /dev/null @@ -1,82 +0,0 @@ - array( - 'type' => 'Billing', - 'required' => false, - 'subobject' => true, - ), - 'Shipper' => array( - 'type' => 'Shipper', - 'required' => false, - 'subobject' => true, - ), - 'Consignee' => array( - 'type' => 'Consignee', - 'required' => false, - 'subobject' => true, - ), - 'ShipmentDetails' => array( - 'type' => 'ShipmentDetails', - 'required' => false, - 'subobject' => true, - ), - 'SpecialService' => array( - 'type' => 'SpecialService', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Entity/AM/ShipmentRatingErrorResponse.php b/DHL/Entity/AM/ShipmentRatingErrorResponse.php deleted file mode 100644 index 1ec3376..0000000 --- a/DHL/Entity/AM/ShipmentRatingErrorResponse.php +++ /dev/null @@ -1,62 +0,0 @@ - array( - 'type' => 'Response', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Entity/AM/ShipmentTrackingErrorResponse.php b/DHL/Entity/AM/ShipmentTrackingErrorResponse.php deleted file mode 100644 index 04886f4..0000000 --- a/DHL/Entity/AM/ShipmentTrackingErrorResponse.php +++ /dev/null @@ -1,62 +0,0 @@ - array( - 'type' => 'Response', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Entity/AM/ShipmentValidateErrorResponse.php b/DHL/Entity/AM/ShipmentValidateErrorResponse.php deleted file mode 100644 index f12a0c4..0000000 --- a/DHL/Entity/AM/ShipmentValidateErrorResponse.php +++ /dev/null @@ -1,62 +0,0 @@ - array( - 'type' => 'Response', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Entity/AM/TrackingResponse.php b/DHL/Entity/AM/TrackingResponse.php deleted file mode 100644 index ffb38ab..0000000 --- a/DHL/Entity/AM/TrackingResponse.php +++ /dev/null @@ -1,78 +0,0 @@ - array( - 'type' => 'Response', - 'required' => false, - 'subobject' => true, - ), - 'AWBInfo' => array( - 'type' => 'AWBInfo', - 'required' => false, - 'subobject' => true, - ), - 'Fault' => array( - 'type' => 'Fault', - 'required' => false, - 'subobject' => true, - ), - 'LanguageCode' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO Language Code', - ), - ); -} diff --git a/DHL/Entity/AM/UnknownTrackingRequest.php b/DHL/Entity/AM/UnknownTrackingRequest.php deleted file mode 100644 index 6c57685..0000000 --- a/DHL/Entity/AM/UnknownTrackingRequest.php +++ /dev/null @@ -1,88 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO Language Code', - ), - 'AccountNumber' => array( - 'type' => 'string', - 'required' => true, - 'subobject' => false, - 'comment' => 'DHL Account Number', - 'maxInclusive' => '9999999999', - 'minInclusive' => '100000000', - ), - 'ShipperReference' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'ShipmentDate' => array( - 'type' => 'ShipmentDate', - 'required' => false, - 'subobject' => true, - ), - 'CountryCode' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO country codes', - 'length' => '2', - ), - ); -} diff --git a/DHL/Entity/AP/BookPickupRequest.php b/DHL/Entity/AP/BookPickupRequest.php deleted file mode 100644 index d30b5da..0000000 --- a/DHL/Entity/AP/BookPickupRequest.php +++ /dev/null @@ -1,82 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Place' => array( - 'type' => 'Place', - 'required' => false, - 'subobject' => true, - ), - 'Pickup' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'PickupContact' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'ShipmentDetails' => array( - 'type' => 'ShipmentDetails', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Entity/AP/CancelPickupRequest.php b/DHL/Entity/AP/CancelPickupRequest.php deleted file mode 100644 index 66e37e0..0000000 --- a/DHL/Entity/AP/CancelPickupRequest.php +++ /dev/null @@ -1,91 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'minInclusive' => '1', - 'maxInclusive' => '999999999', - ), - 'RequestorName' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'maxLength' => '35', - ), - 'CountryCode' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO country codes', - 'maxLength' => '2', - ), - 'OriginSvcArea' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'maxLength' => '5', - ), - 'Reason' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'maxLength' => '3', - 'minLength' => '3', - 'enumeration' => '001,002,003,004,005,006,007,008', - ), - ); -} diff --git a/DHL/Entity/AP/ErrorResponse.php b/DHL/Entity/AP/ErrorResponse.php deleted file mode 100644 index e019992..0000000 --- a/DHL/Entity/AP/ErrorResponse.php +++ /dev/null @@ -1,62 +0,0 @@ - array( - 'type' => 'Response', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Entity/AP/KnownTrackingRequest.php b/DHL/Entity/AP/KnownTrackingRequest.php deleted file mode 100644 index d7a4e52..0000000 --- a/DHL/Entity/AP/KnownTrackingRequest.php +++ /dev/null @@ -1,96 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO Language Code', - ), - 'AWBNumber' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'Airway bill number', - 'maxLength' => '11', - ), - 'LPNumber' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'LevelOfDetails' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'Checkpoint details selection flag', - 'enumeration' => 'LAST_CHECK_POINT_ONLY,ALL_CHECK_POINTS', - ), - 'PiecesEnabled' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'Pieces Enabling Flag', - 'enumeration' => 'S,B,P', - ), - 'CountryCode' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO country codes', - 'length' => '2', - ), - ); -} diff --git a/DHL/Entity/AP/ModifyPickupRequest.php b/DHL/Entity/AP/ModifyPickupRequest.php deleted file mode 100644 index d438674..0000000 --- a/DHL/Entity/AP/ModifyPickupRequest.php +++ /dev/null @@ -1,90 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'minInclusive' => '1', - 'maxInclusive' => '999999999', - ), - 'Requestor' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Place' => array( - 'type' => 'Place', - 'required' => false, - 'subobject' => true, - ), - 'Pickup' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'PickupContact' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'OriginSvcArea' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'maxLength' => '5', - ), - ); -} diff --git a/DHL/Entity/AP/PickupErrorResponse.php b/DHL/Entity/AP/PickupErrorResponse.php deleted file mode 100644 index 2aec129..0000000 --- a/DHL/Entity/AP/PickupErrorResponse.php +++ /dev/null @@ -1,62 +0,0 @@ - array( - 'type' => 'Response', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Entity/AP/PickupResponse.php b/DHL/Entity/AP/PickupResponse.php deleted file mode 100644 index c0410d0..0000000 --- a/DHL/Entity/AP/PickupResponse.php +++ /dev/null @@ -1,125 +0,0 @@ - array( - 'type' => 'Response', - 'required' => false, - 'subobject' => true, - ), - 'Note' => array( - 'type' => 'Note', - 'required' => false, - 'subobject' => true, - ), - 'ConfirmationNumber' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'minInclusive' => '1', - 'maxInclusive' => '999999999', - ), - 'ReadyByTime' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'SecondReadyByTime' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'NextPickupDate' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'PickupCharge' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'CurrencyCode' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO currency code', - 'length' => '3', - ), - 'CallInTime' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'SecondCallInTime' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'OriginSvcArea' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'minLength' => '3', - 'maxLength' => '3', - ), - 'CountryCode' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO country codes', - 'length' => '2', - ), - ); -} diff --git a/DHL/Entity/AP/RoutingErrorResponse.php b/DHL/Entity/AP/RoutingErrorResponse.php deleted file mode 100644 index d03c8cd..0000000 --- a/DHL/Entity/AP/RoutingErrorResponse.php +++ /dev/null @@ -1,62 +0,0 @@ - array( - 'type' => 'Response', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Entity/AP/RoutingRequest.php b/DHL/Entity/AP/RoutingRequest.php deleted file mode 100644 index 3d41500..0000000 --- a/DHL/Entity/AP/RoutingRequest.php +++ /dev/null @@ -1,118 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'length' => '1', - 'enumeration' => 'O,D', - ), - 'Address1' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Address2' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Address3' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'PostalCode' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'Full postal/zip code for address', - ), - 'City' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'City name', - 'maxLength' => '35', - ), - 'Division' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'Division (e.g. state, prefecture, etc.) name', - 'maxLength' => '35', - ), - 'CountryCode' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO country codes', - 'length' => '2', - ), - 'CountryName' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO country name', - 'maxLength' => '35', - ), - 'OriginCountryCode' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Entity/AP/RoutingResponse.php b/DHL/Entity/AP/RoutingResponse.php deleted file mode 100644 index fd7b42d..0000000 --- a/DHL/Entity/AP/RoutingResponse.php +++ /dev/null @@ -1,86 +0,0 @@ - array( - 'type' => 'Response', - 'required' => false, - 'subobject' => true, - ), - 'GMTNegativeIndicator' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'GMTOffset' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'RegionCode' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'RegionCode', - 'minLength' => '2', - 'maxLength' => '2', - 'enumeration' => 'AP,EA,AM', - ), - 'ServiceArea' => array( - 'type' => 'ServiceArea', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Entity/AP/ShipmentTrackingErrorResponse.php b/DHL/Entity/AP/ShipmentTrackingErrorResponse.php deleted file mode 100644 index ea2f0e9..0000000 --- a/DHL/Entity/AP/ShipmentTrackingErrorResponse.php +++ /dev/null @@ -1,62 +0,0 @@ - array( - 'type' => 'Response', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Entity/AP/ShipmentValidateErrorResponse.php b/DHL/Entity/AP/ShipmentValidateErrorResponse.php deleted file mode 100644 index d3d6590..0000000 --- a/DHL/Entity/AP/ShipmentValidateErrorResponse.php +++ /dev/null @@ -1,62 +0,0 @@ - array( - 'type' => 'Response', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Entity/AP/TrackingResponse.php b/DHL/Entity/AP/TrackingResponse.php deleted file mode 100644 index 914ac6e..0000000 --- a/DHL/Entity/AP/TrackingResponse.php +++ /dev/null @@ -1,78 +0,0 @@ - array( - 'type' => 'Response', - 'required' => false, - 'subobject' => true, - ), - 'AWBInfo' => array( - 'type' => 'AWBInfo', - 'required' => false, - 'subobject' => true, - ), - 'Fault' => array( - 'type' => 'Fault', - 'required' => false, - 'subobject' => true, - ), - 'LanguageCode' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO Language Code', - ), - ); -} diff --git a/DHL/Entity/AP/UnknownTrackingRequest.php b/DHL/Entity/AP/UnknownTrackingRequest.php deleted file mode 100644 index ee2abd3..0000000 --- a/DHL/Entity/AP/UnknownTrackingRequest.php +++ /dev/null @@ -1,88 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO Language Code', - ), - 'AccountNumber' => array( - 'type' => 'string', - 'required' => true, - 'subobject' => false, - 'comment' => 'DHL Account Number', - 'maxInclusive' => '9999999999', - 'minInclusive' => '100000000', - ), - 'ShipperReference' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'ShipmentDate' => array( - 'type' => 'ShipmentDate', - 'required' => false, - 'subobject' => true, - ), - 'CountryCode' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO country codes', - 'length' => '2', - ), - ); -} diff --git a/DHL/Entity/Base.php b/DHL/Entity/Base.php deleted file mode 100644 index 7a568b3..0000000 --- a/DHL/Entity/Base.php +++ /dev/null @@ -1,364 +0,0 @@ - array( - 'type' => 'date-iso8601', - 'required' => true, - ), - 'MessageReference' => array( - 'type' => 'string', - 'required' => true, - 'size' => 28, - ), - 'SiteID' => array( - 'type' => 'string', - 'required' => true, - ), - 'Password' => array( - 'type' => 'string', - 'required' => true, - ), - ); - - /** - * Parameters to be used in the body - * @var array - */ - protected $_bodyParams = array(); - - /** - * Name of the service - * @var string - */ - protected $_serviceName = null; - - /** - * @var string - * Service XSD - */ - protected $_serviceXSD = null; - - /** - * @var boolean - * Is object a subobject or not - */ - protected $_isSubobject = null; - - /** - * @var string - * The schema version - */ - protected $_schemaVersion = '1.0'; - - /** - * @var boolean - * Render the schema version or not - */ - protected $_displaySchemaVersion = false; - - /** - * Parent node name of the object - * @var string - */ - protected $_xmlNodeName = null; - - /** - * Class constants - */ - const DHL_REQ = 'http://www.dhl.com'; - const DHL_XSI = 'http://www.w3.org/2001/XMLSchema-instance'; - - /** - * Class constructor - */ - public function __construct() - { - $this->_params = array_merge($this->_headerParams, $this->_bodyParams); - $this->initializeValues(); - } - - /** - * Generates the XML to be sent to DHL - * - * @param \XMLWriter $xmlWriter XMl Writer instance - * - * @return string - */ - public function toXML(\XMLWriter $xmlWriter = null) - { - $this->validateParameters(); - - $xmlWriter = new \XMLWriter(); - $xmlWriter->openMemory(); - $xmlWriter->setIndent(true); - $xmlWriter->startDocument('1.0', 'UTF-8'); - - $xmlWriter->startElement('req:' . $this->_serviceName); - $xmlWriter->writeAttribute('xmlns:req', self::DHL_REQ); - $xmlWriter->writeAttribute('xmlns:xsi', self::DHL_XSI); - $xmlWriter->writeAttribute('xsi:schemaLocation', self::DHL_REQ . ' ' .$this->_serviceXSD); - - if ($this->_displaySchemaVersion) - { - $xmlWriter->writeAttribute('schemaVersion', $this->_schemaVersion); - } - - if (null !== $this->_xmlNodeName) - { - $xmlWriter->startElement($this->_xmlNodeName); - } - - $xmlWriter->startElement('Request'); - $xmlWriter->startElement('ServiceHeader'); - foreach ($this->_headerParams as $name => $infos) - { - $xmlWriter->writeElement($name, $this->$name); - } - $xmlWriter->endElement(); // End of Request - $xmlWriter->endElement(); // End of ServiceHeader - - foreach ($this->_bodyParams as $name => $infos) - { - if ($this->$name) - { - if (is_object($this->$name)) - { - $this->$name->toXML($xmlWriter); - } - elseif (is_array($this->$name)) - { - if ('string' == $this->_params[$name]['type']) - { - foreach ($this->$name as $subelement) - { - $xmlWriter->writeElement($name, $subelement); - } - } - else - { - if (!isset($this->_params[$name]['disableParentNode']) || false == $this->_params[$name]['disableParentNode']) - { - $xmlWriter->startElement($name); - } - - foreach ($this->$name as $subelement) - { - $subelement->toXML($xmlWriter); - } - - if (!isset($this->_params[$name]['disableParentNode']) || false == $this->_params[$name]['disableParentNode']) - { - $xmlWriter->endElement(); - } - } - } - else - { - $xmlWriter->writeElement($name, $this->$name); - } - } - } - - $xmlWriter->endElement(); // End of parent node - - // End of class name tag - if (null !== $this->_xmlNodeName) - { - $xmlWriter->endElement(); - } - - $xmlWriter->endDocument(); - - return $xmlWriter->outputMemory(true); - } - - /** - * Initialize object from an XML string - * - * @param string $xml XML String - * - * @return void - * @throws \Exception Exception thrown if response returned has an error - */ - public function initFromXML($xml) - { - $xml = simplexml_load_string(str_replace('req:', '', $xml)); - - if ((string) $xml->Response->Status->Condition->ConditionCode != '') - { - $errorMsg = ((string) $xml->Response->Status->Condition->ConditionCode) . ' : ' . ((string) $xml->Response->Status->Condition->ConditionData); - throw new \Exception('Error returned from DHL webservice : ' . $errorMsg); - } - - $parts = explode('\\', get_class($this)); - $className = array_pop($parts); - foreach ($xml->children() as $child) - { - $childName = $child->getName(); - switch ($childName) - { - case 'Response': - $this->MessageTime = (string) $child->ServiceHeader->MessageTime; - $this->MessageReference = (string) $child->ServiceHeader->MessageReference; - $this->SiteID = (string) $child->ServiceHeader->SiteID; - $this->Password = '#'; - break; - - default: - if (is_object($this->$childName)) - { - $this->$childName->initFromXml($child->asXML()); - } - elseif (isset($this->_params[$childName]['multivalues']) && $this->_params[$childName]['multivalues']) - { - foreach ($child->children() as $subchild) - { - $subchildName = $subchild->getName(); - if ($subchild->count() > 1) - { - $subchildName .= 's'; - } - - $childClassname = implode('\\', $parts) . '\\' . $this->_params[$subchildName]['type']; - $childClassname = str_replace('Entity', 'Datatype', $childClassname); - - if ('string' == $this->_params[$subchildName]['type'] && ($subchild->count() <= 1)) - { - $childObj = trim((string) $subchild); - } - else - { - $childObj = new $childClassname(); - $childObj->initFromXml($subchild->asXML()); - } - - $addMethodName = 'add' . ucfirst($subchildName); - $this->$addMethodName($childObj); - } - } - elseif (isset($this->$childName)) - { - $this->$childName = trim((string) $child); - } - break; - } - } - } - /** - * Initialize property values bag - * - * @return void - */ - protected function initializeValues() - { - foreach ($this->_params as $name => $infos) - { - if (!$this->_isSubobject && isset($infos['subobject']) && $infos['subobject']) - { - if (isset($infos['multivalues']) && $infos['multivalues']) - { - $this->_values[$name] = array(); - } - else - { - $tmp = get_class($this); - $parts = explode('\\', $tmp); - array_pop($parts); - $className = implode('\\', $parts) . '\\' . $infos['type']; - $className = str_replace('Entity', 'Datatype', $className); - $this->_values[$name] = new $className(); - } - } - else - { - $this->_values[$name] = null; - } - } - } - - /** - * Validate all parameters - * - * @return boolean True upon success - * @throws \InvalidArgumentException Throws exception if type not valid or if value are missing - */ - protected function validateParameters() - { - foreach ($this->_params as $name => $infos) - { - if (isset($infos['required']) && true === $infos['required'] && $this->_values[$name] === null) - { - throw new \InvalidArgumentException('Field ' . $name . ' has no value'); - } - - if ($this->_values[$name]) - { - if (is_array($this->_values[$name])) - { - foreach ($this->_values[$name] as $subelement) - { - $subelement->validateParameters(); - } - } - else - { - $this->validateParameterType($name, $this->_values[$name]); - $this->validateParameterValue($name, $this->_values[$name]); - } - } - } - - if (null === $this->_serviceName) - { - throw new \InvalidArgumentException('Class ' . get_class($this) . ' must have a valid serviceName property defined'); - } - - return true; - } -} diff --git a/DHL/Entity/EA/BookPickupRequest.php b/DHL/Entity/EA/BookPickupRequest.php deleted file mode 100644 index 3cd8c16..0000000 --- a/DHL/Entity/EA/BookPickupRequest.php +++ /dev/null @@ -1,82 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Place' => array( - 'type' => 'Place', - 'required' => false, - 'subobject' => true, - ), - 'Pickup' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'PickupContact' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'ShipmentDetails' => array( - 'type' => 'ShipmentDetails', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Entity/EA/CancelPickupRequest.php b/DHL/Entity/EA/CancelPickupRequest.php deleted file mode 100644 index 3e903d2..0000000 --- a/DHL/Entity/EA/CancelPickupRequest.php +++ /dev/null @@ -1,96 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'minInclusive' => '1', - 'maxInclusive' => '999999999', - ), - 'RequestorName' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'maxLength' => '35', - ), - 'Reason' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'maxLength' => '3', - 'minLength' => '3', - 'enumeration' => '001,002,003,004,005,006,007', - ), - 'PickupDate' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'CountryCode' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO country codes', - 'maxLength' => '2', - 'minLength' => '2', - ), - 'CancelTime' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - ); -} diff --git a/DHL/Entity/EA/ErrorResponse.php b/DHL/Entity/EA/ErrorResponse.php deleted file mode 100644 index e1a43db..0000000 --- a/DHL/Entity/EA/ErrorResponse.php +++ /dev/null @@ -1,62 +0,0 @@ - array( - 'type' => 'Response', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Entity/EA/KnownTrackingRequest.php b/DHL/Entity/EA/KnownTrackingRequest.php deleted file mode 100644 index 1f5a6d5..0000000 --- a/DHL/Entity/EA/KnownTrackingRequest.php +++ /dev/null @@ -1,96 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO Language Code', - ), - 'AWBNumber' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'Airway bill number', - 'maxLength' => '11', - ), - 'LPNumber' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'LevelOfDetails' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'Checkpoint details selection flag', - 'enumeration' => 'LAST_CHECK_POINT_ONLY,ALL_CHECK_POINTS', - ), - 'PiecesEnabled' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'Pieces Enabling Flag', - 'enumeration' => 'S,B,P', - ), - 'CountryCode' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO country codes', - 'length' => '2', - ), - ); -} diff --git a/DHL/Entity/EA/PickupErrorResponse.php b/DHL/Entity/EA/PickupErrorResponse.php deleted file mode 100644 index eaee394..0000000 --- a/DHL/Entity/EA/PickupErrorResponse.php +++ /dev/null @@ -1,62 +0,0 @@ - array( - 'type' => 'Response', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Entity/EA/RoutingErrorResponse.php b/DHL/Entity/EA/RoutingErrorResponse.php deleted file mode 100644 index 35afe5c..0000000 --- a/DHL/Entity/EA/RoutingErrorResponse.php +++ /dev/null @@ -1,62 +0,0 @@ - array( - 'type' => 'Response', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Entity/EA/RoutingResponse.php b/DHL/Entity/EA/RoutingResponse.php deleted file mode 100644 index 097ab2d..0000000 --- a/DHL/Entity/EA/RoutingResponse.php +++ /dev/null @@ -1,86 +0,0 @@ - array( - 'type' => 'Response', - 'required' => false, - 'subobject' => true, - ), - 'GMTNegativeIndicator' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'GMTOffset' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'RegionCode' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'RegionCode', - 'minLength' => '2', - 'maxLength' => '2', - 'enumeration' => 'AP,EA,AM', - ), - 'ServiceArea' => array( - 'type' => 'ServiceArea', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Entity/EA/ShipmentTrackingErrorResponse.php b/DHL/Entity/EA/ShipmentTrackingErrorResponse.php deleted file mode 100644 index 52747ab..0000000 --- a/DHL/Entity/EA/ShipmentTrackingErrorResponse.php +++ /dev/null @@ -1,62 +0,0 @@ - array( - 'type' => 'Response', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Entity/EA/ShipmentValidateErrorResponse.php b/DHL/Entity/EA/ShipmentValidateErrorResponse.php deleted file mode 100644 index 7711ce0..0000000 --- a/DHL/Entity/EA/ShipmentValidateErrorResponse.php +++ /dev/null @@ -1,62 +0,0 @@ - array( - 'type' => 'Response', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Entity/EA/TrackingResponse.php b/DHL/Entity/EA/TrackingResponse.php deleted file mode 100644 index 707f6fe..0000000 --- a/DHL/Entity/EA/TrackingResponse.php +++ /dev/null @@ -1,78 +0,0 @@ - array( - 'type' => 'Response', - 'required' => false, - 'subobject' => true, - ), - 'AWBInfo' => array( - 'type' => 'AWBInfo', - 'required' => false, - 'subobject' => true, - ), - 'Fault' => array( - 'type' => 'Fault', - 'required' => false, - 'subobject' => true, - ), - 'LanguageCode' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO Language Code', - ), - ); -} diff --git a/DHL/Entity/EA/UnknownTrackingRequest.php b/DHL/Entity/EA/UnknownTrackingRequest.php deleted file mode 100644 index 207a3a1..0000000 --- a/DHL/Entity/EA/UnknownTrackingRequest.php +++ /dev/null @@ -1,88 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO Language Code', - ), - 'AccountNumber' => array( - 'type' => 'string', - 'required' => true, - 'subobject' => false, - 'comment' => 'DHL Account Number', - 'maxInclusive' => '9999999999', - 'minInclusive' => '100000000', - ), - 'ShipperReference' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'ShipmentDate' => array( - 'type' => 'ShipmentDate', - 'required' => false, - 'subobject' => true, - ), - 'CountryCode' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO country codes', - 'length' => '2', - ), - ); -} diff --git a/DHL/Entity/GB/BookPURequest.php b/DHL/Entity/GB/BookPURequest.php deleted file mode 100644 index 36bd85b..0000000 --- a/DHL/Entity/GB/BookPURequest.php +++ /dev/null @@ -1,91 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'RegionCode', - 'minLength' => '2', - 'maxLength' => '2', - 'enumeration' => 'AP,EU,AM', - ), - 'Requestor' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Place' => array( - 'type' => 'Place', - 'required' => false, - 'subobject' => true, - ), - 'Pickup' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'PickupContact' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'ShipmentDetails' => array( - 'type' => 'ShipmentDetails', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Entity/GB/ModifyPURequest.php b/DHL/Entity/GB/ModifyPURequest.php deleted file mode 100644 index e62a594..0000000 --- a/DHL/Entity/GB/ModifyPURequest.php +++ /dev/null @@ -1,99 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'RegionCode', - 'minLength' => '2', - 'maxLength' => '2', - 'enumeration' => 'AP,EU,AM', - ), - 'ConfirmationNumber' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'minInclusive' => '1', - 'maxInclusive' => '999999999', - ), - 'Requestor' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'Place' => array( - 'type' => 'Place', - 'required' => false, - 'subobject' => true, - ), - 'Pickup' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'PickupContact' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'OriginSvcArea' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'maxLength' => '5', - ), - ); -} diff --git a/DHL/Entity/GB/RouteResponse.php b/DHL/Entity/GB/RouteResponse.php deleted file mode 100644 index 0d5dfce..0000000 --- a/DHL/Entity/GB/RouteResponse.php +++ /dev/null @@ -1,86 +0,0 @@ - array( - 'type' => 'Response', - 'required' => false, - 'subobject' => true, - ), - 'RegionCode' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'RegionCode', - 'minLength' => '2', - 'maxLength' => '2', - 'enumeration' => 'AP,EU,AM', - ), - 'GMTNegativeIndicator' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'GMTOffset' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'ServiceArea' => array( - 'type' => 'ServiceArea', - 'required' => false, - 'subobject' => true, - ), - ); -} diff --git a/DHL/Entity/GB/TrackingResponse.php b/DHL/Entity/GB/TrackingResponse.php deleted file mode 100644 index c55044a..0000000 --- a/DHL/Entity/GB/TrackingResponse.php +++ /dev/null @@ -1,79 +0,0 @@ - array( - 'type' => 'Response', - 'required' => false, - 'subobject' => true, - ), - 'AWBInfo' => array( - 'type' => 'AWBInfo', - 'required' => false, - 'subobject' => true, - ), - 'Fault' => array( - 'type' => 'Fault', - 'required' => false, - 'subobject' => true, - ), - 'LanguageCode' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO Language Code', - 'maxLength' => '2', - ), - ); -} diff --git a/DHL/Entity/GB/UnknownTrackingRequest.php b/DHL/Entity/GB/UnknownTrackingRequest.php deleted file mode 100644 index 2c873da..0000000 --- a/DHL/Entity/GB/UnknownTrackingRequest.php +++ /dev/null @@ -1,88 +0,0 @@ - array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO Language Code', - 'maxLength' => '2', - ), - 'AccountNumber' => array( - 'type' => 'string', - 'required' => true, - 'subobject' => false, - 'comment' => 'DHL Account Number', - 'maxLength' => '12', - ), - 'ShipperReference' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - ), - 'ShipmentDate' => array( - 'type' => 'ShipmentDate', - 'required' => false, - 'subobject' => true, - ), - 'CountryCode' => array( - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'ISO country codes', - 'length' => '2', - ), - ); -} diff --git a/DHL/Service.php b/DHL/Service.php deleted file mode 100644 index 728ef44..0000000 --- a/DHL/Service.php +++ /dev/null @@ -1,79 +0,0 @@ -_client = $client; - } - - /** - * Send a shipment request to DHL - * - * @param ShipmentRequest Request to send - * - * @return ShipmentResponse The Shipment response object upon success, false otherwise - */ - public function sendShipmentRequest(ShipmentRequest $request) - { - // Call DHL XML API - try - { - $xml = $this->_client->call($request); - $response = new ShipmentResponse(); - $response->initFromXML($xml); - } - catch (\Exception $e) - { - $this->errorMessage = $e->getMessage(); - return false; - } - - return $response; - } -} diff --git a/README.md b/README.md deleted file mode 100644 index dde6120..0000000 --- a/README.md +++ /dev/null @@ -1,321 +0,0 @@ - -## Authors & contact - - -Al-Fallouji Bashar - - bashar@alfallouji.com - - -## Documentation and download - - -Latest version is available on github at : - - http://github.com/alfallouji/DHL-API/ - - -## License - - -``` -This Code is released under the GNU LGPL - -Please do not change the header of the file(s). - -This library is free software; you can redistribute it and/or modify it -under the terms of the GNU Lesser General Public License as published -by the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This library is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU Lesser General Public License for more details. -``` - - -## Description - - -This library is a PHP Oriented Object client for the DHL XML API Services. DHL XML Services is an online web services integration capability that provides DHL’s service availability, transit times, rates, shipment and courier pickup booking along with shipment tracking from over 140 countries around the world. Using DHL’s XML Services, customers can incorporate DHL shipping functionality into their websites, customer service applications or order processing systems. - - -## Setup - -You can use composer to use this library. - -```php -{ - "require": { - "alfallouji/dhl_api": "*" - } -} -``` - - -## Usage - -This client does not rely or depend on any framework and it should be fairly easy to integrate with your own code. You can use the autloader that is provided or your own autoloading mechanism. - -The sample folder contains examples on how to use the client and perform requests to DHL XML API, such as track a shipment, create a shipment, request a pickup or print labels. - -In order to have the samples working, you will need to create a DHL staging account. You can do that by going to that URL : http://www.dhl.com.au/en/express/resource_center/integrated_shipping_solutions/integrating_xml_services.html - -Then, you need to copy the conf/config.sample.php to conf/config.php (that file is loaded init.php). -You need to edit the dhl settings defined in the config/config.php file and provide your account id and password. The samples use those credentials. - -```php -return array( - 'dhl' => array( - 'id' => 'Your_DHL_ID', - 'pass' => 'Your_DHL_Password', - 'shipperAccountNumber' => 'Your_Number', - 'billingAccountNumber' => 'Your_Number', - 'dutyAccountNumber' => 'Your_Number', - ), -); -``` - -## Example - -### Request a shipment -```php -use DHL\Entity\GB\ShipmentResponse; -use DHL\Entity\GB\ShipmentRequest; -use DHL\Client\Web as WebserviceClient; -use DHL\Datatype\GB\Piece; -use DHL\Datatype\GB\SpecialService; - -// You may use your own init script, as long as it takes care of autoloading -require(__DIR__ . '/init.php'); - -// DHL settings -$dhl = $config['dhl']; - -// Test a ShipmentRequest using DHL XML API -$sample = new ShipmentRequest(); - -// Assuming there is a config array variable with id and pass to DHL XML Service -$sample->SiteID = $dhl['id']; -$sample->Password = $dhl['pass']; - -// Set values of the request -$sample->MessageTime = '2001-12-17T09:30:47-05:00'; -$sample->MessageReference = '1234567890123456789012345678901'; -$sample->RegionCode = 'AM'; -$sample->RequestedPickupTime = 'Y'; -$sample->NewShipper = 'Y'; -$sample->LanguageCode = 'en'; -$sample->PiecesEnabled = 'Y'; -$sample->Billing->ShipperAccountNumber = $dhl['shipperAccountNumber']; -$sample->Billing->ShippingPaymentType = 'S'; -$sample->Billing->BillingAccountNumber = $dhl['billingAccountNumber']; -$sample->Billing->DutyPaymentType = 'S'; -$sample->Billing->DutyAccountNumber = $dhl['dutyAccountNumber']; -$sample->Consignee->CompanyName = 'Ssense'; -$sample->Consignee->addAddressLine('333 Chabanel West, #900'); -$sample->Consignee->City = 'Montreal'; -$sample->Consignee->PostalCode = 'H3E1G6'; -$sample->Consignee->CountryCode = 'CA'; -$sample->Consignee->CountryName = 'Canada'; -$sample->Consignee->Contact->PersonName = 'Bashar Al-Fallouji'; -$sample->Consignee->Contact->PhoneNumber = '0435 336 653'; -$sample->Consignee->Contact->PhoneExtension = '123'; -$sample->Consignee->Contact->FaxNumber = '506-851-7403'; -$sample->Consignee->Contact->Telex = '506-851-7121'; -$sample->Consignee->Contact->Email = 'bashar@alfallouji.com'; -$sample->Commodity->CommodityCode = 'cc'; -$sample->Commodity->CommodityName = 'cn'; -$sample->Dutiable->DeclaredValue = '200.00'; -$sample->Dutiable->DeclaredCurrency = 'USD'; -$sample->Dutiable->ScheduleB = '3002905110'; -$sample->Dutiable->ExportLicense = 'D123456'; -$sample->Dutiable->ShipperEIN = '112233445566'; -$sample->Dutiable->ShipperIDType = 'S'; -$sample->Dutiable->ImportLicense = 'ALFAL'; -$sample->Dutiable->ConsigneeEIN = 'ConEIN2123'; -$sample->Dutiable->TermsOfTrade = 'DTP'; -$sample->Reference->ReferenceID = 'AM international shipment'; -$sample->Reference->ReferenceType = 'St'; -$sample->ShipmentDetails->NumberOfPieces = 2; - -$piece = new Piece(); -$piece->PieceID = '1'; -$piece->PackageType = 'EE'; -$piece->Weight = '5.0'; -$piece->DimWeight = '600.0'; -$piece->Width = '50'; -$piece->Height = '100'; -$piece->Depth = '150'; -$sample->ShipmentDetails->addPiece($piece); - -$piece = new Piece(); -$piece->PieceID = '2'; -$piece->PackageType = 'EE'; -$piece->Weight = '5.0'; -$piece->DimWeight = '600.0'; -$piece->Width = '50'; -$piece->Height = '100'; -$piece->Depth = '150'; -$sample->ShipmentDetails->addPiece($piece); - -$sample->ShipmentDetails->Weight = '10.0'; -$sample->ShipmentDetails->WeightUnit = 'L'; -$sample->ShipmentDetails->GlobalProductCode = 'P'; -$sample->ShipmentDetails->LocalProductCode = 'P'; -$sample->ShipmentDetails->Date = date('Y-m-d'); -$sample->ShipmentDetails->Contents = 'AM international shipment contents'; -$sample->ShipmentDetails->DoorTo = 'DD'; -$sample->ShipmentDetails->DimensionUnit = 'I'; -$sample->ShipmentDetails->InsuredAmount = '1200.00'; -$sample->ShipmentDetails->PackageType = 'EE'; -$sample->ShipmentDetails->IsDutiable = 'Y'; -$sample->ShipmentDetails->CurrencyCode = 'USD'; -$sample->Shipper->ShipperID = '751008818'; -$sample->Shipper->CompanyName = 'IBM Corporation'; -$sample->Shipper->RegisteredAccount = '751008818'; -$sample->Shipper->addAddressLine('1 New Orchard Road'); -$sample->Shipper->addAddressLine('Armonk'); -$sample->Shipper->City = 'New York'; -$sample->Shipper->Division = 'ny'; -$sample->Shipper->DivisionCode = 'ny'; -$sample->Shipper->PostalCode = '10504'; -$sample->Shipper->CountryCode = 'US'; -$sample->Shipper->CountryName = 'United States Of America'; -$sample->Shipper->Contact->PersonName = 'Mr peter'; -$sample->Shipper->Contact->PhoneNumber = '1 905 8613402'; -$sample->Shipper->Contact->PhoneExtension = '3403'; -$sample->Shipper->Contact->FaxNumber = '1 905 8613411'; -$sample->Shipper->Contact->Telex = '1245'; -$sample->Shipper->Contact->Email = 'test@email.com'; - -$specialService = new SpecialService(); -$specialService->SpecialServiceType = 'A'; -$sample->addSpecialService($specialService); - -$specialService = new SpecialService(); -$specialService->SpecialServiceType = 'I'; -$sample->addSpecialService($specialService); - -$sample->EProcShip = 'N'; -$sample->LabelImageFormat = 'PDF'; - -// Call DHL XML API -$start = microtime(true); - -// Display the XML that will be sent to DHL -echo $sample->toXML(); - -// DHL webservice client using the staging environment -$client = new WebserviceClient('staging'); - -// Call the DHL service and display the XML result -echo $client->call($sample); -echo PHP_EOL . 'Executed in ' . (microtime(true) - $start) . ' seconds.' . PHP_EOL; -``` - -### How to display or store the PDF label ? - -The label is encoded using base64 encoding. - -If you would like to get the binary version in order to store it as .PDF or to display it on the browser, you will need to decode it. - -For example, the image label is returned in the LabelImage->OutputImage node. - -```xml - - -.... - - - PDF......JVBERi0xLjQKJ..... - - -``` - -In PHP, you will need to do the following in order to decode the string. - -```php -// We already built our DHL request object, we can call DHL XML API -$client = new WebserviceClient('staging'); -$xml = $client->call($request); -$response = new ShipmentResponse(); -$response->initFromXML($xml); - -// Store it as a . PDF file in the filesystem -file_put_contents('dhl-label.pdf', base64_decode($response->LabelImage->OutputImage)); - -// If you want to display it in the browser -$data = base64_decode($response->LabelImage->OutputImage); -if ($data) -{ - header('Content-Type: application/pdf'); - header('Content-Length: ' . strlen($data)); - echo $data; -} -``` - -### How to get quotations for a shipment ? ### - -You can use the getQuote or getCapability service for that. Here is an example. - -```php -use DHL\Entity\AM\GetQuote; -use DHL\Datatype\AM\PieceType; -use DHL\Client\Web as WebserviceClient; - -require(__DIR__ . '/../../init.php'); - -// DHL Settings -$dhl = $config['dhl']; - -// Test a getQuote using DHL XML API -$sample = new GetQuote(); -$sample->SiteID = $dhl['id']; -$sample->Password = $dhl['pass']; - - -// Set values of the request -$sample->MessageTime = '2001-12-17T09:30:47-05:00'; -$sample->MessageReference = '1234567890123456789012345678901'; -$sample->BkgDetails->Date = date('Y-m-d'); - -$piece = new PieceType(); -$piece->PieceID = 1; -$piece->Height = 10; -$piece->Depth = 5; -$piece->Width = 10; -$piece->Weight = 10; -$sample->BkgDetails->addPiece($piece); -$sample->BkgDetails->IsDutiable = 'Y'; -$sample->BkgDetails->QtdShp->QtdShpExChrg->SpecialServiceType = 'WY'; -$sample->BkgDetails->ReadyTime = 'PT10H21M'; -$sample->BkgDetails->ReadyTimeGMTOffset = '+01:00'; -$sample->BkgDetails->DimensionUnit = 'CM'; -$sample->BkgDetails->WeightUnit = 'KG'; -$sample->BkgDetails->PaymentCountryCode = 'CA'; -$sample->BkgDetails->IsDutiable = 'Y'; - -// Request Paperless trade -$sample->BkgDetails->QtdShp->QtdShpExChrg->SpecialServiceType = 'WY'; - -$sample->From->CountryCode = 'CA'; -$sample->From->Postalcode = 'H3E1B6'; -$sample->From->City = 'Montreal'; - -$sample->To->CountryCode = 'CH'; -$sample->To->Postalcode = '1226'; -$sample->To->City = 'Thonex'; -$sample->Dutiable->DeclaredValue = '100.00'; -$sample->Dutiable->DeclaredCurrency = 'CHF'; - -// Call DHL XML API -$start = microtime(true); -echo $sample->toXML(); -$client = new WebserviceClient('staging'); -$xml = $client->call($sample); -echo PHP_EOL . 'Executed in ' . (microtime(true) - $start) . ' seconds.' . PHP_EOL; -echo $xml . PHP_EOL; -``` - diff --git a/changelog.md b/changelog.md new file mode 100644 index 0000000..eff3bd7 --- /dev/null +++ b/changelog.md @@ -0,0 +1,15 @@ +# Change Log + +v1.0.0 - Initial refactoring to DHL v6.2 for Shipment Validation + +v1.0.1 - Fixed issues with Route Requests + +v2.0.0 - Updated Shipment Validation to DHL v10 + +v2.0.1 - Removed debugging from Datatype/Base.php + +v2.0.2 - Examples updated + +v2.0.3 - Updates to Shipper & Consignee objects + +v2.0.4 - introduced OtherCharges parameter diff --git a/composer.json b/composer.json index d495a1a..76aa969 100644 --- a/composer.json +++ b/composer.json @@ -1,22 +1,24 @@ { - "name": "alfallouji/dhl_api", - + "name": "mtcmedia/dhl-api", "description": "PHP library to communicate with the DHL XML Services.", - "require": { - "php": ">=5.3.0" + "php": ">=7.1", + "ext-xmlwriter": "*", + "ext-curl": "*" }, - - "license": "LGPL-2.1", - - "autoload": { - "classmap" : [ "DHL" ] - }, - - "authors": [ + "require-dev": { + "squizlabs/php_codesniffer": "^3.5" + }, + "license": "MIT", + "autoload": { + "psr-4": { + "Mtc\\Dhl\\": "src/" + } + }, + "authors": [ { - "name": "Bashar Al-Fallouji", - "email": "bashar@alfallouji.com" + "name": "Martins Fridenbergs", + "email": "martins.fridenbergs@mtcmedia.co.uk" } ] } diff --git a/conf/config.sample.php b/conf/config.sample.php deleted file mode 100644 index 31ddf5f..0000000 --- a/conf/config.sample.php +++ /dev/null @@ -1,40 +0,0 @@ - array( - - // Only scan once when a class is not found in the class map (this should be set to SCAN_NONE on production environment - 'scanOptions' => autoloadManager::SCAN_ONCE, - - // complete path to autoload file that contains the class map - 'dir' => sys_get_temp_dir() . '/dhl-api-autoload.php', - ), - - // DHL related settings - 'dhl' => array( - // ID to use to connect to DHL - 'id' => 'YOUR_ID', - - // Password to use to connect to DHL - 'pass' => 'YOUR_PASS', - - // Shipper, Billing and Duty Account numbers - 'shipperAccountNumber' => 'YOUR_NUMBER', - 'billingAccountNumber' => 'YOUR_NUMBER', - 'dutyAccountNumber' => 'YOUR_NUMBER', - ), -); diff --git a/contributing.md b/contributing.md new file mode 100644 index 0000000..00556f6 --- /dev/null +++ b/contributing.md @@ -0,0 +1,20 @@ +# Contributing + +Contributions are **welcome** and will be **credited**. + + +## Pull Requests + +- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer). + +- Additionally to PSR-2 we use `$snake_case` for variable naming and `camelCase()` for methods + +- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation is updated. + +- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Breaking functionality will be tagged accordingly when merged. + +- **Create feature branches** - Don't ask us to pull from your master branch. + +- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests. + +- We prefer to have an accessible demo environment for showing changes. \ No newline at end of file diff --git a/docs/pickup.md b/docs/pickup.md new file mode 100644 index 0000000..d2f674c --- /dev/null +++ b/docs/pickup.md @@ -0,0 +1,53 @@ +Example request: +```php +$pickup = new BookPURequest(); +$pickup->SiteID = 'ACCOUNT_NUMBER'; +$pickup->Password = 'PASSWORD'; +$pickup->MessageTime = Carbon::now()->format(Carbon::ATOM); +$pickup->MessageReference = 'reference_28_to_32_characters'; + +$pickup->Requestor->AccountNumber = 'SHIPPER_ACCOUNT'; +$pickup->Requestor->AccountType = 'D'; +$pickup->Requestor->CompanyName = $address->organisation; +$pickup->Requestor->RequestorContact->PersonName = $address->contact_name; +$pickup->Requestor->RequestorContact->Phone = $address->contact_phone; + +// DHL REGION based on the Toolkit documentation for the pickup country +$pickup->RegionCode = $dhl_region; + +$pickup->Place->LocationType = 'B'; +$pickup->Place->CompanyName = $address->organisation; +$pickup->Place->Address1 = $address->address1; +$pickup->Place->Address2 = $address->address2; +$pickup->Place->PackageLocation = 'Ask receptionist'; +$pickup->Place->City = $address->city; +$pickup->Place->CountryCode = $address->country; +$pickup->Place->PostalCode = $address->postcode; + +$pickup->Pickup->PickupDate = $pickup_time; +$pickup->Pickup->ReadyByTime = '13:00'; +$pickup->Pickup->CloseTime = '17:00'; + +$pickup->PickupContact->PersonName = $address->contact_name; +$pickup->PickupContact->Phone = $address->contact_phone; + +$pickup->ShipmentDetails->AccountType = 'D'; +$pickup->ShipmentDetails->AccountNumber = 'SHIPPER_ACCOUINT'; +$pickup->ShipmentDetails->BillToAccountNumber = 'BILLING_ACCOUNT'; + +$pickup->ShipmentDetails->AWBNumber = $tracking_number; +$pickup->ShipmentDetails->NumberOfPieces = $package_count; +$pickup->ShipmentDetails->GlobalProductCode = $shipment_product_code; +$pickup->ShipmentDetails->Weight = $package_weight; +$pickup->ShipmentDetails->WeightUnit = 'K'; +$pickup->ShipmentDetails->DoorTo = 'DD'; +$pickup->ShipmentDetails->DimensionUnit = 'C'; + +$client = new Web($this->getEnvironment()); +$xml_response = $client->call($pickup); +``` + +If you need XML request for the DHL certification you can obtain by calling the following code +```php +$request_xml = $pickup->toXml(); +``` \ No newline at end of file diff --git a/docs/quote.md b/docs/quote.md new file mode 100644 index 0000000..2c0ee56 --- /dev/null +++ b/docs/quote.md @@ -0,0 +1,48 @@ +Example request: +```php +$sample = new GetQuote(); +$sample->SiteID = 'ACCOUNT_NUMBER'; +$sample->Password = 'PASSWORD'; +$sample->MessageTime = Carbon::now()->format(Carbon::ATOM); +$sample->MessageReference = 'reference_28_to_32_chars'; + +$sample->BkgDetails->Date = date('Y-m-d'); +$sample->BkgDetails->PaymentCountryCode = 'GB'; +$sample->BkgDetails->DimensionUnit = 'CM'; +$sample->BkgDetails->WeightUnit = 'KG'; +$sample->BkgDetails->ReadyTime = 'PT10H21M'; +$sample->BkgDetails->ReadyTimeGMTOffset = '+01:00'; +$sample->BkgDetails->PaymentAccountNumber = 'SHIPPER_ACCOUNT_NUMBER'; + +foreach ($packages as $index => $package) { + $piece = new PieceType(); + $piece->PieceID = $index + 1; + $piece->Height = $package['height']; + $piece->Depth = $package['length']; + $piece->Width = $package['width']; + $piece->Weight = $package['weight']; + $sample->BkgDetails->addPiece($piece); +} + +$sample->From->CountryCode = 'GB'; +$sample->From->Postalcode = 'DD13JA'; + +$sample->To->City = $address->city; +$sample->To->Postalcode = $address->postcode; +$sample->To->CountryCode = $address->country; +$sample->BkgDetails->IsDutiable = Country::isEu($address->country) ? 'N' : 'Y'; + +if (!Country::isEu($address->country)) { + $order_value = $order->order_cost - $order->delivery_cost > 0 ? $order->order_cost - $order->delivery_cost : 1.0; + $sample->Dutiable->DeclaredValue = $order_value; + $sample->Dutiable->DeclaredCurrency = 'GBP'; +} + +$client = new Web($this->getEnvironment()); +$xml_response = $client->call($sample); +``` + +If you need XML request for the DHL certification you can obtain by calling the following code +```php +$request_xml = $sample->toXml(); +``` diff --git a/docs/route.md b/docs/route.md new file mode 100644 index 0000000..6ab5c7f --- /dev/null +++ b/docs/route.md @@ -0,0 +1,28 @@ +Example request: +```php + $router = new RouteRequest(); + $router->MessageTime = Carbon::now()->format(Carbon::ATOM); + $router->MessageReference = 'reference_28_to_30_chars'; + $router->SiteID = 'SITE_ID'; + $router->Password = 'PASSWORD'; + $router->OriginCountryCode = 'GB'; + $router->RequestType = 'O'; + + $router->Address1 = 'mtc media, Unit 35'; + $router->Address2 = 'Shed 26, City Quay'; + $router->Address3 = ''; + $router->PostalCode = 'DD1 3JA'; + $router->City = 'Dundee'; + $router->Division = ''; + $router->CountryCode = 'GB'; + $router->RegionCode = 'EU'; + $router->CountryName = 'United Kingdom'; + + $client = new Web('staging/production'); + $xml_response = $client->call($router); +``` + +If you need XML request for the DHL certification you can obtain by calling the following code +```php +$request_xml = $router->toXml(); +``` \ No newline at end of file diff --git a/docs/shipment.md b/docs/shipment.md new file mode 100644 index 0000000..dad7bee --- /dev/null +++ b/docs/shipment.md @@ -0,0 +1,206 @@ +Example request: + +```php +use Mtc\Dhl\Client\Web; +use Mtc\Dhl\Datatype\AM\DocImage; +use Mtc\Dhl\Datatype\EU\AdditionalProtection; +use Mtc\Dhl\Datatype\EU\ExportLineItem; +use Mtc\Dhl\Datatype\EU\GrossWeight; +use Mtc\Dhl\Datatype\EU\Piece; +use Mtc\Dhl\Datatype\EU\RegistrationNumber; +use Mtc\Dhl\Datatype\EU\SpecialService; +use Mtc\Dhl\Datatype\EU\Weight; +use Mtc\Dhl\Entity\EU\ShipmentRequest; + +$shipment = new ShipmentRequest(); +$shipment->SiteID = $order->auth->account_number; +$shipment->Password = $order->auth->password; +$shipment->MessageTime = Carbon::now()->format(Carbon::ATOM); +$shipment->MessageReference = substr($reference, 0, 30); +$shipment->LanguageCode = 'en'; +$shipment->Reference->ReferenceID = $reference_prefix . '-' . $order->id; + +$shipment->SoftwareName = '3PV'; +$shipment->SoftwareVersion = '6.2'; + +$shipment->Billing->ShipperAccountNumber = $order->auth->shipper_account; +$shipment->Billing->ShippingPaymentType = 'S'; +$shipment->Billing->BillingAccountNumber = $order->auth->billing_account; + +$contact_name = $order->address->shipping->first_name . ' ' . $order->address->shipping->last_name; +$shipment->Consignee->CompanyName = $order->address->shipping->organisation ?? $contact_name; +$shipment->Consignee->Contact->PersonName = $contact_name; +$shipment->Consignee->AddressLine1 = substr($order->address->shipping->address1, 0, 35); +if (!empty($order->address->shipping->address2)) { + $shipment->Consignee->AddressLine2 = substr($order->address->shipping->address2, 0, 35); +} +$shipment->Consignee->City = $order->address->shipping->city; +$shipment->Consignee->PostalCode = $order->address->shipping->postcode; +if (!empty($order->address->shipping->state)) { + $shipment->Consignee->Division = $order->address->shipping->state ?? ''; + $shipment->Consignee->DivisionCode = $order->address->shipping->state ?? ''; +} + +if (!empty($order->address->shipping->tax_id)) { + $shipment->Consignee->FederalTaxId = $order->address->shipping->tax_id; +} + +$shipment->Consignee->CountryCode = $order->address->shipping->country; +$shipment->Consignee->CountryName = Country::getNameFromCode($order->address->shipping->country); +$shipment->Consignee->Contact->PhoneNumber = $order->info->contact_no; +$shipment->Consignee->Contact->Email = $order->info->email; +$shipment->Consignee->Contact->PhoneExtension = ''; +$shipment->Consignee->Contact->FaxNumber = ''; +$shipment->Consignee->Contact->Telex = ''; +$shipment->Consignee->Contact->MobilePhoneNumber = $order->info->contact_no; +$shipment->RegionCode = Country::getDHLRegionCode($order->address->shipping->country); +$shipment->Shipper->BusinessPartyTypeCode = 'DC'; + +$order_value = $this->getOrderValue($order); +$shipment->Dutiable->DeclaredValue = number_format($order_value, 2, '.', ''); +$shipment->Dutiable->DeclaredCurrency = 'GBP'; +$shipment->Dutiable->TermsOfTrade = $this->termsOfTrade($order); + +$special_service_type = $this->getSpecialServiceType($order); + +if ($special_service_type) { + $special_service = new SpecialService(); + $special_service->SpecialServiceType = $special_service_type; + $shipment->SpecialService = $special_service; +} +// DocImage is required for paperless +if ($special_service_type === 'WY') { + $image = new DocImage(); + $image->Type = 'INV'; + $image->Image = $order->invoice; + $image->ImageFormat = 'PDF'; + $shipment->addDocImage($image); +} +$shipment->Shipper->ShipperID = $order->auth->shipper_id; +$shipment->Shipper->RegisteredAccount = $order->auth->shipper_account_number; +$shipment->Shipper->CompanyName = $order->address->collection->organisation; +$shipment->Shipper->AddressLine1 = $order->address->collection->address1; +if (!empty($order->address->collection->address2)) { + $shipment->Shipper->AddressLine2 = $order->address->collection->address2; +} +$shipment->Shipper->City = $order->address->collection->city; +if ($order->address->collection->country === 'GB') { + $shipment->Shipper->PostalCode = $this->normalizeUkPostcode($order->address->collection->postcode); +} else { + $shipment->Shipper->PostalCode = $order->address->collection->postcode; +} +$shipment->Shipper->CountryCode = $order->address->collection->country; +$shipment->Shipper->CountryName = Country::getNameFromCode($order->address->collection->country); + +$shipment->Shipper->Contact->PersonName = $order->address->collection->contact_name; +$shipment->Shipper->Contact->PhoneNumber = $order->address->collection->contact_phone; +$shipment->Shipper->Contact->Email = $order->address->collection->contact_email; +$shipment->Shipper->Contact->PhoneExtension = ''; +$shipment->Shipper->Contact->FaxNumber = ''; +$shipment->Shipper->Contact->Telex = ''; +$shipment->Shipper->Contact->MobilePhoneNumber = $order->address->collection->contact_phone; + +if (!empty($order->courier->registration_number)) { + $registration_number = new RegistrationNumber(); + $registration_number->Number = $order->courier->registration_number; + $registration_number->NumberTypeCode = $order->courier->registration_number_type; + $registration_number->NumberIssuerCountryCode = $order->courier->registration_number_country; + $shipment->Shipper->addRegistrationNumber($registration_number); +} +$shipment->Shipper->BusinessPartyTypeCode = 'BU'; + +$delivery_service = $this->getDeliveryService($client, $order); +$shipment->ShipmentDetails->GlobalProductCode = $delivery_service->code; +$shipment->ShipmentDetails->LocalProductCode = $delivery_service->format; + +$shipment->ShipmentDetails->Contents = $order->description ?? ''; +$shipment->ShipmentDetails->CurrencyCode = 'GBP'; +$shipment->ShipmentDetails->WeightUnit = 'K'; +$shipment->ShipmentDetails->Date = Carbon::now()->format('Y-m-d'); +$shipment->ShipmentDetails->DimensionUnit = 'C'; +$shipment->ShipmentDetails->InsuredAmount = !empty($order->insurance_total) ? $order->insurance_total : 0; +$shipment->ShipmentDetails->PackageType = $order->package_type ?? 'PA'; +$shipment->ShipmentDetails->IsDutiable = $this->is_dutiable_shipment ? 'Y' : 'N'; +// paperless needs IsDutiable set to 'Y' +if ($special_service_type === 'WY') { + $shipment->ShipmentDetails->IsDutiable = 'Y'; +} +$shipment->ShipmentDetails->AdditionalProtection = new AdditionalProtection(); +$shipment->ShipmentDetails->CustData = $contact_name; + +$shipment->DHLInvoiceType = 'CMI'; +if (!empty($order->invoice_date)) { + $shipment->ExportDeclaration->InvoiceDate = $order->invoice_date; +} +if (!empty($order->invoice_number)) { + $shipment->ExportDeclaration->InvoiceNumber = (string)$order->invoice_number; +} +$shipment->ExportDeclaration->ExportReason = 'Sales'; +$shipment->ExportDeclaration->ExportReasonCode = 'P'; +$shipment->ExportDeclaration->ShipmentPurpose = 'PERSONAL'; +$shipment->ExportDeclaration->InvoiceTotalGrossWeight = collect($packages)->sum('weight'); +$shipment->ExportDeclaration->PlaceOfIncoterm = $order->address->shipping->city; + +foreach ($order->items as $index => $item) { + $export_item = new ExportLineItem(); + $export_item->LineNumber = $index + 1; + $export_item->Value = $item->price; + $export_item->Quantity = $item->quantity; + $export_item->QuantityUnit = 'PCS'; + $weight = new Weight(); + $weight->Weight = $item->weight; + $weight->WeightUnit = 'K'; + $export_item->Weight = $weight; + $weight = new GrossWeight(); + $weight->Weight = $item->weight; + $weight->WeightUnit = 'K'; + $export_item->GrossWeight = $weight; + $export_item->Description = $item->name; + + if (!empty($item->manufacture_country)) { + $export_item->ManufactureCountryCode = $item->manufacture_country; + } + if (!empty($item->commodity_code)) { + $export_item->CommodityCode = $item->commodity_code; + } + if (!empty($item->import_commodity_code)) { + $export_item->ImportCommodityCode = $item->import_commodity_code; + } + + $shipment->ExportDeclaration->addExportLineItem($export_item); +} + +// Information about Packages in shipment +foreach ($packages as $package_id => $package) { + $piece = new Piece(); + $piece->PieceID = $client->account . $order->id . $package_id; + $piece->PackageType = $order->package_type ?? 'PA'; + $piece->Weight = $package['weight']; + $piece->Width = $package['width']; + $piece->Height = $package['height']; + $piece->Depth = $package['length']; + $piece->PieceContents = $package['contents']; + $shipment->ShipmentDetails->addPiece($piece); +} + +$shipment->EProcShip = 'N'; + +switch (strtolower($order->courier->label_format)) { + case 'zpl': + $shipment->LabelImageFormat = 'ZPL2'; + $shipment->Label->LabelTemplate = '8X4_thermal'; + break; + case 'pdf': + default: + $shipment->LabelImageFormat = 'PDF'; + $shipment->Label->LabelTemplate = '8X4_PDF'; +} + +$api_client = new Web($this->getEnvironment()); +$xml_response = $api_client->call($shipment); +``` + +If you need XML request for the DHL certification you can obtain by calling the following code +```php +$request_xml = $shipment->toXml(); +``` \ No newline at end of file diff --git a/docs/tracking.md b/docs/tracking.md new file mode 100644 index 0000000..1888e8b --- /dev/null +++ b/docs/tracking.md @@ -0,0 +1,24 @@ +Example request: +```php +$tracking = new KnownTrackingRequest(); +$tracking->SiteID = 'ACCOUNT_NUIMBER'; +$tracking->Password = 'PASSWORD'; +$tracking->MessageReference = 'reference_28_to_32_chars'; +$tracking->MessageTime = Carbon::now()->format(Carbon::ATOM); +$tracking->LanguageCode = 'en'; +$tracking->AWBNumber = $tracking_number; +$tracking->LevelOfDetails = 'ALL_CHECK_POINTS'; +$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 +```php +$request_xml = $tracking->toXml(); +``` diff --git a/init.php b/init.php deleted file mode 100644 index a8bdde6..0000000 --- a/init.php +++ /dev/null @@ -1,52 +0,0 @@ -addFolder(DHL_API_DIR . 'vendor'); -$autoloadManager->addFolder(DHL_API_DIR . 'DHL'); -$autoloadManager->register(); diff --git a/license.md b/license.md new file mode 100644 index 0000000..e662c78 --- /dev/null +++ b/license.md @@ -0,0 +1,5 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..03d31e8 --- /dev/null +++ b/readme.md @@ -0,0 +1,54 @@ +# DHL API + +* [Installation](#installation) +* [Usage](#usage) + +## Installation + +Package should be installed through composer: + +```bash +composer require mtcmedia/dhl-api +``` + +Package requires a php min version of 7.1, however it has has been developed and tested on php 7.2.* + +## Usage + +You will need Sandbox account to start setup. +You can request your unique credentials by registering for the XML Portal https://xmlportal.dhl.com/register + +DHL Documentation: http://xmlpitest-ea.dhl.com/toolkit/Toolkit.zip + +DHL XML Services Test Harness: https://xmlpi-validation.dhl.com/serviceval/jsps/main/Main_menu.jsp + +DHL XML Services Test server for customer certification: https://xmlpitest-ea.dhl.com/XMLShippingServlet + +[Quote Requests (v6.1)](docs/quote.md) + +[Route Requests (v1.0)](docs/route.md) + +[Shipment Requests (v10.0)](docs/shipment.md) + +[Pickup Request (v1.0)](docs/pickup.md) + +[Tracking Requests (v1.0)](docs/tracking.md) + +# Changelog + +v1.x - uses Shipment API v6.2 + +v2.x - uses Shipment API v10.0 + + +## Contributing + +Please see [CONTRIBUTING](contributing.md) for details. + +### Security + +If you discover any security-related issues, please email [opensource@mtcmedia.co.uk](mailto:opensource@mtcmedia.co.uk) instead of using the issue tracker. + +## License + +The package is provided under MIT License. Please see [License File](license.md) for more information. \ No newline at end of file diff --git a/samples/AM/GetQuote.php b/samples/AM/GetQuote.php deleted file mode 100644 index bf8bd38..0000000 --- a/samples/AM/GetQuote.php +++ /dev/null @@ -1,80 +0,0 @@ -SiteID = $dhl['id']; -$sample->Password = $dhl['pass']; - - -// Set values of the request -$sample->MessageTime = '2001-12-17T09:30:47-05:00'; -$sample->MessageReference = '1234567890123456789012345678901'; -$sample->BkgDetails->Date = date('Y-m-d'); - -$piece = new PieceType(); -$piece->PieceID = 1; -$piece->Height = 10; -$piece->Depth = 5; -$piece->Width = 10; -$piece->Weight = 10; -$sample->BkgDetails->addPiece($piece); -$sample->BkgDetails->IsDutiable = 'Y'; -$sample->BkgDetails->QtdShp->QtdShpExChrg->SpecialServiceType = 'WY'; -$sample->BkgDetails->ReadyTime = 'PT10H21M'; -$sample->BkgDetails->ReadyTimeGMTOffset = '+01:00'; -$sample->BkgDetails->DimensionUnit = 'CM'; -$sample->BkgDetails->WeightUnit = 'KG'; -$sample->BkgDetails->PaymentCountryCode = 'CA'; -$sample->BkgDetails->IsDutiable = 'Y'; - -// Request Paperless trade -$sample->BkgDetails->QtdShp->QtdShpExChrg->SpecialServiceType = 'WY'; - -$sample->From->CountryCode = 'CA'; -$sample->From->Postalcode = 'H3E1B6'; -$sample->From->City = 'Montreal'; - -$sample->To->CountryCode = 'CH'; -$sample->To->Postalcode = '1226'; -$sample->To->City = 'Thonex'; -$sample->Dutiable->DeclaredValue = '100.00'; -$sample->Dutiable->DeclaredCurrency = 'CHF'; - -// Call DHL XML API -$start = microtime(true); -echo $sample->toXML(); -$client = new WebserviceClient('staging'); -$xml = $client->call($sample); -echo PHP_EOL . 'Executed in ' . (microtime(true) - $start) . ' seconds.' . PHP_EOL; -echo $xml . PHP_EOL; diff --git a/samples/EA/Tracking.php b/samples/EA/Tracking.php deleted file mode 100644 index a173480..0000000 --- a/samples/EA/Tracking.php +++ /dev/null @@ -1,50 +0,0 @@ -SiteID = $dhl['id']; -$request->Password = $dhl['pass']; -$request->MessageReference = '1234567890123456789012345678'; -$request->MessageTime = '2002-06-25T11:28:55-08:00'; -$request->LanguageCode = 'en'; -$request->AWBNumber = '8564385550'; -$request->LevelOfDetails = 'ALL_CHECK_POINTS'; -$request->PiecesEnabled = 'S'; - -echo $request->toXML(); -$client = new WebserviceClient(); -$xml = $client->call($request); - -$result = new DHL\Entity\EA\TrackingResponse(); -$result->initFromXML($xml); -echo $result->toXML(); diff --git a/samples/EU/RouteRequest.php b/samples/EU/RouteRequest.php deleted file mode 100644 index cc0f5cf..0000000 --- a/samples/EU/RouteRequest.php +++ /dev/null @@ -1,56 +0,0 @@ -MessageTime = '2013-08-04T11:28:56.000-08:00'; -$sample->MessageReference = '1234567890123456789012345678901'; -$sample->SiteID = $dhl['id']; -$sample->Password = $dhl['pass']; -$sample->RegionCode = 'EU'; -$sample->RequestType = 'O'; -$sample->Address1 = 'Oracle Parkway,'; -$sample->Address2 = 'Thames Valley Park (TVP)'; -$sample->Address3 = 'Berkshire'; -$sample->PostalCode = 'RG6 1RA'; -$sample->City = 'Reading'; -$sample->Division = 'RE'; -$sample->CountryCode = 'GB'; -$sample->CountryName = 'United Kingdom'; -$sample->OriginCountryCode = 'GB'; - -// Call DHL XML API -echo $sample->toXML(); -$client = new WebserviceClient(); -echo $client->call($sample); diff --git a/samples/GB/Benchmark-ShipmentRequest.php b/samples/GB/Benchmark-ShipmentRequest.php deleted file mode 100644 index 8ed1035..0000000 --- a/samples/GB/Benchmark-ShipmentRequest.php +++ /dev/null @@ -1,159 +0,0 @@ -MessageTime = '2001-12-17T09:30:47-05:00'; -$sample->MessageReference = '1234567890123456789012345678901'; -$sample->SiteID = $config['id']; -$sample->Password = $config['pass']; -$sample->RegionCode = 'AM'; -$sample->RequestedPickupTime = 'Y'; -$sample->NewShipper = 'Y'; -$sample->LanguageCode = 'en'; -$sample->PiecesEnabled = 'Y'; -$sample->Billing->ShipperAccountNumber = $config['ShipperAccountNumber']; -$sample->Billing->ShippingPaymentType = 'S'; -$sample->Billing->BillingAccountNumber = $config['BillingAccountNumber']; -$sample->Billing->DutyPaymentType = 'S'; -$sample->Billing->DutyAccountNumber = $config['DutyAccountNumber']; -$sample->Consignee->CompanyName = 'Ssense'; -$sample->Consignee->AddressLine = '333 Chabanel West, #900'; -$sample->Consignee->City = 'Montreal'; -$sample->Consignee->PostalCode = 'H3E1G6'; -$sample->Consignee->CountryCode = 'CA'; -$sample->Consignee->CountryName = 'Canada'; -$sample->Consignee->Contact->PersonName = 'Mrs Orlander'; -$sample->Consignee->Contact->PhoneNumber = '506-851-2271'; -$sample->Consignee->Contact->PhoneExtension = '7862'; -$sample->Consignee->Contact->FaxNumber = '506-851-7403'; -$sample->Consignee->Contact->Telex = '506-851-7121'; -$sample->Consignee->Contact->Email = 'anc.email.com'; -$sample->Commodity->CommodityCode = 'cc'; -$sample->Commodity->CommodityName = 'cn'; -$sample->Dutiable->DeclaredValue = '200.00'; -$sample->Dutiable->DeclaredCurrency = 'USD'; -$sample->Dutiable->ScheduleB = '3002905110'; -$sample->Dutiable->ExportLicense = 'D123456'; -$sample->Dutiable->ShipperEIN = '112233445566'; -$sample->Dutiable->ShipperIDType = 'S'; -$sample->Dutiable->ImportLicense = 'ImportLic'; -$sample->Dutiable->ConsigneeEIN = 'ConEIN2123'; -$sample->Dutiable->TermsOfTrade = 'DTP'; -$sample->Reference->ReferenceID = 'AM international shipment'; -$sample->Reference->ReferenceType = 'St'; -$sample->ShipmentDetails->NumberOfPieces = '1'; -$sample->ShipmentDetails->Pieces->Piece->PieceID = '1'; -$sample->ShipmentDetails->Pieces->Piece->PackageType = 'EE'; -$sample->ShipmentDetails->Pieces->Piece->Weight = '10.0'; -$sample->ShipmentDetails->Pieces->Piece->DimWeight = '1200.0'; -$sample->ShipmentDetails->Pieces->Piece->Width = '100'; -$sample->ShipmentDetails->Pieces->Piece->Height = '200'; -$sample->ShipmentDetails->Pieces->Piece->Depth = '300'; -$sample->ShipmentDetails->Weight = '10.0'; -$sample->ShipmentDetails->WeightUnit = 'L'; -$sample->ShipmentDetails->GlobalProductCode = 'P'; -$sample->ShipmentDetails->LocalProductCode = 'P'; -$sample->ShipmentDetails->Date = '2014-08-05'; -$sample->ShipmentDetails->Contents = 'AM international shipment contents'; -$sample->ShipmentDetails->DoorTo = 'DD'; -$sample->ShipmentDetails->DimensionUnit = 'I'; -$sample->ShipmentDetails->InsuredAmount = '1200.00'; -$sample->ShipmentDetails->PackageType = 'EE'; -$sample->ShipmentDetails->IsDutiable = 'Y'; -$sample->ShipmentDetails->CurrencyCode = 'USD'; -$sample->Shipper->ShipperID = '751008818'; -$sample->Shipper->CompanyName = 'IBM Corporation'; -$sample->Shipper->RegisteredAccount = '751008818'; -$sample->Shipper->AddressLine = '1 New Orchard Road'; -$sample->Shipper->AddressLine = 'Armonk'; -$sample->Shipper->City = 'New York'; -$sample->Shipper->Division = 'ny'; -$sample->Shipper->DivisionCode = 'ny'; -$sample->Shipper->PostalCode = '10504'; -$sample->Shipper->CountryCode = 'US'; -$sample->Shipper->CountryName = 'United States Of America'; -$sample->Shipper->Contact->PersonName = 'Mr peter'; -$sample->Shipper->Contact->PhoneNumber = '1 905 8613402'; -$sample->Shipper->Contact->PhoneExtension = '3403'; -$sample->Shipper->Contact->FaxNumber = '1 905 8613411'; -$sample->Shipper->Contact->Telex = '1245'; -$sample->Shipper->Contact->Email = 'test@email.com'; -$sample->SpecialService->SpecialServiceType = 'A'; -$sample->SpecialService->SpecialServiceType = 'I'; -$sample->EProcShip = 'N'; - -$times = $responses = array(); -$testSet = 5; -$testSetCpt = 1; - -while ($testSetCpt <= $testSet) -{ - echo PHP_EOL . PHP_EOL . 'Test Sequence ' . $testSetCpt . PHP_EOL . '------------------'; - $values = array('ZPL2', 'EPL2', 'PDF'); - $max = 10; - $testSetTime[$testSetCpt] = $times; - $testSetResponse[$testSetCpt] = $responses; - $times = array(); - $responses = array(); - - foreach ($values as $value) - { - $sample->LabelImageFormat = $value; - - // Call DHL XML API - // echo $sample->toXML(); - echo PHP_EOL . 'Testing with ' . $value . ' - ' . $max . ' times' . PHP_EOL; - - $cpt = 1; - while ($cpt <= $max) - { - $startTime = microtime(true); - $client = new WebserviceClient('staging'); - $response = $client->call($sample); - $time = microtime(true) - $startTime; - - $xml = simplexml_load_string($response); - echo 'Waybill number : ' . (string) $xml->AirwayBillNumber . PHP_EOL; - - echo 'Call ' . $cpt . "\t: " . $time . PHP_EOL; - $times[$value][] = $time; - $responses[$value][] = $response; - ++$cpt; - - } - echo 'Average ' . (array_sum($times[$value]) / $max) . PHP_EOL; - } - - ++$testSetCpt; -} - -//var_dump($times); diff --git a/samples/GB/RouteRequest.php b/samples/GB/RouteRequest.php deleted file mode 100644 index c55df61..0000000 --- a/samples/GB/RouteRequest.php +++ /dev/null @@ -1,56 +0,0 @@ -MessageTime = '2013-08-04T11:28:56.000-08:00'; -$sample->MessageReference = '1234567890123456789012345678901'; -$sample->SiteID = $dhl['id']; -$sample->Password = $dhl['pass']; -$sample->RegionCode = 'AM'; -$sample->RequestType = 'O'; -$sample->Address1 = 'Suit 333'; -$sample->Address2 = '333 Twin'; -$sample->Address3 = ''; -$sample->PostalCode = '94089'; -$sample->City = 'North Dakhota'; -$sample->Division = 'California'; -$sample->CountryCode = 'US'; -$sample->CountryName = 'United States of America'; -$sample->OriginCountryCode = 'US'; - -// Call DHL XML API -echo $sample->toXML(); -$client = new WebserviceClient(); -echo $client->call($sample); diff --git a/samples/GB/ShipmentRequest.php b/samples/GB/ShipmentRequest.php deleted file mode 100644 index 28229f9..0000000 --- a/samples/GB/ShipmentRequest.php +++ /dev/null @@ -1,151 +0,0 @@ -MessageTime = '2001-12-17T09:30:47-05:00'; -$sample->MessageReference = '1234567890123456789012345678901'; -$sample->SiteID = $dhl['id']; -$sample->Password = $dhl['pass']; -$sample->RegionCode = 'AM'; -$sample->RequestedPickupTime = 'Y'; -$sample->NewShipper = 'Y'; -$sample->LanguageCode = 'en'; -$sample->PiecesEnabled = 'Y'; -$sample->Billing->ShipperAccountNumber = $dhl['shipperAccountNumber']; -$sample->Billing->ShippingPaymentType = 'S'; -$sample->Billing->BillingAccountNumber = $dhl['billingAccountNumber']; -$sample->Billing->DutyPaymentType = 'S'; -$sample->Billing->DutyAccountNumber = $dhl['dutyAccountNumber']; -$sample->Consignee->CompanyName = 'Ssense'; -$sample->Consignee->addAddressLine('333 Chabanel West, #900'); -$sample->Consignee->City = 'Montreal'; -$sample->Consignee->PostalCode = 'H3E1G6'; -$sample->Consignee->CountryCode = 'CA'; -$sample->Consignee->CountryName = 'Canada'; -$sample->Consignee->Contact->PersonName = 'Bashar Al-Fallouji'; -$sample->Consignee->Contact->PhoneNumber = '0435 336 653'; -$sample->Consignee->Contact->PhoneExtension = '123'; -$sample->Consignee->Contact->FaxNumber = '506-851-7403'; -$sample->Consignee->Contact->Telex = '506-851-7121'; -$sample->Consignee->Contact->Email = 'bashar@alfallouji.com'; -$sample->Commodity->CommodityCode = 'cc'; -$sample->Commodity->CommodityName = 'cn'; -$sample->Dutiable->DeclaredValue = '200.00'; -$sample->Dutiable->DeclaredCurrency = 'USD'; -$sample->Dutiable->ScheduleB = '3002905110'; -$sample->Dutiable->ExportLicense = 'D123456'; -$sample->Dutiable->ShipperEIN = '112233445566'; -$sample->Dutiable->ShipperIDType = 'S'; -$sample->Dutiable->ImportLicense = 'ALFAL'; -$sample->Dutiable->ConsigneeEIN = 'ConEIN2123'; -$sample->Dutiable->TermsOfTrade = 'DTP'; -$sample->Reference->ReferenceID = 'AM international shipment'; -$sample->Reference->ReferenceType = 'St'; -$sample->ShipmentDetails->NumberOfPieces = 2; - -$piece = new Piece(); -$piece->PieceID = '1'; -$piece->PackageType = 'EE'; -$piece->Weight = '5.0'; -$piece->DimWeight = '600.0'; -$piece->Width = '50'; -$piece->Height = '100'; -$piece->Depth = '150'; -$sample->ShipmentDetails->addPiece($piece); - -$piece = new Piece(); -$piece->PieceID = '2'; -$piece->PackageType = 'EE'; -$piece->Weight = '5.0'; -$piece->DimWeight = '600.0'; -$piece->Width = '50'; -$piece->Height = '100'; -$piece->Depth = '150'; -$sample->ShipmentDetails->addPiece($piece); - -$sample->ShipmentDetails->Weight = '10.0'; -$sample->ShipmentDetails->WeightUnit = 'L'; -$sample->ShipmentDetails->GlobalProductCode = 'P'; -$sample->ShipmentDetails->LocalProductCode = 'P'; -$sample->ShipmentDetails->Date = date('Y-m-d'); -$sample->ShipmentDetails->Contents = 'AM international shipment contents'; -$sample->ShipmentDetails->DoorTo = 'DD'; -$sample->ShipmentDetails->DimensionUnit = 'I'; -$sample->ShipmentDetails->InsuredAmount = '1000.00'; -$sample->ShipmentDetails->PackageType = 'EE'; -$sample->ShipmentDetails->IsDutiable = 'Y'; -$sample->ShipmentDetails->CurrencyCode = 'USD'; -$sample->Shipper->ShipperID = '751008818'; -$sample->Shipper->CompanyName = 'IBM Corporation'; -$sample->Shipper->RegisteredAccount = '751008818'; -$sample->Shipper->addAddressLine('1 New Orchard Road'); -$sample->Shipper->addAddressLine('Armonk'); -$sample->Shipper->City = 'New York'; -$sample->Shipper->Division = 'ny'; -$sample->Shipper->DivisionCode = 'ny'; -$sample->Shipper->PostalCode = '10504'; -$sample->Shipper->CountryCode = 'US'; -$sample->Shipper->CountryName = 'United States Of America'; -$sample->Shipper->Contact->PersonName = 'Mr peter'; -$sample->Shipper->Contact->PhoneNumber = '1 905 8613402'; -$sample->Shipper->Contact->PhoneExtension = '3403'; -$sample->Shipper->Contact->FaxNumber = '1 905 8613411'; -$sample->Shipper->Contact->Telex = '1245'; -$sample->Shipper->Contact->Email = 'test@email.com'; - -$specialService = new SpecialService(); -$specialService->SpecialServiceType = 'A'; -$sample->addSpecialService($specialService); - -$specialService = new SpecialService(); -$specialService->SpecialServiceType = 'I'; -$sample->addSpecialService($specialService); - -$sample->EProcShip = 'N'; -$sample->LabelImageFormat = 'PDF'; - -// Call DHL XML API -$start = microtime(true); -echo $sample->toXML(); -$client = new WebserviceClient('staging'); -$xml = $client->call($sample); -echo PHP_EOL . 'Executed in ' . (microtime(true) - $start) . ' seconds.' . PHP_EOL; - -$response = new ShipmentResponse(); -$response->initFromXML($xml); -echo $xml . PHP_EOL . $response->toXML(); diff --git a/src/Client/Web.php b/src/Client/Web.php new file mode 100644 index 0000000..409604b --- /dev/null +++ b/src/Client/Web.php @@ -0,0 +1,81 @@ +mode = $mode; + } + + /** + * Call DHL Service + * + * @param Request $request Request to send + * + * @return string DHL XML response string + */ + public function call(Request $request) + { + if (!$ch = curl_init()) { + throw new \Exception('could not initialize curl'); + } + + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_URL, $this->getUrl()); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); + curl_setopt($ch, CURLOPT_PORT, 443); + curl_setopt($ch, CURLOPT_POSTFIELDS, $request->toXML()); + $result = curl_exec($ch); + + if (curl_error($ch)) { + return false; + } + curl_close($ch); + + return $result; + } + + /** + * Get url associated to a specific service + * + * @return string URL for the service + */ + private function getUrl() + { + return ('staging' === $this->mode) ? $this->stagingUrl : $this->productionUrl; + } +} diff --git a/src/Datatype/AM/AWBInfo.php b/src/Datatype/AM/AWBInfo.php new file mode 100644 index 0000000..9f582b9 --- /dev/null +++ b/src/Datatype/AM/AWBInfo.php @@ -0,0 +1,46 @@ + [ + 'type' => 'AWBNumber', + 'required' => false, + 'subobject' => false, + 'comment' => 'Airway bill number', + 'maxLength' => '11', + ], + 'Status' => [ + 'type' => 'Status', + 'required' => false, + 'subobject' => true, + ], + 'ShipmentInfo' => [ + 'type' => 'ShipmentInfo', + 'required' => false, + 'subobject' => true, + ], + 'Pieces' => [ + 'type' => 'TrackingPieces', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/src/Datatype/AM/BarCodes.php b/src/Datatype/AM/BarCodes.php new file mode 100644 index 0000000..4acc02b --- /dev/null +++ b/src/Datatype/AM/BarCodes.php @@ -0,0 +1,30 @@ + [ + 'type' => 'BarCode', + 'required' => false, + 'subobject' => false, + 'comment' => '', + ], + ]; +} diff --git a/DHL/Datatype/EA/Billing.php b/src/Datatype/AM/Billing.php similarity index 57% rename from DHL/Datatype/EA/Billing.php rename to src/Datatype/AM/Billing.php index a2df114..f78d32c 100644 --- a/DHL/Datatype/EA/Billing.php +++ b/src/Datatype/AM/Billing.php @@ -1,29 +1,8 @@ array( + protected $params = [ + 'ShipperAccountNumber' => [ 'type' => 'AccountNumber', 'required' => false, 'subobject' => false, 'comment' => 'DHL Account Number', 'maxInclusive' => '9999999999', 'minInclusive' => '100000000', - ), - 'ShippingPaymentType' => array( + ], + 'ShippingPaymentType' => [ 'type' => 'PaymentType', 'required' => false, 'subobject' => false, 'comment' => 'payment type (S:Shipper,R:Recipient,T:Third Party,C:Credit Card)', 'length' => '1', 'enumeration' => 'S,R,T', - ), - 'BillingAccountNumber' => array( + ], + 'BillingAccountNumber' => [ 'type' => 'AccountNumber', 'required' => false, 'subobject' => false, 'comment' => 'DHL Account Number', 'maxInclusive' => '9999999999', 'minInclusive' => '100000000', - ), - 'DutyPaymentType' => array( + ], + 'DutyPaymentType' => [ 'type' => 'DutyTaxPaymentType', 'required' => false, 'subobject' => false, 'comment' => 'Duty and tax charge payment type (S:Shipper, R:Recipient, T:Third Party/Other)', 'length' => '1', 'enumeration' => 'S,R,T', - ), - 'DutyAccountNumber' => array( + ], + 'DutyAccountNumber' => [ 'type' => 'AccountNumber', 'required' => false, 'subobject' => false, 'comment' => 'DHL Account Number', 'maxInclusive' => '9999999999', 'minInclusive' => '100000000', - ), - ); + ], + ]; } diff --git a/DHL/Datatype/AM/BkgDetailsType.php b/src/Datatype/AM/BkgDetailsType.php similarity index 55% rename from DHL/Datatype/AM/BkgDetailsType.php rename to src/Datatype/AM/BkgDetailsType.php index e635d9a..15044fc 100644 --- a/DHL/Datatype/AM/BkgDetailsType.php +++ b/src/Datatype/AM/BkgDetailsType.php @@ -1,29 +1,8 @@ array( + protected $params = [ + 'PaymentCountryCode' => [ 'type' => '', 'required' => true, 'subobject' => false, - ), - 'Date' => array( + ], + 'Date' => [ 'type' => '', 'required' => true, 'subobject' => false, - ), - 'ReadyTime' => array( + ], + 'ReadyTime' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'ReadyTimeGMTOffset' => array( + ], + 'ReadyTimeGMTOffset' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'DimensionUnit' => array( + ], + 'DimensionUnit' => [ 'type' => '', 'required' => true, 'subobject' => false, - ), - 'WeightUnit' => array( + ], + 'WeightUnit' => [ 'type' => '', 'required' => true, 'subobject' => false, - ), - 'NumberOfPieces' => array( + ], + 'NumberOfPieces' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'ShipmentWeight' => array( + ], + 'ShipmentWeight' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'Volume' => array( + ], + 'Volume' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'MaxPieceWeight' => array( + ], + 'MaxPieceWeight' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'MaxPieceHeight' => array( + ], + 'MaxPieceHeight' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'MaxPieceDepth' => array( + ], + 'MaxPieceDepth' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'MaxPieceWidth' => array( + ], + 'MaxPieceWidth' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'Pieces' => array( + ], + 'Pieces' => [ 'type' => 'PieceType', 'required' => false, 'subobject' => false, 'multivalues' => true, - ), - 'PaymentAccountNumber' => array( + ], + 'PaymentAccountNumber' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'IsDutiable' => array( + ], + 'IsDutiable' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'NetworkTypeCode' => array( + ], + 'NetworkTypeCode' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'QtdShp' => array( + ], + 'QtdShp' => [ 'type' => 'QtdShpType', 'required' => false, 'subobject' => true, - ), - 'CODAmount' => array( + ], + 'CODAmount' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'CODCurrencyCode' => array( + ], + 'CODCurrencyCode' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'CODAccountNumber' => array( + ], + 'CODAccountNumber' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'InsuredValue' => array( + ], + 'InsuredValue' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'InsuredCurrency' => array( + ], + 'InsuredCurrency' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - ); + ], + ]; } diff --git a/DHL/Datatype/AM/ChargeCard.php b/src/Datatype/AM/ChargeCard.php similarity index 52% rename from DHL/Datatype/AM/ChargeCard.php rename to src/Datatype/AM/ChargeCard.php index f96584a..e11f911 100644 --- a/DHL/Datatype/AM/ChargeCard.php +++ b/src/Datatype/AM/ChargeCard.php @@ -1,29 +1,8 @@ array( + protected $params = [ + 'ChargeCardNo' => [ 'type' => 'ChargeCardNo', 'required' => false, 'subobject' => false, @@ -49,28 +28,28 @@ class ChargeCard extends Base 'minInclusive' => '1000000000000', 'maxInclusive' => '9999999999999999', 'pattern' => '\d{13,16}', - ), - 'ChargeCardType' => array( + ], + 'ChargeCardType' => [ 'type' => 'ChargeCardType', 'required' => false, 'subobject' => false, 'comment' => 'Charge card issuer type', 'length' => '2', 'enumeration' => 'AM,DC,DI,MC,VI', - ), - 'ChargeCardConfNo' => array( + ], + 'ChargeCardConfNo' => [ 'type' => 'ChargeCardConfNo', 'required' => false, 'subobject' => false, 'comment' => 'Charge card approval number', 'pattern' => '\d{0,6}', - ), - 'ChargeCardExpiryDate' => array( + ], + 'ChargeCardExpiryDate' => [ 'type' => 'ChargeCardExpDateValidator', 'required' => false, 'subobject' => false, 'comment' => 'Charge card expiration date', 'pattern' => '(0[1-9]|1[0-2])\d{1}[0-9]', - ), - ); + ], + ]; } diff --git a/src/Datatype/AM/Commodity.php b/src/Datatype/AM/Commodity.php new file mode 100644 index 0000000..cae2810 --- /dev/null +++ b/src/Datatype/AM/Commodity.php @@ -0,0 +1,39 @@ + [ + 'type' => 'CommodityCode', + 'required' => false, + 'subobject' => false, + 'comment' => 'Commodity codes for shipment type', + 'minLength' => '1', + 'maxLength' => '20', + ], + 'CommodityName' => [ + 'type' => 'CommodityName', + 'required' => false, + 'subobject' => false, + 'comment' => 'Commodity name for shipment content', + 'maxLength' => '35', + ], + ]; +} diff --git a/src/Datatype/AM/Condition.php b/src/Datatype/AM/Condition.php new file mode 100644 index 0000000..18ed5a3 --- /dev/null +++ b/src/Datatype/AM/Condition.php @@ -0,0 +1,34 @@ + [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'ConditionData' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + ]; +} diff --git a/DHL/Datatype/AP/Consignee.php b/src/Datatype/AM/Consignee.php similarity index 58% rename from DHL/Datatype/AP/Consignee.php rename to src/Datatype/AM/Consignee.php index e5d9da8..c82dd03 100644 --- a/DHL/Datatype/AP/Consignee.php +++ b/src/Datatype/AM/Consignee.php @@ -1,29 +1,8 @@ array( + protected $params = [ + 'CompanyName' => [ 'type' => 'CompanyNameValidator', 'required' => false, 'subobject' => false, 'comment' => 'Name of company / business', 'maxLength' => '35', - ), - 'AddressLine' => array( + ], + 'AddressLine' => [ 'type' => 'AddressLine', 'required' => false, 'subobject' => false, 'comment' => 'Address Line', 'maxLength' => '35', - ), - 'City' => array( + ], + 'City' => [ 'type' => 'City', 'required' => false, 'subobject' => false, 'comment' => 'City name', 'maxLength' => '35', - ), - 'Division' => array( + ], + 'Division' => [ 'type' => 'Division', 'required' => false, 'subobject' => false, 'comment' => 'Division (e.g. state, prefecture, etc.) name', 'maxLength' => '35', - ), - 'DivisionCode' => array( + ], + 'DivisionCode' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'PostalCode' => array( + ], + 'PostalCode' => [ 'type' => 'PostalCode', 'required' => false, 'subobject' => false, 'comment' => 'Full postal/zip code for address', - ), - 'CountryCode' => array( + ], + 'CountryCode' => [ 'type' => 'CountryCode', 'required' => false, 'subobject' => false, 'comment' => 'ISO country codes', 'length' => '2', - ), - 'CountryName' => array( + ], + 'CountryName' => [ 'type' => 'CountryName', 'required' => false, 'subobject' => false, 'comment' => 'ISO country name', 'maxLength' => '35', - ), - 'FederalTaxId' => array( + ], + 'FederalTaxId' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'StateTaxId' => array( + ], + 'StateTaxId' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'Contact' => array( + ], + 'Contact' => [ 'type' => 'Contact', 'required' => false, 'subobject' => true, - ), - ); + ], + 'RegistrationNumbers' => [ + 'type' => 'RegistrationNumber', + 'required' => false, + 'subobject' => true, + 'multivalues' => true, + ], + 'BusinessPartyTypeCode' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'Possible Values: + - BU (business) + - DC (direct consumer) + - GV (government) + - OT (other) + - PR (private) + - RE (reseller)', + ], + ]; } diff --git a/DHL/Datatype/AM/Contact.php b/src/Datatype/AM/Contact.php similarity index 50% rename from DHL/Datatype/AM/Contact.php rename to src/Datatype/AM/Contact.php index 9bfb0b5..bae3bbc 100644 --- a/DHL/Datatype/AM/Contact.php +++ b/src/Datatype/AM/Contact.php @@ -1,29 +1,8 @@ array( + protected $params = [ + 'PersonName' => [ 'type' => 'PersonName', 'required' => false, 'subobject' => false, 'comment' => 'Name', 'maxLength' => '35', - ), - 'PhoneNumber' => array( + ], + 'PhoneNumber' => [ 'type' => 'PhoneNumber', 'required' => false, 'subobject' => false, 'comment' => 'Phone Number', - ), - 'PhoneExtension' => array( + ], + 'PhoneExtension' => [ 'type' => 'PhoneExtension', 'required' => false, 'subobject' => false, 'comment' => '', 'maxLength' => '5', - ), - 'FaxNumber' => array( + ], + 'FaxNumber' => [ 'type' => 'PhoneNumber', 'required' => false, 'subobject' => false, 'comment' => 'Phone Number', - ), - 'Telex' => array( + ], + 'Telex' => [ 'type' => 'Telex', 'required' => false, 'subobject' => false, 'comment' => 'Telex number and answer back code', 'maxLength' => '25', - ), - 'Email' => array( + ], + 'Email' => [ 'type' => 'Email', 'required' => false, 'subobject' => true, - ), - ); + ], + ]; } diff --git a/src/Datatype/AM/Customer.php b/src/Datatype/AM/Customer.php new file mode 100644 index 0000000..4e96b9c --- /dev/null +++ b/src/Datatype/AM/Customer.php @@ -0,0 +1,34 @@ + [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'Name' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + ]; +} diff --git a/src/Datatype/AM/CustomerLogo.php b/src/Datatype/AM/CustomerLogo.php new file mode 100644 index 0000000..f5e1eb0 --- /dev/null +++ b/src/Datatype/AM/CustomerLogo.php @@ -0,0 +1,38 @@ + [ + 'type' => 'LogoImage', + 'required' => false, + 'subobject' => false, + 'comment' => 'LogoImage', + 'maxLength' => '1048576', + ], + 'LogoImageFormat' => [ + 'type' => 'LogoImageFormat', + 'required' => false, + 'subobject' => false, + 'comment' => 'LogoImage Format', + 'enumeration' => 'PNG,GIF,JPEG,JPG', + ], + ]; +} diff --git a/src/Datatype/AM/DCTDutiable.php b/src/Datatype/AM/DCTDutiable.php new file mode 100644 index 0000000..d82f32f --- /dev/null +++ b/src/Datatype/AM/DCTDutiable.php @@ -0,0 +1,40 @@ + [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + 'DeclaredValue' => [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + ]; +} diff --git a/src/Datatype/AM/DCTFrom.php b/src/Datatype/AM/DCTFrom.php new file mode 100644 index 0000000..9afc022 --- /dev/null +++ b/src/Datatype/AM/DCTFrom.php @@ -0,0 +1,55 @@ + [ + 'type' => '', + 'required' => true, + 'subobject' => false, + ], + 'Postalcode' => [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + 'City' => [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + 'Suburb' => [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + 'VatNo' => [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + ]; +} diff --git a/src/Datatype/AM/DCTTo.php b/src/Datatype/AM/DCTTo.php new file mode 100644 index 0000000..1a3d0dc --- /dev/null +++ b/src/Datatype/AM/DCTTo.php @@ -0,0 +1,55 @@ + [ + 'type' => '', + 'required' => true, + 'subobject' => false, + ], + 'Postalcode' => [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + 'City' => [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + 'Suburb' => [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + 'VatNo' => [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + ]; +} diff --git a/src/Datatype/AM/DestinationServiceArea.php b/src/Datatype/AM/DestinationServiceArea.php new file mode 100644 index 0000000..2243e43 --- /dev/null +++ b/src/Datatype/AM/DestinationServiceArea.php @@ -0,0 +1,50 @@ + [ + 'type' => 'ServiceAreaCode', + 'required' => false, + 'subobject' => false, + 'comment' => 'DHL service area code', + 'length' => '3', + ], + 'Description' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'FacilityCode' => [ + 'type' => 'FacilityCode', + 'required' => false, + 'subobject' => false, + 'comment' => 'Destination Facility Code', + 'length' => '3', + ], + 'InboundSortCode' => [ + 'type' => 'InboundSortCode', + 'required' => false, + 'subobject' => false, + 'comment' => 'InBound Sort Code', + 'length' => '4', + ], + ]; +} diff --git a/src/Datatype/AM/DocImage.php b/src/Datatype/AM/DocImage.php new file mode 100644 index 0000000..c7c7f82 --- /dev/null +++ b/src/Datatype/AM/DocImage.php @@ -0,0 +1,46 @@ + [ + 'type' => 'Type', + 'required' => false, + 'subobject' => false, + 'comment' => 'Image Type', + 'length' => '3', + 'enumeration' => 'HWB,INV,PNV,COO,NAF,CIN,DCL', + ], + 'Image' => [ + 'type' => 'Image', + 'required' => false, + 'subobject' => false, + 'comment' => 'Image', + ], + 'ImageFormat' => [ + 'type' => 'ImageFormat', + 'required' => false, + 'subobject' => false, + 'comment' => 'Image Format', + 'maxLength' => '5', + 'enumeration' => 'PDF,PNG,TIFF,GIF,JPEG', + ], + ]; +} diff --git a/src/Datatype/AM/DocImages.php b/src/Datatype/AM/DocImages.php new file mode 100644 index 0000000..1140af0 --- /dev/null +++ b/src/Datatype/AM/DocImages.php @@ -0,0 +1,29 @@ + [ + 'type' => 'DocImage', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/DHL/Datatype/AM/Dutiable.php b/src/Datatype/AM/Dutiable.php similarity index 53% rename from DHL/Datatype/AM/Dutiable.php rename to src/Datatype/AM/Dutiable.php index d8a466e..88f591d 100644 --- a/DHL/Datatype/AM/Dutiable.php +++ b/src/Datatype/AM/Dutiable.php @@ -1,29 +1,8 @@ array( + protected $params = [ + 'DeclaredValue' => [ 'type' => 'Money', 'required' => false, 'subobject' => false, 'comment' => 'Monetary amount (with 2 decimal precision)', 'minInclusive' => '0.00', 'maxInclusive' => '9999999999.99', - ), - 'DeclaredCurrency' => array( + ], + 'DeclaredCurrency' => [ 'type' => 'CurrencyCode', 'required' => false, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ), - 'ScheduleB' => array( + ], + 'ScheduleB' => [ 'type' => 'ScheduleB', 'required' => false, 'subobject' => false, 'comment' => 'Schedule B numner', 'maxLength' => '15', - ), - 'ExportLicense' => array( + ], + 'ExportLicense' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'ShipperEIN' => array( + ], + 'ShipperEIN' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'ShipperIDType' => array( + ], + 'ShipperIDType' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'ConsigneeIDType' => array( + ], + 'ConsigneeIDType' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'ImportLicense' => array( + ], + 'ImportLicense' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'ConsigneeEIN' => array( + ], + 'ConsigneeEIN' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'TermsOfTrade' => array( + ], + 'TermsOfTrade' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - ); + ], + ]; } diff --git a/DHL/Datatype/EA/Email.php b/src/Datatype/AM/Email.php similarity index 51% rename from DHL/Datatype/EA/Email.php rename to src/Datatype/AM/Email.php index b9e1836..3da9639 100644 --- a/DHL/Datatype/EA/Email.php +++ b/src/Datatype/AM/Email.php @@ -1,29 +1,8 @@ array( + protected $params = [ + 'From' => [ 'type' => 'EmailAddress', 'required' => false, 'subobject' => false, 'comment' => 'Email address containing \'@\'', - ), - 'To' => array( + ], + 'To' => [ 'type' => 'EmailAddress', 'required' => false, 'subobject' => false, 'comment' => 'Email address containing \'@\'', - ), - 'cc' => array( + ], + 'cc' => [ 'type' => 'EmailAddress', 'required' => false, 'subobject' => false, 'comment' => 'Email address containing \'@\'', - ), - 'Subject' => array( + ], + 'Subject' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ReplyTo' => array( + ], + 'ReplyTo' => [ 'type' => 'EmailAddress', 'required' => false, 'subobject' => false, 'comment' => 'Email address containing \'@\'', - ), - 'Body' => array( + ], + 'Body' => [ 'type' => 'EmailBody', 'required' => false, 'subobject' => false, 'comment' => 'Body of an email message', 'maxLength' => '255', - ), - ); + ], + ]; } diff --git a/src/Datatype/AM/ErrorResponse.php b/src/Datatype/AM/ErrorResponse.php new file mode 100644 index 0000000..a67aebe --- /dev/null +++ b/src/Datatype/AM/ErrorResponse.php @@ -0,0 +1,34 @@ + [ + 'type' => 'ServiceHeader', + 'required' => false, + 'subobject' => true, + ], + 'Status' => [ + 'type' => 'Status', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/src/Datatype/AM/EventRemarks.php b/src/Datatype/AM/EventRemarks.php new file mode 100644 index 0000000..d17491a --- /dev/null +++ b/src/Datatype/AM/EventRemarks.php @@ -0,0 +1,36 @@ + [ + 'type' => 'FurtherDetails', + 'required' => false, + 'subobject' => false, + 'comment' => 'FurtherDetails', + ], + 'NextSteps' => [ + 'type' => 'NextSteps', + 'required' => false, + 'subobject' => false, + 'comment' => 'NextSteps', + ], + ]; +} diff --git a/DHL/Datatype/EA/ExportDeclaration.php b/src/Datatype/AM/ExportDeclaration.php similarity index 59% rename from DHL/Datatype/EA/ExportDeclaration.php rename to src/Datatype/AM/ExportDeclaration.php index 37b69cf..4e2e9fb 100644 --- a/DHL/Datatype/EA/ExportDeclaration.php +++ b/src/Datatype/AM/ExportDeclaration.php @@ -1,29 +1,8 @@ array( + protected $params = [ + 'InterConsignee' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'IsPartiesRelation' => array( + ], + 'IsPartiesRelation' => [ 'type' => 'YesNo', 'required' => false, 'subobject' => false, 'comment' => 'Boolean flag', 'length' => '1', 'enumeration' => 'Y,N', - ), - 'ECCN' => array( + ], + 'ECCN' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'SignatureName' => array( + ], + 'SignatureName' => [ 'type' => 'SignatureName', 'required' => false, 'subobject' => false, 'comment' => 'Signature name', 'maxLength' => '35', - ), - 'SignatureTitle' => array( + ], + 'SignatureTitle' => [ 'type' => 'SignatureTitle', 'required' => false, 'subobject' => false, 'comment' => 'Signature title', 'maxLength' => '35', - ), - 'ExportReason' => array( + ], + 'ExportReason' => [ 'type' => 'ExportReason', 'required' => false, 'subobject' => false, 'comment' => 'Export reason', 'length' => '1', - ), - 'ExportReasonCode' => array( + ], + 'ExportReasonCode' => [ 'type' => 'ExportReasonCode', 'required' => false, 'subobject' => false, 'comment' => 'Export reason code (P:Permanent, T:Temporary, R:Re-Export)', 'length' => '1', 'enumeration' => 'P,T,R', - ), - 'SedNumber' => array( + ], + 'SedNumber' => [ 'type' => 'SEDNumber', 'required' => false, 'subobject' => false, 'comment' => '', 'enumeration' => 'FTSR,XTN,SAS', - ), - 'SedNumberType' => array( + ], + 'SedNumberType' => [ 'type' => 'SEDNumberType', 'required' => false, 'subobject' => false, 'comment' => '', 'length' => '1', 'enumeration' => 'F,X,S', - ), - 'MxStateCode' => array( + ], + 'MxStateCode' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'ExportLineItem' => array( + ], + 'ExportLineItem' => [ 'type' => 'ExportLineItem', 'required' => false, 'subobject' => true, - ), - ); + ], + ]; } diff --git a/DHL/Datatype/AP/ExportLineItem.php b/src/Datatype/AM/ExportLineItem.php similarity index 62% rename from DHL/Datatype/AP/ExportLineItem.php rename to src/Datatype/AM/ExportLineItem.php index 487769c..7b26feb 100644 --- a/DHL/Datatype/AP/ExportLineItem.php +++ b/src/Datatype/AM/ExportLineItem.php @@ -1,29 +1,8 @@ array( + protected $params = [ + 'LineNumber' => [ 'type' => 'LineNumber', 'required' => false, 'subobject' => false, 'comment' => '', 'minInclusive' => '1', 'maxInclusive' => '200', - ), - 'Quantity' => array( + ], + 'Quantity' => [ 'type' => 'Quantity', 'required' => false, 'subobject' => false, 'comment' => 'Quantity', 'maxInclusive' => '32000', - ), - 'QuantityUnit' => array( + ], + 'QuantityUnit' => [ 'type' => 'QuantityUnit', 'required' => false, 'subobject' => false, 'comment' => 'Quantity unit of measure (tens, hundreds, thousands, etc.)', 'maxLength' => '8', - ), - 'Description' => array( + ], + 'Description' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Value' => array( + ], + 'Value' => [ 'type' => 'Money', 'required' => false, 'subobject' => false, 'comment' => 'Monetary amount (with 2 decimal precision)', 'minInclusive' => '0.00', 'maxInclusive' => '9999999999.99', - ), - 'IsDomestic' => array( + ], + 'IsDomestic' => [ 'type' => 'YesNo', 'required' => false, 'subobject' => false, 'comment' => 'Boolean flag', 'length' => '1', 'enumeration' => 'Y,N', - ), - 'CommodityCode' => array( + ], + 'CommodityCode' => [ 'type' => 'CommodityCode', 'required' => false, 'subobject' => false, 'comment' => 'Commodity codes for shipment type', 'minLength' => '1', 'maxLength' => '20', - ), - 'ScheduleB' => array( + ], + 'ScheduleB' => [ 'type' => 'ScheduleB', 'required' => false, 'subobject' => false, 'comment' => 'Schedule B numner', 'maxLength' => '15', - ), - 'ECCN' => array( + ], + 'ECCN' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Weight' => array( + ], + 'Weight' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'License' => array( + ], + 'License' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'LicenseSymbol' => array( + ], + 'LicenseSymbol' => [ 'type' => 'LicenseNumber', 'required' => false, 'subobject' => false, 'comment' => 'Export license number', 'maxLength' => '16', - ), - ); + ], + ]; } diff --git a/src/Datatype/AM/Fault.php b/src/Datatype/AM/Fault.php new file mode 100644 index 0000000..74cc17a --- /dev/null +++ b/src/Datatype/AM/Fault.php @@ -0,0 +1,29 @@ + [ + 'type' => 'PieceFault', + 'required' => true, + 'subobject' => true, + ], + ]; +} diff --git a/src/Datatype/AM/Label.php b/src/Datatype/AM/Label.php new file mode 100644 index 0000000..402334d --- /dev/null +++ b/src/Datatype/AM/Label.php @@ -0,0 +1,53 @@ + [ + 'type' => 'LabelTemplate', + 'required' => false, + 'subobject' => false, + 'comment' => 'LabelTemplate', + 'enumeration' => '8X4_A4_PDF,8X4_thermal,8X4_PDF,8X4_A4_TC_PDF,6X4_A4_PDF,6X4_thermal,' + . '8X4_CI_PDF,8X4_CI_thermal', + ], + 'Logo' => [ + 'type' => 'YesNo', + 'required' => false, + 'subobject' => false, + 'comment' => 'Boolean flag', + 'length' => '1', + 'enumeration' => 'Y,N', + ], + 'CustomerLogo' => [ + 'type' => 'CustomerLogo', + 'required' => false, + 'subobject' => true, + ], + 'Resolution' => [ + 'type' => 'Resolution', + 'required' => false, + 'subobject' => false, + 'comment' => 'Resolution', + 'minInclusive' => '200', + 'maxInclusive' => '300', + ], + ]; +} diff --git a/src/Datatype/AM/LabelImage.php b/src/Datatype/AM/LabelImage.php new file mode 100644 index 0000000..086754b --- /dev/null +++ b/src/Datatype/AM/LabelImage.php @@ -0,0 +1,42 @@ + [ + 'type' => 'OutputFormat', + 'required' => false, + 'subobject' => false, + 'comment' => 'OutputFormat', + 'enumeration' => 'PDF,PL2,ZPL2,JPG,PNG,EPL2,EPLN,ZPLN', + ], + 'OutputImage' => [ + 'type' => 'OutputImage', + 'required' => false, + 'subobject' => false, + 'comment' => 'OutputImage', + ], + 'OutputImageNPC' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + ]; +} diff --git a/src/Datatype/AM/Note.php b/src/Datatype/AM/Note.php new file mode 100644 index 0000000..d96c6ab --- /dev/null +++ b/src/Datatype/AM/Note.php @@ -0,0 +1,34 @@ + [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'Condition' => [ + 'type' => 'Condition', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/src/Datatype/AM/OriginServiceArea.php b/src/Datatype/AM/OriginServiceArea.php new file mode 100644 index 0000000..b9ce835 --- /dev/null +++ b/src/Datatype/AM/OriginServiceArea.php @@ -0,0 +1,43 @@ + [ + 'type' => 'ServiceAreaCode', + 'required' => false, + 'subobject' => false, + 'comment' => 'DHL service area code', + 'length' => '3', + ], + 'Description' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'OutboundSortCode' => [ + 'type' => 'OutboundSortCode', + 'required' => false, + 'subobject' => false, + 'comment' => 'OutBound Sort Code', + 'length' => '4', + ], + ]; +} diff --git a/DHL/Datatype/AP/Piece.php b/src/Datatype/AM/Piece.php similarity index 53% rename from DHL/Datatype/AP/Piece.php rename to src/Datatype/AM/Piece.php index a5ef6e1..2d21860 100644 --- a/DHL/Datatype/AP/Piece.php +++ b/src/Datatype/AM/Piece.php @@ -1,29 +1,8 @@ array( + protected $params = [ + 'PieceID' => [ 'type' => 'PieceID', 'required' => false, 'subobject' => false, 'comment' => 'Piece ID', 'maxLength' => '35', - ), - 'PackageType' => array( + ], + 'PackageType' => [ 'type' => 'PackageType', 'required' => false, 'subobject' => false, - 'comment' => 'Package Type (EE: DHL Express Envelope, OD:Other DHL Packaging, CP:Customer-provided.Ground shipments must choose CP)', + 'comment' => 'Package Type ( + EE: DHL Express Envelope, + OD:Other DHL Packaging, + CP:Customer-provided.Ground shipments must choose CP)', 'length' => '2', 'enumeration' => 'EE,OD,CP', - ), - 'Weight' => array( + ], + 'Weight' => [ 'type' => 'Weight', 'required' => false, 'subobject' => false, @@ -64,8 +46,8 @@ class Piece extends Base 'fractionDigits' => '1', 'maxInclusive' => '999999.9', 'totalDigits' => '7', - ), - 'DimWeight' => array( + ], + 'DimWeight' => [ 'type' => 'Weight', 'required' => false, 'subobject' => false, @@ -73,26 +55,26 @@ class Piece extends Base 'fractionDigits' => '1', 'maxInclusive' => '999999.9', 'totalDigits' => '7', - ), - 'Width' => array( + ], + 'Width' => [ 'type' => 'positiveInteger', 'required' => false, 'subobject' => false, - ), - 'Height' => array( + ], + 'Height' => [ 'type' => 'positiveInteger', 'required' => false, 'subobject' => false, - ), - 'Depth' => array( + ], + 'Depth' => [ 'type' => 'positiveInteger', 'required' => false, 'subobject' => false, - ), - 'PieceContents' => array( + ], + 'PieceContents' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - ); + ], + ]; } diff --git a/DHL/Datatype/EA/PieceDetails.php b/src/Datatype/AM/PieceDetails.php similarity index 53% rename from DHL/Datatype/EA/PieceDetails.php rename to src/Datatype/AM/PieceDetails.php index 4a0a7bc..21a7c5d 100644 --- a/DHL/Datatype/EA/PieceDetails.php +++ b/src/Datatype/AM/PieceDetails.php @@ -1,29 +1,8 @@ array( + protected $params = [ + 'AWBNumber' => [ 'type' => 'string', 'required' => true, 'subobject' => false, - ), - 'LicensePlate' => array( + ], + 'LicensePlate' => [ 'type' => 'TrackingPieceID', 'required' => true, 'subobject' => false, 'comment' => 'Piece ID', 'minLength' => '1', 'maxLength' => '35', - ), - 'PieceNumber' => array( + ], + 'PieceNumber' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ActualDepth' => array( + ], + 'ActualDepth' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ActualWidth' => array( + ], + 'ActualWidth' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ActualHeight' => array( + ], + 'ActualHeight' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ActualWeight' => array( + ], + 'ActualWeight' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Depth' => array( + ], + 'Depth' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Width' => array( + ], + 'Width' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Height' => array( + ], + 'Height' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Weight' => array( + ], + 'Weight' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'PackageType' => array( + ], + 'PackageType' => [ 'type' => 'PackageType', 'required' => false, 'subobject' => false, - 'comment' => 'Package Type (EE: DHL Express Envelope, OD:Other DHL Packaging, CP:Customer-provided.Ground shipments must choose CP)', + 'comment' => 'Package Type ( + EE: DHL Express Envelope, + OD:Other DHL Packaging, + CP:Customer-provided.Ground shipments must choose CP)', 'length' => '2', 'enumeration' => 'EE,OD,CP', - ), - 'DimWeight' => array( + ], + 'DimWeight' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'WeightUnit' => array( + ], + 'WeightUnit' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'PieceContents' => array( + ], + 'PieceContents' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - ); + ], + ]; } diff --git a/src/Datatype/AM/PieceEvent.php b/src/Datatype/AM/PieceEvent.php new file mode 100644 index 0000000..7a47cec --- /dev/null +++ b/src/Datatype/AM/PieceEvent.php @@ -0,0 +1,49 @@ + [ + 'type' => 'date', + 'required' => false, + 'subobject' => false, + ], + 'Time' => [ + 'type' => 'time', + 'required' => false, + 'subobject' => false, + ], + 'ServiceEvent' => [ + 'type' => 'ServiceEvent', + 'required' => false, + 'subobject' => true, + ], + 'Signatory' => [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + 'ServiceArea' => [ + 'type' => 'ServiceArea', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/src/Datatype/AM/PieceFault.php b/src/Datatype/AM/PieceFault.php new file mode 100644 index 0000000..2bc701c --- /dev/null +++ b/src/Datatype/AM/PieceFault.php @@ -0,0 +1,42 @@ + [ + 'type' => 'TrackingPieceID', + 'required' => true, + 'subobject' => false, + 'comment' => 'Piece ID', + 'minLength' => '1', + 'maxLength' => '35', + ], + 'ConditionCode' => [ + 'type' => 'string', + 'required' => true, + 'subobject' => false, + ], + 'ConditionData' => [ + 'type' => 'string', + 'required' => true, + 'subobject' => false, + ], + ]; +} diff --git a/src/Datatype/AM/PieceInfo.php b/src/Datatype/AM/PieceInfo.php new file mode 100644 index 0000000..8ed0a9f --- /dev/null +++ b/src/Datatype/AM/PieceInfo.php @@ -0,0 +1,34 @@ + [ + 'type' => 'PieceDetails', + 'required' => true, + 'subobject' => true, + ], + 'PieceEvent' => [ + 'type' => 'PieceEvent', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/src/Datatype/AM/PieceType.php b/src/Datatype/AM/PieceType.php new file mode 100644 index 0000000..7b337b3 --- /dev/null +++ b/src/Datatype/AM/PieceType.php @@ -0,0 +1,60 @@ + [ + 'type' => '', + 'required' => true, + 'subobject' => false, + ], + 'PackageTypeCode' => [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + 'Height' => [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + 'Depth' => [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + 'Width' => [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + 'Weight' => [ + 'type' => '', + 'required' => true, + 'subobject' => false, + ], + ]; +} diff --git a/src/Datatype/AM/Pieces.php b/src/Datatype/AM/Pieces.php new file mode 100644 index 0000000..b86c074 --- /dev/null +++ b/src/Datatype/AM/Pieces.php @@ -0,0 +1,29 @@ + [ + 'type' => 'Piece', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/DHL/Datatype/AM/Place.php b/src/Datatype/AM/Place.php similarity index 57% rename from DHL/Datatype/AM/Place.php rename to src/Datatype/AM/Place.php index 25df20f..2c2b691 100644 --- a/DHL/Datatype/AM/Place.php +++ b/src/Datatype/AM/Place.php @@ -1,29 +1,8 @@ array( + protected $params = [ + 'ResidenceOrBusiness' => [ 'type' => 'ResidenceOrBusiness', 'required' => false, 'subobject' => false, - 'comment' => 'Identifies if a location is a business, residence, or both (B:Business, R:Residence, C:Business Residence)', + 'comment' => 'Identifies if a location is a business, residence, or both + (B:Business, R:Residence, C:Business Residence)', 'length' => '1', 'enumeration' => 'B,R,C', - ), - 'CompanyName' => array( + ], + 'CompanyName' => [ 'type' => 'CompanyNameValidator', 'required' => false, 'subobject' => false, 'comment' => 'Name of company / business', 'maxLength' => '35', - ), - 'AddressLine' => array( + ], + 'AddressLine' => [ 'type' => 'AddressLine', 'required' => false, 'subobject' => false, 'comment' => 'Address Line', 'maxLength' => '35', - ), - 'City' => array( + ], + 'City' => [ 'type' => 'City', 'required' => false, 'subobject' => false, 'comment' => 'City name', 'maxLength' => '35', - ), - 'CountryCode' => array( + ], + 'CountryCode' => [ 'type' => 'CountryCode', 'required' => false, 'subobject' => false, 'comment' => 'ISO country codes', 'length' => '2', - ), - 'DivisionCode' => array( + ], + 'DivisionCode' => [ 'type' => 'StateCode', 'required' => false, 'subobject' => false, 'comment' => 'Division (state) code.', 'maxLength' => '2', 'minLength' => '2', - ), - 'Division' => array( + ], + 'Division' => [ 'type' => 'State', 'required' => false, 'subobject' => false, 'comment' => 'State', 'maxLength' => '35', - ), - 'PostalCode' => array( + ], + 'PostalCode' => [ 'type' => 'PostalCode', 'required' => false, 'subobject' => false, 'comment' => 'Full postal/zip code for address', - ), - ); + ], + ]; } diff --git a/DHL/Datatype/EA/QtdSInAdCur.php b/src/Datatype/AM/QtdSInAdCur.php similarity index 50% rename from DHL/Datatype/EA/QtdSInAdCur.php rename to src/Datatype/AM/QtdSInAdCur.php index 3f2a5e2..b462649 100644 --- a/DHL/Datatype/EA/QtdSInAdCur.php +++ b/src/Datatype/AM/QtdSInAdCur.php @@ -1,29 +1,8 @@ array( + protected $params = [ + 'CurrencyCode' => [ 'type' => 'CurrencyCode', 'required' => true, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ), - 'CurrencyRoleTypeCode' => array( + ], + 'CurrencyRoleTypeCode' => [ 'type' => 'CurrencyRoleTypeCode', 'required' => true, 'subobject' => false, 'comment' => 'CurrencyRoleTypeCode', 'maxLength' => '6', 'enumeration' => 'BILLCU,PULCL,INVCU,BASEC', - ), - 'PackageCharge' => array( + ], + 'PackageCharge' => [ 'type' => 'PackageCharge', 'required' => true, 'subobject' => false, 'comment' => 'PackageCharge', 'fractionDigits' => '3', 'totalDigits' => '18', - ), - 'ShippingCharge' => array( + ], + 'ShippingCharge' => [ 'type' => 'ShippingCharge', 'required' => true, 'subobject' => false, 'comment' => 'ShippingCharge', 'fractionDigits' => '3', 'totalDigits' => '18', - ), - ); + ], + ]; } diff --git a/src/Datatype/AM/QtdShpExChrgType.php b/src/Datatype/AM/QtdShpExChrgType.php new file mode 100644 index 0000000..eaecf39 --- /dev/null +++ b/src/Datatype/AM/QtdShpExChrgType.php @@ -0,0 +1,40 @@ + [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + 'LocalSpecialServiceType' => [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + ]; +} diff --git a/src/Datatype/AM/QtdShpType.php b/src/Datatype/AM/QtdShpType.php new file mode 100644 index 0000000..049cc52 --- /dev/null +++ b/src/Datatype/AM/QtdShpType.php @@ -0,0 +1,45 @@ + [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + 'LocalProductCode' => [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + 'QtdShpExChrg' => [ + 'type' => 'QtdShpExChrgType', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/src/Datatype/AM/Reference.php b/src/Datatype/AM/Reference.php new file mode 100644 index 0000000..5dfa770 --- /dev/null +++ b/src/Datatype/AM/Reference.php @@ -0,0 +1,38 @@ + [ + 'type' => 'ReferenceID', + 'required' => false, + 'subobject' => false, + 'comment' => 'Shipper reference ID', + 'maxLength' => '35', + ], + 'ReferenceType' => [ + 'type' => 'ReferenceType', + 'required' => false, + 'subobject' => false, + 'comment' => 'Shipment reference type', + 'length' => '2', + ], + ]; +} diff --git a/src/Datatype/AM/Request.php b/src/Datatype/AM/Request.php new file mode 100644 index 0000000..2e5012a --- /dev/null +++ b/src/Datatype/AM/Request.php @@ -0,0 +1,29 @@ + [ + 'type' => 'ServiceHeader', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/src/Datatype/AM/Response.php b/src/Datatype/AM/Response.php new file mode 100644 index 0000000..60fbe97 --- /dev/null +++ b/src/Datatype/AM/Response.php @@ -0,0 +1,29 @@ + [ + 'type' => 'ServiceHeader', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/src/Datatype/AM/ServiceArea.php b/src/Datatype/AM/ServiceArea.php new file mode 100644 index 0000000..47e1175 --- /dev/null +++ b/src/Datatype/AM/ServiceArea.php @@ -0,0 +1,36 @@ + [ + 'type' => 'ServiceAreaCode', + 'required' => false, + 'subobject' => false, + 'comment' => 'DHL service area code', + 'length' => '3', + ], + 'Description' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + ]; +} diff --git a/DHL/Datatype/EA/ServiceEvent.php b/src/Datatype/AM/ServiceEvent.php similarity index 84% rename from DHL/Datatype/EA/ServiceEvent.php rename to src/Datatype/AM/ServiceEvent.php index 25c9175..b9807d8 100644 --- a/DHL/Datatype/EA/ServiceEvent.php +++ b/src/Datatype/AM/ServiceEvent.php @@ -1,4 +1,5 @@ array( + protected $params = [ + 'EventCode' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'Description' => array( + ], + 'Description' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - ); + ], + ]; } diff --git a/src/Datatype/AM/ServiceHeader.php b/src/Datatype/AM/ServiceHeader.php new file mode 100644 index 0000000..54f4b9f --- /dev/null +++ b/src/Datatype/AM/ServiceHeader.php @@ -0,0 +1,53 @@ + [ + 'type' => 'dateTime', + 'required' => false, + 'subobject' => false, + ], + 'MessageReference' => [ + 'type' => 'MessageReference', + 'required' => false, + 'subobject' => false, + 'comment' => 'Reference to the requested Message', + 'minLength' => '28', + 'maxLength' => '32', + ], + 'SiteID' => [ + 'type' => 'SiteID', + 'required' => false, + 'subobject' => false, + 'comment' => 'Site ID used for verifying the sender', + 'minLength' => '6', + 'maxLength' => '20', + ], + 'Password' => [ + 'type' => 'Password', + 'required' => false, + 'subobject' => false, + 'comment' => 'Password used for verifying the sender', + 'minLength' => '8', + 'maxLength' => '20', + ], + ]; +} diff --git a/DHL/Datatype/AP/ShipValResponsePiece.php b/src/Datatype/AM/ShipValResponsePiece.php similarity index 57% rename from DHL/Datatype/AP/ShipValResponsePiece.php rename to src/Datatype/AM/ShipValResponsePiece.php index 173ee0a..1ad72d1 100644 --- a/DHL/Datatype/AP/ShipValResponsePiece.php +++ b/src/Datatype/AM/ShipValResponsePiece.php @@ -1,29 +1,8 @@ array( + protected $params = [ + 'PieceNumber' => [ 'type' => 'PieceNumber', 'required' => true, 'subobject' => false, 'comment' => 'Piece Number', - ), - 'Depth' => array( + ], + 'Depth' => [ 'type' => 'positiveInteger', 'required' => false, 'subobject' => false, - ), - 'Width' => array( + ], + 'Width' => [ 'type' => 'positiveInteger', 'required' => false, 'subobject' => false, - ), - 'Height' => array( + ], + 'Height' => [ 'type' => 'positiveInteger', 'required' => false, 'subobject' => false, - ), - 'Weight' => array( + ], + 'Weight' => [ 'type' => 'Weight', 'required' => false, 'subobject' => false, @@ -70,16 +49,19 @@ class ShipValResponsePiece extends Base 'fractionDigits' => '1', 'maxInclusive' => '999999.9', 'totalDigits' => '7', - ), - 'PackageType' => array( + ], + 'PackageType' => [ 'type' => 'PackageType', 'required' => false, 'subobject' => false, - 'comment' => 'Package Type (EE: DHL Express Envelope, OD:Other DHL Packaging, CP:Customer-provided.Ground shipments must choose CP)', + 'comment' => 'Package Type ( + EE: DHL Express Envelope, + OD:Other DHL Packaging, + CP:Customer-provided.Ground shipments must choose CP)', 'length' => '2', 'enumeration' => 'EE,OD,CP', - ), - 'DimWeight' => array( + ], + 'DimWeight' => [ 'type' => 'Weight', 'required' => false, 'subobject' => false, @@ -87,31 +69,31 @@ class ShipValResponsePiece extends Base 'fractionDigits' => '1', 'maxInclusive' => '999999.9', 'totalDigits' => '7', - ), - 'PieceContents' => array( + ], + 'PieceContents' => [ 'type' => 'PieceContents', 'required' => false, 'subobject' => false, 'comment' => 'Piece contents description', 'maxLength' => '90', - ), - 'DataIdentifier' => array( + ], + 'DataIdentifier' => [ 'type' => 'string', 'required' => true, 'subobject' => false, - ), - 'LicensePlate' => array( + ], + 'LicensePlate' => [ 'type' => 'PieceID', 'required' => true, 'subobject' => false, 'comment' => 'Piece ID', 'maxLength' => '35', - ), - 'LicensePlateBarCode' => array( + ], + 'LicensePlateBarCode' => [ 'type' => 'BarCode', 'required' => true, 'subobject' => false, 'comment' => '', - ), - ); + ], + ]; } diff --git a/src/Datatype/AM/ShipValResponsePieces.php b/src/Datatype/AM/ShipValResponsePieces.php new file mode 100644 index 0000000..42de66e --- /dev/null +++ b/src/Datatype/AM/ShipValResponsePieces.php @@ -0,0 +1,29 @@ + [ + 'type' => 'ShipValResponsePiece', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/DHL/Datatype/AP/Shipment.php b/src/Datatype/AM/Shipment.php similarity index 67% rename from DHL/Datatype/AP/Shipment.php rename to src/Datatype/AM/Shipment.php index 204f5bb..26347c4 100644 --- a/DHL/Datatype/AP/Shipment.php +++ b/src/Datatype/AM/Shipment.php @@ -1,29 +1,8 @@ array( + protected $params = [ + 'Weight' => [ 'type' => 'Weight', 'required' => false, 'subobject' => false, @@ -49,101 +28,101 @@ class Shipment extends Base 'fractionDigits' => '1', 'maxInclusive' => '999999.9', 'totalDigits' => '7', - ), - 'WeightUnit' => array( + ], + 'WeightUnit' => [ 'type' => 'WeightUnit', 'required' => false, 'subobject' => false, 'comment' => 'Unit of weight measurement (L:Pounds)', 'length' => '1', 'enumeration' => 'K,L', - ), - 'Pieces' => array( + ], + 'Pieces' => [ 'type' => 'Pieces', 'required' => false, 'subobject' => true, - ), - 'DoorTo' => array( + ], + 'DoorTo' => [ 'type' => 'DoorTo', 'required' => false, 'subobject' => false, 'comment' => 'Defines the type of delivery service that applies to the shipment', 'length' => '2', 'enumeration' => 'DD,DA,AA,DC', - ), - 'AirwarBillNumber' => array( + ], + 'AirwarBillNumber' => [ 'type' => 'AWBNumber', 'required' => false, 'subobject' => false, 'comment' => 'Airway bill number', 'maxLength' => '11', - ), - 'AccountType' => array( + ], + 'AccountType' => [ 'type' => 'AccountType', 'required' => false, 'subobject' => false, 'comment' => 'Account Type by method of payment ( DHL account vs. Credit card)', 'enumeration' => 'D', - ), - 'ProductType' => array( + ], + 'ProductType' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'GlobalProductType' => array( + ], + 'GlobalProductType' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'LocalProductType' => array( + ], + 'LocalProductType' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Commodity' => array( + ], + 'Commodity' => [ 'type' => 'Commodity', 'required' => false, 'subobject' => true, - ), - 'DeclaredValue' => array( + ], + 'DeclaredValue' => [ 'type' => 'Money', 'required' => false, 'subobject' => false, 'comment' => 'Monetary amount (with 2 decimal precision)', 'minInclusive' => '0.00', 'maxInclusive' => '9999999999.99', - ), - 'DeclaredCurrency' => array( + ], + 'DeclaredCurrency' => [ 'type' => 'CurrencyCode', 'required' => false, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ), - 'InsuredValue' => array( + ], + 'InsuredValue' => [ 'type' => 'Money', 'required' => false, 'subobject' => false, 'comment' => 'Monetary amount (with 2 decimal precision)', 'minInclusive' => '0.00', 'maxInclusive' => '9999999999.99', - ), - 'InsuredCurrency' => array( + ], + 'InsuredCurrency' => [ 'type' => 'CurrencyCode', 'required' => false, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ), - 'DimensionalUnit' => array( + ], + 'DimensionalUnit' => [ 'type' => 'WeightUnit', 'required' => false, 'subobject' => false, 'comment' => 'Unit of weight measurement (L:Pounds)', 'length' => '1', 'enumeration' => 'K,L', - ), - 'DimensionalWeight' => array( + ], + 'DimensionalWeight' => [ 'type' => 'Weight', 'required' => false, 'subobject' => false, @@ -151,6 +130,6 @@ class Shipment extends Base 'fractionDigits' => '1', 'maxInclusive' => '999999.9', 'totalDigits' => '7', - ), - ); + ], + ]; } diff --git a/src/Datatype/AM/ShipmentDate.php b/src/Datatype/AM/ShipmentDate.php new file mode 100644 index 0000000..9cfafe9 --- /dev/null +++ b/src/Datatype/AM/ShipmentDate.php @@ -0,0 +1,36 @@ + [ + 'type' => 'Date', + 'required' => false, + 'subobject' => false, + 'comment' => 'Date only', + ], + 'ShipmentDateTo' => [ + 'type' => 'Date', + 'required' => false, + 'subobject' => false, + 'comment' => 'Date only', + ], + ]; +} diff --git a/DHL/Datatype/AM/ShipmentDetails.php b/src/Datatype/AM/ShipmentDetails.php similarity index 66% rename from DHL/Datatype/AM/ShipmentDetails.php rename to src/Datatype/AM/ShipmentDetails.php index cefd548..ad1f59d 100644 --- a/DHL/Datatype/AM/ShipmentDetails.php +++ b/src/Datatype/AM/ShipmentDetails.php @@ -1,32 +1,13 @@ array( + protected $params = [ + 'NumberOfPieces' => [ 'type' => 'positiveInteger', 'required' => false, 'subobject' => false, - ), - 'Pieces' => array( + ], + 'Pieces' => [ 'type' => 'Piece', 'required' => false, 'subobject' => true, 'multivalues' => true, - ), - 'Weight' => array( + ], + 'Weight' => [ 'type' => 'Weight', 'required' => false, 'subobject' => false, @@ -60,22 +41,22 @@ class ShipmentDetails extends Base 'fractionDigits' => '1', 'maxInclusive' => '999999.9', 'totalDigits' => '7', - ), - 'WeightUnit' => array( + ], + 'WeightUnit' => [ 'type' => 'WeightUnit', 'required' => false, 'subobject' => false, 'comment' => 'Unit of weight measurement (L:Pounds)', 'length' => '1', 'enumeration' => 'K,L', - ), - 'ProductCode' => array( + ], + 'ProductCode' => [ 'type' => 'ProductCode', 'required' => false, 'subobject' => false, 'comment' => 'DHL product code D : US Overnight (>0.5 lb) and Worldwide Express Non-dutiable (>0.5 lb) - X : USA Express Envelope (less than or = 0.5 lb) and Worldwide Express-International Express Envelope (less than or = 0.5 lb) + X : USA Express Envelope (<= 0.5 lb) and Worldwide Express-International Express Envelope (<= 0.5 lb) W : Worldwide Express-Dutiable Y : DHL Second Day Express . Must be Express Envelop with weight lessthan or = 0.5 lb G : DHL Second Day . Weight > 0.5 lb or not an express envelop @@ -83,14 +64,14 @@ class ShipmentDetails extends Base 'pattern' => '([A-Z0-9])*', 'minLength' => '1', 'maxLength' => '4', - ), - 'GlobalProductCode' => array( + ], + 'GlobalProductCode' => [ 'type' => 'ProductCode', 'required' => false, 'subobject' => false, 'comment' => 'DHL product code D : US Overnight (>0.5 lb) and Worldwide Express Non-dutiable (>0.5 lb) - X : USA Express Envelope (less than or = 0.5 lb) and Worldwide Express-International Express Envelope (less than or = 0.5 lb) + X : USA Express Envelope (<= 0.5 lb) and Worldwide Express-International Express Envelope (<= 0.5 lb) W : Worldwide Express-Dutiable Y : DHL Second Day Express . Must be Express Envelop with weight lessthan or = 0.5 lb G : DHL Second Day . Weight > 0.5 lb or not an express envelop @@ -98,82 +79,85 @@ class ShipmentDetails extends Base 'pattern' => '([A-Z0-9])*', 'minLength' => '1', 'maxLength' => '4', - ), - 'LocalProductCode' => array( + ], + 'LocalProductCode' => [ 'type' => 'LocalProductCode', 'required' => false, 'subobject' => false, 'comment' => '', 'minLength' => '1', 'maxLength' => '4', - ), - 'Date' => array( + ], + 'Date' => [ 'type' => 'Date', 'required' => false, 'subobject' => false, 'comment' => 'Date only', - ), - 'Contents' => array( + ], + 'Contents' => [ 'type' => 'ShipmentContents', 'required' => false, 'subobject' => false, 'comment' => 'Shipment contents description', 'maxLength' => '90', - ), - 'DoorTo' => array( + ], + 'DoorTo' => [ 'type' => 'DoorTo', 'required' => false, 'subobject' => false, 'comment' => 'Defines the type of delivery service that applies to the shipment', 'length' => '2', 'enumeration' => 'DD,DA,AA,DC', - ), - 'DimensionUnit' => array( + ], + 'DimensionUnit' => [ 'type' => 'DimensionUnit', 'required' => false, 'subobject' => false, 'comment' => 'Dimension Unit I (inches)', 'length' => '1', 'enumeration' => 'C,I', - ), - 'InsuredAmount' => array( + ], + 'InsuredAmount' => [ 'type' => 'Money', 'required' => false, 'subobject' => false, 'comment' => 'Monetary amount (with 2 decimal precision)', 'minInclusive' => '0.00', 'maxInclusive' => '9999999999.99', - ), - 'PackageType' => array( + ], + 'PackageType' => [ 'type' => 'PackageType', 'required' => false, 'subobject' => false, - 'comment' => 'Package Type (EE: DHL Express Envelope, OD:Other DHL Packaging, CP:Customer-provided.Ground shipments must choose CP)', + 'comment' => 'Package Type ( + EE: DHL Express Envelope, + OD:Other DHL Packaging, + CP:Customer-provided.Ground shipments must choose CP)', 'length' => '2', 'enumeration' => 'EE,OD,CP', - ), - 'IsDutiable' => array( + ], + 'IsDutiable' => [ 'type' => 'YesNo', 'required' => false, 'subobject' => false, 'comment' => 'Boolean flag', 'length' => '1', 'enumeration' => 'Y,N', - ), - 'CurrencyCode' => array( + ], + 'CurrencyCode' => [ 'type' => 'CurrencyCode', 'required' => false, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ), - 'CustData' => array( + ], + 'CustData' => [ 'type' => 'CustData', 'required' => false, 'subobject' => false, 'comment' => 'CustData', 'minLength' => '1', 'maxLength' => '100', - ), - ); + ], + ]; } diff --git a/src/Datatype/AM/ShipmentEvent.php b/src/Datatype/AM/ShipmentEvent.php new file mode 100644 index 0000000..637ca03 --- /dev/null +++ b/src/Datatype/AM/ShipmentEvent.php @@ -0,0 +1,54 @@ + [ + 'type' => 'date', + 'required' => false, + 'subobject' => false, + ], + 'Time' => [ + 'type' => 'time', + 'required' => false, + 'subobject' => false, + ], + 'ServiceEvent' => [ + 'type' => 'ServiceEvent', + 'required' => false, + 'subobject' => true, + ], + 'Signatory' => [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + 'EventRemarks' => [ + 'type' => 'EventRemarks', + 'required' => false, + 'subobject' => true, + ], + 'ServiceArea' => [ + 'type' => 'ServiceArea', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/DHL/Datatype/AP/ShipmentInfo.php b/src/Datatype/AM/ShipmentInfo.php similarity index 56% rename from DHL/Datatype/AP/ShipmentInfo.php rename to src/Datatype/AM/ShipmentInfo.php index 4908487..65d5d67 100644 --- a/DHL/Datatype/AP/ShipmentInfo.php +++ b/src/Datatype/AM/ShipmentInfo.php @@ -1,29 +1,8 @@ array( + protected $params = [ + 'OriginServiceArea' => [ 'type' => 'OriginServiceArea', 'required' => false, 'subobject' => true, - ), - 'DestinationServiceArea' => array( + ], + 'DestinationServiceArea' => [ 'type' => 'DestinationServiceArea', 'required' => false, 'subobject' => true, - ), - 'ShipperName' => array( + ], + 'ShipperName' => [ 'type' => 'PersonName', 'required' => false, 'subobject' => false, 'comment' => 'Name', 'maxLength' => '35', - ), - 'ShipperAccountNumber' => array( + ], + 'ShipperAccountNumber' => [ 'type' => 'AccountNumber', 'required' => false, 'subobject' => false, 'comment' => 'DHL Account Number', 'maxInclusive' => '9999999999', 'minInclusive' => '100000000', - ), - 'ConsigneeName' => array( + ], + 'ConsigneeName' => [ 'type' => 'PersonName', 'required' => false, 'subobject' => false, 'comment' => 'Name', 'maxLength' => '35', - ), - 'ShipmentDate' => array( + ], + 'ShipmentDate' => [ 'type' => 'dateTime', 'required' => false, - 'subobject' => true, - ), - 'Pieces' => array( - 'type' => '', + 'subobject' => false, + ], + 'Pieces' => [ + 'type' => 'Piece', 'required' => false, 'subobject' => true, - ), - 'Weight' => array( + 'multivalues' => true, + ], + 'Weight' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'WeightUnit' => array( + ], + 'WeightUnit' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'EstDlvyDate' => array( + ], + 'EstDlvyDate' => [ 'type' => 'dateTime', 'required' => false, 'subobject' => false, - ), - 'EstDlvyDateUTC' => array( + ], + 'EstDlvyDateUTC' => [ 'type' => 'dateTime', 'required' => false, 'subobject' => false, - ), - 'GlobalProductCode' => array( + ], + 'GlobalProductCode' => [ 'type' => 'GlobalProductCode', 'required' => false, 'subobject' => false, 'comment' => '', 'minLength' => '1', 'maxLength' => '4', - ), - 'ShipmentDesc' => array( + ], + 'ShipmentDesc' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'DlvyNotificationFlag' => array( + ], + 'DlvyNotificationFlag' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'Shipper' => array( + ], + 'Shipper' => [ 'type' => 'Shipper', 'required' => false, 'subobject' => true, - ), - 'Consignee' => array( + ], + 'Consignee' => [ 'type' => 'Consignee', 'required' => false, 'subobject' => true, - ), - ); + ], + ]; } diff --git a/DHL/Datatype/AM/Shipper.php b/src/Datatype/AM/Shipper.php similarity index 63% rename from DHL/Datatype/AM/Shipper.php rename to src/Datatype/AM/Shipper.php index 0ad682f..8808be8 100644 --- a/DHL/Datatype/AM/Shipper.php +++ b/src/Datatype/AM/Shipper.php @@ -1,29 +1,8 @@ array( + protected $params = [ + 'ShipperID' => [ 'type' => 'ShipperID', 'required' => false, 'subobject' => false, 'comment' => 'Shipper\'s ID', 'maxLength' => '30', - ), - 'CompanyName' => array( + ], + 'CompanyName' => [ 'type' => 'CompanyNameValidator', 'required' => false, 'subobject' => false, 'comment' => 'Name of company / business', 'maxLength' => '35', - ), - 'RegisteredAccount' => array( + ], + 'RegisteredAccount' => [ 'type' => 'AccountNumber', 'required' => false, 'subobject' => false, 'comment' => 'DHL Account Number', 'maxInclusive' => '9999999999', 'minInclusive' => '100000000', - ), - 'AddressLine' => array( + ], + 'AddressLine' => [ 'type' => 'AddressLine', 'required' => false, 'subobject' => false, 'comment' => 'Address Line', 'maxLength' => '35', - ), - 'City' => array( + ], + 'City' => [ 'type' => 'City', 'required' => false, 'subobject' => false, 'comment' => 'City name', 'maxLength' => '35', - ), - 'Division' => array( + ], + 'Division' => [ 'type' => 'Division', 'required' => false, 'subobject' => false, 'comment' => 'Division (e.g. state, prefecture, etc.) name', 'maxLength' => '35', - ), - 'DivisionCode' => array( + ], + 'DivisionCode' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'PostalCode' => array( + ], + 'PostalCode' => [ 'type' => 'PostalCode', 'required' => false, 'subobject' => false, 'comment' => 'Full postal/zip code for address', - ), - 'OriginServiceAreaCode' => array( + ], + 'OriginServiceAreaCode' => [ 'type' => 'OriginServiceAreaCode', 'required' => false, 'subobject' => false, 'comment' => 'OriginServiceAreaCode', 'maxLength' => '3', - ), - 'OriginFacilityCode' => array( + ], + 'OriginFacilityCode' => [ 'type' => 'OriginFacilityCode', 'required' => false, 'subobject' => false, 'comment' => 'OriginFacilityCode', 'maxLength' => '3', - ), - 'CountryCode' => array( + ], + 'CountryCode' => [ 'type' => 'CountryCode', 'required' => false, 'subobject' => false, 'comment' => 'ISO country codes', 'length' => '2', - ), - 'CountryName' => array( + ], + 'CountryName' => [ 'type' => 'CountryName', 'required' => false, 'subobject' => false, 'comment' => 'ISO country name', 'maxLength' => '35', - ), - 'FederalTaxId' => array( + ], + 'FederalTaxId' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'StateTaxId' => array( + ], + 'StateTaxId' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'Contact' => array( + ], + 'Contact' => [ 'type' => 'Contact', 'required' => false, 'subobject' => true, - ), - ); + ], + ]; } diff --git a/DHL/Datatype/GB/SpecialService.php b/src/Datatype/AM/SpecialService.php similarity index 58% rename from DHL/Datatype/GB/SpecialService.php rename to src/Datatype/AM/SpecialService.php index 4cb8079..1193e26 100644 --- a/DHL/Datatype/GB/SpecialService.php +++ b/src/Datatype/AM/SpecialService.php @@ -1,29 +1,8 @@ array( + protected $params = [ + 'SpecialServiceType' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Special Service codes', 'maxLength' => '3', - ), - 'CommunicationAddress' => array( + ], + 'CommunicationAddress' => [ 'type' => 'CommunicationAddress', 'required' => false, 'subobject' => false, - 'comment' => 'Communications line number: phone number, fax - number', + 'comment' => 'Communications line number: phone number, fax number', 'maxLength' => '50', - ), - 'CommunicationType' => array( + ], + 'CommunicationType' => [ 'type' => 'CommunicationType', 'required' => false, 'subobject' => false, 'comment' => 'Communications line type (P: phone, F: fax)', 'length' => '1', 'enumeration' => 'P,F', - ), - 'SpecialServiceDesc' => array( + ], + 'SpecialServiceDesc' => [ 'type' => 'SpecialServiceDesc', 'required' => false, 'subobject' => false, 'comment' => 'Special Service Description', 'maxLength' => '45', - ), - 'ChargeValue' => array( + ], + 'ChargeValue' => [ 'type' => 'Money', 'required' => false, 'subobject' => false, 'comment' => 'Monetary amount (with 2 decimal precision)', 'minInclusive' => '0.00', 'maxInclusive' => '9999999999.99', - ), - 'CurrencyCode' => array( + ], + 'CurrencyCode' => [ 'type' => 'CurrencyCode', 'required' => false, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ), - 'IsWaived' => array( + ], + 'IsWaived' => [ 'type' => 'YesNo', 'required' => false, 'subobject' => false, 'comment' => 'Boolean flag', 'length' => '1', 'enumeration' => 'Y,N', - ), - ); + ], + ]; } diff --git a/src/Datatype/AM/Status.php b/src/Datatype/AM/Status.php new file mode 100644 index 0000000..b5e66ac --- /dev/null +++ b/src/Datatype/AM/Status.php @@ -0,0 +1,34 @@ + [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'Condition' => [ + 'type' => 'Condition', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/src/Datatype/AM/TrackingPieces.php b/src/Datatype/AM/TrackingPieces.php new file mode 100644 index 0000000..752b58c --- /dev/null +++ b/src/Datatype/AM/TrackingPieces.php @@ -0,0 +1,29 @@ + [ + 'type' => 'PieceInfo', + 'required' => true, + 'subobject' => true, + ], + ]; +} diff --git a/src/Datatype/AM/ValueAddedServices.php b/src/Datatype/AM/ValueAddedServices.php new file mode 100644 index 0000000..e3d6ae9 --- /dev/null +++ b/src/Datatype/AM/ValueAddedServices.php @@ -0,0 +1,28 @@ + [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'Service Code. Usually WY for paperless invoicing', + ], + ]; + +} \ No newline at end of file diff --git a/src/Datatype/AM/WeightSeg.php b/src/Datatype/AM/WeightSeg.php new file mode 100644 index 0000000..6aaec47 --- /dev/null +++ b/src/Datatype/AM/WeightSeg.php @@ -0,0 +1,41 @@ + [ + 'type' => 'Weight', + 'required' => false, + 'subobject' => false, + 'comment' => 'Weight of piece or shipment', + 'fractionDigits' => '1', + 'maxInclusive' => '999999.9', + 'totalDigits' => '7', + ], + 'WeightUnit' => [ + 'type' => 'WeightUnit', + 'required' => false, + 'subobject' => false, + 'comment' => 'Unit of weight measurement (L:Pounds)', + 'length' => '1', + 'enumeration' => 'K,L', + ], + ]; +} diff --git a/DHL/Datatype/EA/ShipmentDetails.php b/src/Datatype/AP/ShipmentDetails.php similarity index 64% rename from DHL/Datatype/EA/ShipmentDetails.php rename to src/Datatype/AP/ShipmentDetails.php index f006d58..3c568b5 100644 --- a/DHL/Datatype/EA/ShipmentDetails.php +++ b/src/Datatype/AP/ShipmentDetails.php @@ -1,57 +1,30 @@ array( + protected $params = [ + 'NumberOfPieces' => [ 'type' => 'positiveInteger', 'required' => false, 'subobject' => false, - ), - 'Pieces' => array( + ], + 'Pieces' => [ 'type' => 'Pieces', 'required' => false, 'subobject' => true, - ), - 'Weight' => array( + ], + 'Weight' => [ 'type' => 'Weight', 'required' => false, 'subobject' => false, @@ -59,22 +32,22 @@ class ShipmentDetails extends Base 'fractionDigits' => '1', 'maxInclusive' => '999999.9', 'totalDigits' => '7', - ), - 'WeightUnit' => array( + ], + 'WeightUnit' => [ 'type' => 'WeightUnit', 'required' => false, 'subobject' => false, 'comment' => 'Unit of weight measurement (L:Pounds)', 'length' => '1', 'enumeration' => 'K,L', - ), - 'ProductCode' => array( + ], + 'ProductCode' => [ 'type' => 'ProductCode', 'required' => false, 'subobject' => false, 'comment' => 'DHL product code D : US Overnight (>0.5 lb) and Worldwide Express Non-dutiable (>0.5 lb) - X : USA Express Envelope (less than or = 0.5 lb) and Worldwide Express-International Express Envelope (less than or = 0.5 lb) + X : USA Express Envelope (<= 0.5 lb) and Worldwide Express-International Express Envelope (<= 0.5 lb) W : Worldwide Express-Dutiable Y : DHL Second Day Express . Must be Express Envelop with weight lessthan or = 0.5 lb G : DHL Second Day . Weight > 0.5 lb or not an express envelop @@ -82,14 +55,14 @@ class ShipmentDetails extends Base 'pattern' => '([A-Z0-9])*', 'minLength' => '1', 'maxLength' => '4', - ), - 'GlobalProductCode' => array( + ], + 'GlobalProductCode' => [ 'type' => 'ProductCode', 'required' => false, 'subobject' => false, 'comment' => 'DHL product code D : US Overnight (>0.5 lb) and Worldwide Express Non-dutiable (>0.5 lb) - X : USA Express Envelope (less than or = 0.5 lb) and Worldwide Express-International Express Envelope (less than or = 0.5 lb) + X : USA Express Envelope (<= 0.5 lb) and Worldwide Express-International Express Envelope (<= 0.5 lb) W : Worldwide Express-Dutiable Y : DHL Second Day Express . Must be Express Envelop with weight lessthan or = 0.5 lb G : DHL Second Day . Weight > 0.5 lb or not an express envelop @@ -97,82 +70,85 @@ class ShipmentDetails extends Base 'pattern' => '([A-Z0-9])*', 'minLength' => '1', 'maxLength' => '4', - ), - 'LocalProductCode' => array( + ], + 'LocalProductCode' => [ 'type' => 'LocalProductCode', 'required' => false, 'subobject' => false, 'comment' => '', 'minLength' => '1', 'maxLength' => '4', - ), - 'Date' => array( + ], + 'Date' => [ 'type' => 'Date', 'required' => false, 'subobject' => false, 'comment' => 'Date only', - ), - 'Contents' => array( + ], + 'Contents' => [ 'type' => 'ShipmentContents', 'required' => false, 'subobject' => false, 'comment' => 'Shipment contents description', 'maxLength' => '90', - ), - 'DoorTo' => array( + ], + 'DoorTo' => [ 'type' => 'DoorTo', 'required' => false, 'subobject' => false, 'comment' => 'Defines the type of delivery service that applies to the shipment', 'length' => '2', 'enumeration' => 'DD,DA,AA,DC', - ), - 'DimensionUnit' => array( + ], + 'DimensionUnit' => [ 'type' => 'DimensionUnit', 'required' => false, 'subobject' => false, 'comment' => 'Dimension Unit I (inches)', 'length' => '1', 'enumeration' => 'C,I', - ), - 'InsuredAmount' => array( + ], + 'InsuredAmount' => [ 'type' => 'Money', 'required' => false, 'subobject' => false, 'comment' => 'Monetary amount (with 2 decimal precision)', 'minInclusive' => '0.00', 'maxInclusive' => '9999999999.99', - ), - 'PackageType' => array( + ], + 'PackageType' => [ 'type' => 'PackageType', 'required' => false, 'subobject' => false, - 'comment' => 'Package Type (EE: DHL Express Envelope, OD:Other DHL Packaging, CP:Customer-provided.Ground shipments must choose CP)', + 'comment' => 'Package Type ( + EE: DHL Express Envelope, + OD:Other DHL Packaging, + CP:Customer-provided.Ground shipments must choose CP)', 'length' => '2', 'enumeration' => 'EE,OD,CP', - ), - 'IsDutiable' => array( + ], + 'IsDutiable' => [ 'type' => 'YesNo', 'required' => false, 'subobject' => false, 'comment' => 'Boolean flag', 'length' => '1', 'enumeration' => 'Y,N', - ), - 'CurrencyCode' => array( + ], + 'CurrencyCode' => [ 'type' => 'CurrencyCode', 'required' => false, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ), - 'CustData' => array( + ], + 'CustData' => [ 'type' => 'CustData', 'required' => false, 'subobject' => false, 'comment' => 'CustData', 'minLength' => '1', 'maxLength' => '100', - ), - ); + ], + ]; } diff --git a/src/Datatype/Base.php b/src/Datatype/Base.php new file mode 100644 index 0000000..ff4dd4a --- /dev/null +++ b/src/Datatype/Base.php @@ -0,0 +1,445 @@ +initializeValues(); + } + + /** + * Check if current object is empty or not + * + * @return boolean True if it is, false otherwise + */ + public function isEmpty() + { + foreach ($this->values as $k => $v) { + if (is_object($v)) { + if (!$v->isEmpty()) { + return false; + } + } elseif (!empty($v) && $v !== null) { + return false; + } + } + + return true; + } + + /** + * Generates the XML to be sent to DHL + * + * @param \XMLWriter $xmlWriter XMl Writer instance + * + * @return void + */ + public function toXML(\XMLWriter $xmlWriter = null) + { + if ($this->isEmpty()) { + return; + } + + $displayedParentNode = false; + $this->validateParameters(); + + if (null !== $this->xml_node_name) { + $parentNode = $this->xml_node_name; + } else { + $parts = explode('\\', get_class($this)); + $parentNode = array_pop($parts); + } + + $xmlWriter->startElement($parentNode); + + foreach ($this->params as $name => $infos) { + if ($this->$name) { + if (is_object($this->$name)) { + $this->$name->toXML($xmlWriter); + } elseif (is_array($this->$name)) { + if ('string' == $this->params[$name]['type']) { + foreach ($this->$name as $sub_element) { + $xmlWriter->writeElement($name, $sub_element); + } + } else { + if ( + !isset($this->params[$name]['disableParentNode']) + || false == $this->params[$name]['disableParentNode'] + ) { + $xmlWriter->startElement($name); + } + + foreach ($this->$name as $sub_element) { + $sub_element->toXML($xmlWriter); + } + + if ( + !isset($this->params[$name]['disableParentNode']) + || false == $this->params[$name]['disableParentNode'] + ) { + $xmlWriter->endElement(); + } + } + } else { + $xmlWriter->writeElement($name, $this->$name); + } + } + } + + $xmlWriter->endElement(); // End of parent node + } + + /** + * Initialize object from an XML string + * + * @param string $xml XML String + * + * @return void + */ + public function initFromXML($xml) + { + $xml = simplexml_load_string(str_replace('req:', '', $xml)); + $parts = explode('\\', get_class($this)); + $className = array_pop($parts); + foreach ($xml->children() as $child) { + $childName = $child->getName(); + + if (isset($this->$childName) && is_object($this->$childName)) { + $this->$childName->initFromXml($child->asXML()); + } elseif (isset($this->params[$childName]['multivalues']) && $this->params[$childName]['multivalues']) { + foreach ($child->children() as $sub_child) { + $sub_child_name = $sub_child->getName(); + $child_class_name = implode('\\', $parts) . '\\' . $this->params[$sub_child_name]['type']; + $child_class_name = str_replace('Entity', 'Datatype', $child_class_name); + if ('string' == $this->params[$sub_child_name]['type']) { + $childObj = trim((string)$sub_child); + } else { + $childObj = new $child_class_name(); + $childObj->initFromXml($sub_child->asXML()); + } + $addMethodName = 'add' . ucfirst($sub_child_name); + $this->$addMethodName($childObj); + } + } elseif (isset($this->$childName) && ((string)$child)) { + $this->$childName = trim((string)$child); + } + } + } + + /** + * Setter for multivalues field + * + * @param string $key Key to set + * @param mixed $value Value to set + * + * @return void + * @throws \InvalidArgumentException Throws exception if key is not valid + */ + public function __call($name, $arguments) + { + $key = str_replace('add', '', $name); + + if ( + isset($this->params[$key . 's']) + && $this->params[$key . 's']['type'] !== 'string' + && isset($this->params[$key . 's']['multivalues']) + && true === $this->params[$key . 's']['multivalues'] + ) { + $key .= 's'; + } + + if (!array_key_exists($key, $this->values)) { + throw new \InvalidArgumentException('Field : ' . $key . ' is not defined for ' . get_class($this)); + } + + if (empty($arguments) && count($arguments) > 1) { + throw new \InvalidArgumentException($name . ' method takes only 1 argument'); + } + + $this->validateParameterType($key, $arguments[0]); + $this->validateParameterValue($key, $arguments[0]); + + if (isset($this->params[$key]['multivalues']) && $this->params[$key]['multivalues']) { + $this->values[$key][] = $arguments[0]; + } else { + $message = 'This is not a multivalues field : ' . $key . ' called via method ' . $name; + throw new \InvalidArgumentException($message); + } + } + + /** + * Magic isset function + * + * @param string $key Key to check + * + * @return bool True if it exsits, false otherwise + */ + final public function __isset($key) + { + return array_key_exists($key, $this->values); + } + + /** + * Magic getter function + * + * @param string $key Key to get + * + * @return mixed Value of the property + * @throws \InvalidArgumentException Throws exceptin if key is not valid + */ + final public function __get($key) + { + if (!array_key_exists($key, $this->values)) { + throw new \InvalidArgumentException('Field : ' . $key . ' is not defined for ' . get_class($this)); + } + + return $this->values[$key]; + } + + /** + * Magic setter function + * + * @param string $key Key to set + * @param mixed $value Value to set + * + * @return void + * @throws \InvalidArgumentException Throws exception if key is not valid + */ + final public function __set($key, $value) + { + if (!array_key_exists($key, $this->values)) { + throw new \InvalidArgumentException('Field : ' . $key . ' is not defined for ' . get_class($this)); + } + + $this->validateParameterType($key, $value); + $this->validateParameterValue($key, $value); + $this->values[$key] = $value; + } + + /** + * Initialize property values bag + * + * @return void + */ + protected function initializeValues() + { + foreach ($this->params as $name => $infos) { + if (isset($infos['multivalues']) && $infos['multivalues']) { + $this->values[$name] = []; + } elseif (isset($infos['subobject']) && $infos['subobject']) { + $tmp = get_class($this); + $parts = explode('\\', $tmp); + array_pop($parts); + $className = implode('\\', $parts) . '\\' . $infos['type']; + $this->values[$name] = new $className(); + } else { + $this->values[$name] = null; + } + } + } + + /** + * Validate all parameters + * + * @return boolean True upon success + * @throws \InvalidArgumentException Throws exception if type not valid or if value are missing + */ + protected function validateParameters() + { + foreach ($this->params as $name => $infos) { + if ($this->values[$name]) { + if (is_array($this->values[$name]) && isset($infos['subobject']) && true === $infos['subobject']) { + foreach ($this->values[$name] as $sub_element) { + $sub_element->validateParameters(); + } + } else { + $this->validateParameterType($name, $this->values[$name]); + $this->validateParameterValue($name, $this->values[$name]); + } + } + } + + return true; + } + + /** + * Validate the type of a parameter + * + * @param string $key Key to check + * @param mixed $value Value to check + * + * @return boolean True upon success + * @throws \InvalidArgumentException Throws exception if type is not valid + */ + protected function validateParameterType($key, $value) + { + if (null === $value) { + return true; + } + + switch ($this->params[$key]['type']) { + case 'string': + if ( + is_array($value) + && isset($this->params[$key]['multivalues']) + && true === $this->params[$key]['multivalues'] + ) { + foreach ($value as $subvalue) { + if (null !== $subvalue && $subvalue !== (string)$subvalue) { + throw new \InvalidArgumentException('Invalid type for ' . $key . '. It should be of type : ' + . $this->params[$key]['type'] . ' but it has a value of : ' . $subvalue); + } + } + } elseif ($value !== (string)$value) { + throw new \InvalidArgumentException('Invalid type for ' . $key . '. It should be of type : ' + . $this->params[$key]['type'] . ' but it has a value of : ' . $value); + } + break; + + case 'datetime': + case 'date-iso8601': + $timestamp = strtotime($value); + $date = date(DATE_ISO8601, $timestamp); + if (strtotime($date) !== strtotime($value)) { + throw new \InvalidArgumentException('Invalid type for ' . $key . '. It should be of type : ' + . $this->params[$key]['type'] . ' but it has a value of : ' . $value); + } + break; + + case 'positiveInteger': + case 'negativeInteger': + case 'integer': + if (false === filter_var((int)$value, FILTER_VALIDATE_INT) && ((int)$value != $value)) { + throw new \InvalidArgumentException('Invalid type for ' . $key . '. It should be of type : ' + . $this->params[$key]['type'] . ' but it has a value of : ' . $value); + } + break; + + case 'decimal': + case 'float': + case 'double': + if (false === filter_var((int)$value, FILTER_VALIDATE_FLOAT) && ((double)$value != $value)) { + throw new \InvalidArgumentException('Invalid type for ' . $key . '. It should be of type : ' + . $this->params[$key]['type'] . ' but it has a value of : ' . $value); + } + break; + + default: + if (isset($this->params[$key]['subobject']) && $this->params[$key]['subobject']) { + $currentClass = get_class($value); + $parts = explode('\\', $currentClass); + array_pop($parts); + $className = implode('\\', $parts) . '\\' . $this->params[$key]['type']; + $className = str_replace('Entity', 'DataType', $className); + if (!$value instanceof $className) { + throw new \InvalidArgumentException('Invalid type for ' . $key . '. It should be of type : ' + . $this->params[$key]['type'] . ' but it has a value of : "' . print_r($value, true) . '"'); + } + } + break; + } + + return true; + } + + /** + * Validate the value of a parameter + * + * @param string $key Key to check + * @param mixed $value Value to check + * + * @return boolean True upon success + * @throws \InvalidArgumentException Throws exception if value is not valid + */ + protected function validateParameterValue($key, $value) + { + foreach ($this->params[$key] as $type => $typeValue) { + switch ($type) { + case 'enumeration': + $acceptedValues = explode(',', $typeValue); + if (!in_array($value, $acceptedValues)) { + $message = 'Field ' . $key . ' cannot be set to value : ' . $value + . '. Accepted values are : ' . $typeValue; + throw new \InvalidArgumentException($message); + } + break; + + case 'length': + if (strlen($value) != $typeValue) { + $message = 'Field ' . $key . ' has a size of ' . strlen($value) + . ' and it should be that size : ' . $typeValue; + throw new \InvalidArgumentException($message); + } + break; + + case 'maxLength': + if (strlen($value) > $typeValue) { + $message = 'Field ' . $key . ' has a size of ' . strlen($value) + . ' and it cannot exceed this size : ' . $typeValue; + throw new \InvalidArgumentException($message); + } + break; + + case 'minLength': + if (strlen($value) < $typeValue) { + $message = 'Field ' . $key . ' has a size of ' . strlen($value) + . ' and it cannot be less than this size : ' . $typeValue; + throw new \InvalidArgumentException($message); + } + break; + + case 'minInclusive': + if ($value < $typeValue) { + throw new \InvalidArgumentException('Field ' . $key . ' cannot be smaller than ' . $typeValue); + } + break; + + case 'maxInclusive': + if ($value > $typeValue) { + throw new \InvalidArgumentException('Field ' . $key . ' cannot be higher than ' . $typeValue); + } + break; + + case 'pattern': + $matches = []; + $typeValue = "/" . $typeValue . "/"; + if (1 !== preg_match($typeValue, $value, $matches) || (strlen($value) > 0 && !$matches[0])) { + $message = 'Field ' . $key . ' should match regex pattern : ' . $typeValue + . ' and it has a value of ' . $value; + throw new \InvalidArgumentException($message); + } + break; + } + } + + return true; + } +} diff --git a/src/Datatype/EA/Label.php b/src/Datatype/EA/Label.php new file mode 100644 index 0000000..8acb4d5 --- /dev/null +++ b/src/Datatype/EA/Label.php @@ -0,0 +1,47 @@ + [ + 'type' => 'LabelTemplate', + 'required' => false, + 'subobject' => false, + 'comment' => 'LabelTemplate', + 'enumeration' => '8X4_A4_PDF,8X4_thermal,8X4_A4_TC_PDF,6X4_A4_PDF,8X4_CI_PDF,8X4_CI_thermal', + ], + 'Logo' => [ + 'type' => 'YesNo', + 'required' => false, + 'subobject' => false, + 'comment' => 'Boolean flag', + 'length' => '1', + 'enumeration' => 'Y,N', + ], + 'CustomerLogo' => [ + 'type' => 'CustomerLogo', + 'required' => false, + 'subobject' => true, + ], + 'Resolution' => [ + 'type' => 'Resolution', + 'required' => false, + 'subobject' => false, + 'comment' => 'Resolution', + 'minInclusive' => '200', + 'maxInclusive' => '300', + ], + ]; +} diff --git a/DHL/Datatype/AP/ShipmentDetails.php b/src/Datatype/EA/ShipmentDetails.php similarity index 64% rename from DHL/Datatype/AP/ShipmentDetails.php rename to src/Datatype/EA/ShipmentDetails.php index 8700109..de57f77 100644 --- a/DHL/Datatype/AP/ShipmentDetails.php +++ b/src/Datatype/EA/ShipmentDetails.php @@ -1,57 +1,30 @@ array( + protected $params = [ + 'NumberOfPieces' => [ 'type' => 'positiveInteger', 'required' => false, 'subobject' => false, - ), - 'Pieces' => array( + ], + 'Pieces' => [ 'type' => 'Pieces', 'required' => false, 'subobject' => true, - ), - 'Weight' => array( + ], + 'Weight' => [ 'type' => 'Weight', 'required' => false, 'subobject' => false, @@ -59,22 +32,22 @@ class ShipmentDetails extends Base 'fractionDigits' => '1', 'maxInclusive' => '999999.9', 'totalDigits' => '7', - ), - 'WeightUnit' => array( + ], + 'WeightUnit' => [ 'type' => 'WeightUnit', 'required' => false, 'subobject' => false, 'comment' => 'Unit of weight measurement (L:Pounds)', 'length' => '1', 'enumeration' => 'K,L', - ), - 'ProductCode' => array( + ], + 'ProductCode' => [ 'type' => 'ProductCode', 'required' => false, 'subobject' => false, 'comment' => 'DHL product code D : US Overnight (>0.5 lb) and Worldwide Express Non-dutiable (>0.5 lb) - X : USA Express Envelope (less than or = 0.5 lb) and Worldwide Express-International Express Envelope (less than or = 0.5 lb) + X : USA Express Envelope (<= 0.5 lb) and Worldwide Express-International Express Envelope (<= 0.5 lb) W : Worldwide Express-Dutiable Y : DHL Second Day Express . Must be Express Envelop with weight lessthan or = 0.5 lb G : DHL Second Day . Weight > 0.5 lb or not an express envelop @@ -82,14 +55,14 @@ class ShipmentDetails extends Base 'pattern' => '([A-Z0-9])*', 'minLength' => '1', 'maxLength' => '4', - ), - 'GlobalProductCode' => array( + ], + 'GlobalProductCode' => [ 'type' => 'ProductCode', 'required' => false, 'subobject' => false, 'comment' => 'DHL product code D : US Overnight (>0.5 lb) and Worldwide Express Non-dutiable (>0.5 lb) - X : USA Express Envelope (less than or = 0.5 lb) and Worldwide Express-International Express Envelope (less than or = 0.5 lb) + X : USA Express Envelope (< = 0.5 lb) and Worldwide Express-International Express Envelope (<= 0.5 lb) W : Worldwide Express-Dutiable Y : DHL Second Day Express . Must be Express Envelop with weight lessthan or = 0.5 lb G : DHL Second Day . Weight > 0.5 lb or not an express envelop @@ -97,82 +70,85 @@ class ShipmentDetails extends Base 'pattern' => '([A-Z0-9])*', 'minLength' => '1', 'maxLength' => '4', - ), - 'LocalProductCode' => array( + ], + 'LocalProductCode' => [ 'type' => 'LocalProductCode', 'required' => false, 'subobject' => false, 'comment' => '', 'minLength' => '1', 'maxLength' => '4', - ), - 'Date' => array( + ], + 'Date' => [ 'type' => 'Date', 'required' => false, 'subobject' => false, 'comment' => 'Date only', - ), - 'Contents' => array( + ], + 'Contents' => [ 'type' => 'ShipmentContents', 'required' => false, 'subobject' => false, 'comment' => 'Shipment contents description', 'maxLength' => '90', - ), - 'DoorTo' => array( + ], + 'DoorTo' => [ 'type' => 'DoorTo', 'required' => false, 'subobject' => false, 'comment' => 'Defines the type of delivery service that applies to the shipment', 'length' => '2', 'enumeration' => 'DD,DA,AA,DC', - ), - 'DimensionUnit' => array( + ], + 'DimensionUnit' => [ 'type' => 'DimensionUnit', 'required' => false, 'subobject' => false, 'comment' => 'Dimension Unit I (inches)', 'length' => '1', 'enumeration' => 'C,I', - ), - 'InsuredAmount' => array( + ], + 'InsuredAmount' => [ 'type' => 'Money', 'required' => false, 'subobject' => false, 'comment' => 'Monetary amount (with 2 decimal precision)', 'minInclusive' => '0.00', 'maxInclusive' => '9999999999.99', - ), - 'PackageType' => array( + ], + 'PackageType' => [ 'type' => 'PackageType', 'required' => false, 'subobject' => false, - 'comment' => 'Package Type (EE: DHL Express Envelope, OD:Other DHL Packaging, CP:Customer-provided.Ground shipments must choose CP)', + 'comment' => 'Package Type ( + EE: DHL Express Envelope, + OD:Other DHL Packaging, + CP:Customer-provided.Ground shipments must choose CP)', 'length' => '2', 'enumeration' => 'EE,OD,CP', - ), - 'IsDutiable' => array( + ], + 'IsDutiable' => [ 'type' => 'YesNo', 'required' => false, 'subobject' => false, 'comment' => 'Boolean flag', 'length' => '1', 'enumeration' => 'Y,N', - ), - 'CurrencyCode' => array( + ], + 'CurrencyCode' => [ 'type' => 'CurrencyCode', 'required' => false, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ), - 'CustData' => array( + ], + 'CustData' => [ 'type' => 'CustData', 'required' => false, 'subobject' => false, 'comment' => 'CustData', 'minLength' => '1', 'maxLength' => '100', - ), - ); + ], + ]; } diff --git a/DHL/Datatype/EA/ShipmentInfo.php b/src/Datatype/EA/ShipmentInfo.php similarity index 54% rename from DHL/Datatype/EA/ShipmentInfo.php rename to src/Datatype/EA/ShipmentInfo.php index 5cd07c5..c279170 100644 --- a/DHL/Datatype/EA/ShipmentInfo.php +++ b/src/Datatype/EA/ShipmentInfo.php @@ -1,135 +1,109 @@ array( + protected $params = [ + 'OriginServiceArea' => [ 'type' => 'OriginServiceArea', 'required' => false, 'subobject' => true, - ), - 'DestinationServiceArea' => array( + ], + 'DestinationServiceArea' => [ 'type' => 'DestinationServiceArea', 'required' => false, 'subobject' => true, - ), - 'ShipperName' => array( + ], + 'ShipperName' => [ 'type' => 'PersonName', 'required' => false, 'subobject' => false, 'comment' => 'Name', 'maxLength' => '35', - ), - 'ShipperAccountNumber' => array( + ], + 'ShipperAccountNumber' => [ 'type' => 'AccountNumber', 'required' => false, 'subobject' => false, 'comment' => 'DHL Account Number', 'maxInclusive' => '9999999999', 'minInclusive' => '100000000', - ), - 'ConsigneeName' => array( + ], + 'ConsigneeName' => [ 'type' => 'PersonName', 'required' => false, 'subobject' => false, 'comment' => 'Name', 'maxLength' => '35', - ), - 'ShipmentDate' => array( + ], + 'ShipmentDate' => [ 'type' => 'dateTime', 'required' => false, 'subobject' => false, - ), - 'Pieces' => array( + ], + 'Pieces' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Weight' => array( + ], + 'Weight' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'WeightUnit' => array( + ], + 'WeightUnit' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'EstDlvyDate' => array( + ], + 'EstDlvyDate' => [ 'type' => 'dateTime', 'required' => false, 'subobject' => false, - ), - 'EstDlvyDateUTC' => array( + ], + 'EstDlvyDateUTC' => [ 'type' => 'dateTime', 'required' => false, 'subobject' => false, - ), - 'GlobalProductCode' => array( + ], + 'GlobalProductCode' => [ 'type' => 'GlobalProductCode', 'required' => false, 'subobject' => false, 'comment' => '', 'minLength' => '1', 'maxLength' => '4', - ), - 'ShipmentDesc' => array( + ], + 'ShipmentDesc' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'DlvyNotificationFlag' => array( + ], + 'DlvyNotificationFlag' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'Shipper' => array( + ], + 'Shipper' => [ 'type' => 'Shipper', 'required' => false, 'subobject' => true, - ), - 'Consignee' => array( + ], + 'Consignee' => [ 'type' => 'Consignee', 'required' => false, 'subobject' => true, - ), - ); + ], + ]; } diff --git a/DHL/Datatype/EA/SpecialService.php b/src/Datatype/EA/SpecialService.php similarity index 51% rename from DHL/Datatype/EA/SpecialService.php rename to src/Datatype/EA/SpecialService.php index 3cac48a..08764e5 100644 --- a/DHL/Datatype/EA/SpecialService.php +++ b/src/Datatype/EA/SpecialService.php @@ -1,90 +1,63 @@ array( + protected $params = [ + 'SpecialServiceType' => [ 'type' => 'SpecialServiceType', 'required' => false, 'subobject' => false, 'comment' => 'Special Service codes', 'maxLength' => '3', - ), - 'CommunicationAddress' => array( + ], + 'CommunicationAddress' => [ 'type' => 'CommunicationAddress', 'required' => false, 'subobject' => false, 'comment' => 'Communications line number: phone number, fax number', 'maxLength' => '50', - ), - 'CommunicationType' => array( + ], + 'CommunicationType' => [ 'type' => 'CommunicationType', 'required' => false, 'subobject' => false, 'comment' => 'Communications line type (P: phone, F: fax)', 'length' => '1', 'enumeration' => 'P,F', - ), - 'ChargeValue' => array( + ], + 'ChargeValue' => [ 'type' => 'Money', 'required' => false, 'subobject' => false, 'comment' => 'Monetary amount (with 2 decimal precision)', 'minInclusive' => '0.00', 'maxInclusive' => '9999999999.99', - ), - 'CurrencyCode' => array( + ], + 'CurrencyCode' => [ 'type' => 'CurrencyCode', 'required' => false, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ), - 'IsWaived' => array( + ], + 'IsWaived' => [ 'type' => 'YesNo', 'required' => false, 'subobject' => false, 'comment' => 'Boolean flag', 'length' => '1', 'enumeration' => 'Y,N', - ), - ); + ], + ]; } diff --git a/src/Datatype/EU/AWBInfo.php b/src/Datatype/EU/AWBInfo.php new file mode 100644 index 0000000..526c9e7 --- /dev/null +++ b/src/Datatype/EU/AWBInfo.php @@ -0,0 +1,36 @@ + [ + 'type' => 'AWBNumber', + 'required' => false, + 'subobject' => false, + 'comment' => 'Airway bill number', + 'maxLength' => '10', + ], + 'Status' => [ + 'type' => 'Status', + 'required' => false, + 'subobject' => true, + ], + 'ShipmentInfo' => [ + 'type' => 'ShipmentInfo', + 'required' => false, + 'subobject' => true, + ], + 'PieceInfo' => [ + 'type' => 'PieceInfo', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/src/Datatype/EU/AdditionalProtection.php b/src/Datatype/EU/AdditionalProtection.php new file mode 100644 index 0000000..b7d2fae --- /dev/null +++ b/src/Datatype/EU/AdditionalProtection.php @@ -0,0 +1,41 @@ + [ + 'type' => 'Code', + 'required' => false, + 'subobject' => false, + 'comment' => 'Code', + 'length' => '2', + 'enumeration' => 'AP,NR', + ], + 'Value' => [ + 'type' => 'Value', + 'required' => false, + 'subobject' => false, + 'comment' => 'Value', + 'maxInclusive' => '9999999.99', + ], + ]; +} diff --git a/src/Datatype/EU/BarCode.php b/src/Datatype/EU/BarCode.php new file mode 100644 index 0000000..8920d3b --- /dev/null +++ b/src/Datatype/EU/BarCode.php @@ -0,0 +1,32 @@ + [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => '', + ], + ]; +} diff --git a/src/Datatype/EU/BarCodes.php b/src/Datatype/EU/BarCodes.php new file mode 100644 index 0000000..cea2a38 --- /dev/null +++ b/src/Datatype/EU/BarCodes.php @@ -0,0 +1,42 @@ + [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => '', + ], + 'OriginDestnBarcode' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => '', + ], + 'ClientIDBarCode' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => '', + ], + 'DHLRoutingBarCode' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => '', + ], + ]; +} diff --git a/src/Datatype/EU/Billing.php b/src/Datatype/EU/Billing.php new file mode 100644 index 0000000..91e0389 --- /dev/null +++ b/src/Datatype/EU/Billing.php @@ -0,0 +1,55 @@ + [ + 'type' => 'AccountNumber', + 'required' => false, + 'subobject' => false, + 'comment' => 'DHL Account Number', + 'maxLength' => '12', + ], + 'ShippingPaymentType' => [ + 'type' => 'ShipmentPaymentType', + 'required' => false, + 'subobject' => false, + 'comment' => 'Shipment payment type (S:Shipper)', + 'length' => '1', + 'enumeration' => 'S,R,T', + ], + 'BillingAccountNumber' => [ + 'type' => 'AccountNumber', + 'required' => false, + 'subobject' => false, + 'comment' => 'DHL Account Number', + 'maxLength' => '12', + ], + 'DutyPaymentType' => [ + 'type' => 'DutyTaxPaymentType', + 'required' => false, + 'subobject' => false, + 'comment' => 'Duty and tax charge payment type (R:Recipient)', + 'length' => '1', + 'enumeration' => 'S,R,T', + ], + 'DutyAccountNumber' => [ + 'type' => 'AccountNumber', + 'required' => false, + 'subobject' => false, + 'comment' => 'DHL Account Number', + 'maxLength' => '12', + ], + ]; +} diff --git a/src/Datatype/EU/ChargeCard.php b/src/Datatype/EU/ChargeCard.php new file mode 100644 index 0000000..0304be9 --- /dev/null +++ b/src/Datatype/EU/ChargeCard.php @@ -0,0 +1,49 @@ + [ + 'type' => 'ChargeCardNo', + 'required' => false, + 'subobject' => false, + 'comment' => 'Charge card number', + 'minInclusive' => '1000000000000', + 'maxInclusive' => '9999999999999999', + 'pattern' => '\d{13,16}', + ], + 'ChargeCardType' => [ + 'type' => 'ChargeCardType', + 'required' => false, + 'subobject' => false, + 'comment' => 'Charge card issuer type', + 'length' => '2', + 'enumeration' => 'AM,DC,DI,MC,VI', + ], + 'ChargeCardConfNo' => [ + 'type' => 'ChargeCardConfNo', + 'required' => false, + 'subobject' => false, + 'comment' => 'Charge card confirmation number', + 'pattern' => '\d{0,6}', + ], + 'ChargeCardExpiryDate' => [ + 'type' => 'ChargeCardExpDateValidator', + 'required' => false, + 'subobject' => false, + 'comment' => 'Charge card expiration date', + 'pattern' => '(0[1-9]|1[0-2])\d{1}[0-9]', + ], + ]; +} diff --git a/src/Datatype/EU/Consignee.php b/src/Datatype/EU/Consignee.php new file mode 100644 index 0000000..c129145 --- /dev/null +++ b/src/Datatype/EU/Consignee.php @@ -0,0 +1,132 @@ + [ + 'type' => 'CompanyNameValidator', + 'required' => false, + 'subobject' => false, + 'comment' => 'Name of company / business', + 'minLength' => '0', + ], + 'SuiteDepartmentName' => [ + 'type' => 'SuiteDepartmentName', + 'required' => false, + 'subobject' => false, + 'comment' => 'SuiteDepartmentName', + ], + 'AddressLine1' => [ + 'type' => 'string', + 'required' => true, + 'subobject' => false, + 'comment' => 'Address Line 1', + 'multivalues' => true, + ], + 'AddressLine2' => [ + 'type' => 'string', + 'required' => true, + 'subobject' => false, + 'comment' => 'Address Line 2', + 'multivalues' => true, + ], + 'AddressLine3' => [ + 'type' => 'string', + 'required' => true, + 'subobject' => false, + 'comment' => 'Address Line 3', + 'multivalues' => true, + ], + 'StreetName' => [ + 'type' => 'string', + 'required' => true, + 'subobject' => false, + 'comment' => 'Street Name', + 'multivalues' => true, + ], + 'BuildingName' => [ + 'type' => 'string', + 'required' => true, + 'subobject' => false, + 'comment' => 'Building Name', + 'multivalues' => true, + ], + 'StreetNUmber' => [ + 'type' => 'string', + 'required' => true, + 'subobject' => false, + 'comment' => 'Street Number', + 'multivalues' => true, + ], + 'City' => [ + 'type' => 'City', + 'required' => false, + 'subobject' => false, + 'comment' => 'City name', + ], + 'Division' => [ + 'type' => 'Division', + 'required' => false, + 'subobject' => false, + 'comment' => 'Division (e.g. state, prefecture, etc.) name', + ], + 'DivisionCode' => [ + 'type' => 'DivisionCode', + 'required' => false, + 'subobject' => false, + 'comment' => 'Division (e.g. state, prefecture, etc.) code', + ], + 'PostalCode' => [ + 'type' => 'PostalCode', + 'required' => false, + 'subobject' => false, + 'comment' => 'Full postal/zip code for address', + ], + 'CountryCode' => [ + 'type' => 'CountryCode', + 'required' => false, + 'subobject' => false, + 'comment' => 'ISO country codes', + 'length' => '2', + ], + 'CountryName' => [ + 'type' => 'CountryName', + 'required' => false, + 'subobject' => false, + 'comment' => 'ISO country name', + ], + 'FederalTaxId' => [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + 'StateTaxId' => [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + 'Contact' => [ + 'type' => 'Contact', + 'required' => false, + 'subobject' => true, + ], + 'BusinessPartyTypeCode' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'Possible Values: + - BU (business) + - DC (direct consumer) + - GV (government) + - OT (other) + - PR (private) + - RE (reseller)', + ], + ]; +} diff --git a/src/Datatype/EU/Contact.php b/src/Datatype/EU/Contact.php new file mode 100644 index 0000000..8593643 --- /dev/null +++ b/src/Datatype/EU/Contact.php @@ -0,0 +1,74 @@ + [ + 'type' => 'PersonName', + 'required' => false, + 'subobject' => false, + 'comment' => 'Name', + 'maxLength' => '35', + ], + 'PhoneNumber' => [ + 'type' => 'PhoneNumber', + 'required' => false, + 'subobject' => false, + 'comment' => 'Phone Number', + 'maxLength' => '25', + ], + 'Phone' => [ + 'type' => 'PhoneNumber', + 'required' => false, + 'subobject' => false, + 'comment' => 'Phone Number', + 'maxLength' => '25', + ], + 'PhoneExtension' => [ + 'type' => 'PhoneExtension', + 'required' => false, + 'subobject' => false, + 'comment' => '', + 'maxLength' => '5', + ], + 'FaxNumber' => [ + 'type' => 'PhoneNumber', + 'required' => false, + 'subobject' => false, + 'comment' => 'Phone Number', + 'maxLength' => '25', + ], + 'Telex' => [ + 'type' => 'Telex', + 'required' => false, + 'subobject' => false, + 'comment' => 'Telex number and answer back code', + 'maxLength' => '25', + ], + 'Email' => [ + 'type' => 'EmailAddress', + 'required' => false, + 'subobject' => false, + 'comment' => 'Email address containing \'@\'', + 'maxLength' => '50', + ], + 'MobilePhoneNumber' => [ + 'type' => 'PhoneNumber', + 'required' => false, + 'subobject' => false, + 'comment' => 'Mobile Phone Number', + 'maxLength' => '25', + ], + ]; +} diff --git a/src/Datatype/EU/DestinationServiceArea.php b/src/Datatype/EU/DestinationServiceArea.php new file mode 100644 index 0000000..ca50a9e --- /dev/null +++ b/src/Datatype/EU/DestinationServiceArea.php @@ -0,0 +1,44 @@ + [ + 'type' => 'ServiceAreaCode', + 'required' => false, + 'subobject' => false, + 'comment' => 'DHL service area code', + 'length' => '3', + ], + 'Description' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'FacilityCode' => [ + 'type' => 'FacilityCode', + 'required' => false, + 'subobject' => false, + 'comment' => 'Destination Facility Code', + 'length' => '3', + ], + 'InboundSortCode' => [ + 'type' => 'InboundSortCode', + 'required' => false, + 'subobject' => false, + 'comment' => 'InBound Sort Code', + 'maxLength' => '4', + ], + ]; +} diff --git a/DHL/Datatype/GB/Dutiable.php b/src/Datatype/EU/Dutiable.php similarity index 55% rename from DHL/Datatype/GB/Dutiable.php rename to src/Datatype/EU/Dutiable.php index 216fdfe..5c8d522 100644 --- a/DHL/Datatype/GB/Dutiable.php +++ b/src/Datatype/EU/Dutiable.php @@ -1,121 +1,95 @@ array( + protected $params = [ + 'DeclaredValue' => [ 'type' => 'DeclaredValue', 'required' => false, 'subobject' => false, 'comment' => 'DeclaredValue', 'minInclusive' => '0.00', 'maxInclusive' => '9999999999.99', - ), - 'DeclaredCurrency' => array( + ], + 'DeclaredCurrency' => [ 'type' => 'CurrencyCode', 'required' => false, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ), - 'ScheduleB' => array( + ], + 'ScheduleB' => [ 'type' => 'ScheduleB', 'required' => false, 'subobject' => false, 'comment' => 'Schedule B numner', 'maxLength' => '15', - ), - 'ExportLicense' => array( + ], + 'ExportLicense' => [ 'type' => 'ExportLicense', 'required' => false, 'subobject' => false, 'comment' => 'ExportLicense', 'maxLength' => '16', - ), - 'ShipperEIN' => array( + ], + 'ShipperEIN' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'ShipperIDType' => array( + ], + 'ShipperIDType' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'ConsigneeIDType' => array( + ], + 'ConsigneeIDType' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'ImportLicense' => array( + ], + 'ImportLicense' => [ 'type' => 'ImportLicense', 'required' => false, 'subobject' => false, 'comment' => '\"ImportLicense\"', 'maxLength' => '16', - ), - 'ConsigneeEIN' => array( + ], + 'ConsigneeEIN' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'TermsOfTrade' => array( + ], + 'TermsOfTrade' => [ 'type' => 'TermsOfTrade', 'required' => false, 'subobject' => false, 'comment' => '\"TermsOfTrade\"', 'maxLength' => '3', - ), - 'CommerceLicensed' => array( + ], + 'CommerceLicensed' => [ 'type' => 'YesNo', 'required' => false, 'subobject' => false, 'comment' => 'Boolean flag', 'length' => '1', 'enumeration' => 'Y,N', - ), - 'Filing' => array( + ], + 'Filing' => [ 'type' => 'Filing', 'required' => false, 'subobject' => true, - ), - ); + ], + ]; } diff --git a/DHL/Datatype/GB/ExportDeclaration.php b/src/Datatype/EU/ExportDeclaration.php similarity index 52% rename from DHL/Datatype/GB/ExportDeclaration.php rename to src/Datatype/EU/ExportDeclaration.php index ebe83f1..278de2c 100644 --- a/DHL/Datatype/GB/ExportDeclaration.php +++ b/src/Datatype/EU/ExportDeclaration.php @@ -1,119 +1,124 @@ array( + protected $params = [ + 'InterConsignee' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'IsPartiesRelation' => array( + ], + 'IsPartiesRelation' => [ 'type' => 'YesNo', 'required' => false, 'subobject' => false, 'comment' => 'Boolean flag', 'length' => '1', 'enumeration' => 'Y,N', - ), - 'ECCN' => array( + ], + 'ECCN' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'SignatureName' => array( + ], + 'SignatureName' => [ 'type' => 'SignatureName', 'required' => false, 'subobject' => false, 'comment' => 'Signature name', 'maxLength' => '35', - ), - 'SignatureTitle' => array( + ], + 'SignatureTitle' => [ 'type' => 'SignatureTitle', 'required' => false, 'subobject' => false, 'comment' => 'Signature title', 'maxLength' => '35', - ), - 'ExportReason' => array( + ], + 'ExportReason' => [ 'type' => 'ExportReason', 'required' => false, 'subobject' => false, 'comment' => 'Export reason', - 'length' => '1', - ), - 'ExportReasonCode' => array( + ], + 'ExportReasonCode' => [ 'type' => 'ExportReasonCode', 'required' => false, 'subobject' => false, 'comment' => 'Export reason code (P:Permanent, T:Temporary, R:Re-Export)', 'length' => '1', - 'enumeration' => 'P,T,R', - ), - 'SedNumber' => array( + 'enumeration' => 'P,T,R,M,I,C,E,S,G,U,W,D,F', + ], + 'SedNumber' => [ 'type' => 'SEDNumber', 'required' => false, 'subobject' => false, 'comment' => '', 'enumeration' => 'FTSR,XTN,SAS,ITN', - ), - 'SedNumberType' => array( + ], + 'SedNumberType' => [ 'type' => 'SEDNumberType', 'required' => false, 'subobject' => false, 'comment' => '', 'length' => '1', 'enumeration' => 'F,X,S,I', - ), - 'MxStateCode' => array( - 'type' => '', + ], + 'InvoiceNumber' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'InvoiceDate' => [ + 'type' => 'dateTime', 'required' => false, 'subobject' => false, - ), - 'ExportLineItems' => array( + ], + 'OtherCharges' => [ + 'type' => 'OtherCharge', + 'required' => false, + 'subobject' => true, + 'multivalues' => true, + ], + 'ExportLineItems' => [ 'type' => 'ExportLineItem', 'required' => false, 'subobject' => true, 'multivalues' => true, 'disableParentNode' => true, - ), - ); + ], + 'PlaceOfIncoterm' => [ + 'type' => 'PlaceOfIncoterm', + 'required' => true, + 'subobject' => false, + 'comment' => '', + ], + 'ShipmentPurpose' => [ + 'type' => 'ShipmentPurpose', + 'required' => false, + 'subobject' => false, + 'comment' => 'COMMERCIAL or PERSONAL (B2B / B2C)', + ], + 'MxStateCode' => [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + 'InvoiceTotalGrossWeight' => [ + 'type' => 'decimal', + 'required' => false, + 'subobject' => false, + ], + ]; } diff --git a/DHL/Datatype/GB/ExportLineItem.php b/src/Datatype/EU/ExportLineItem.php similarity index 56% rename from DHL/Datatype/GB/ExportLineItem.php rename to src/Datatype/EU/ExportLineItem.php index cf39ab5..dd7a705 100644 --- a/DHL/Datatype/GB/ExportLineItem.php +++ b/src/Datatype/EU/ExportLineItem.php @@ -1,122 +1,114 @@ array( + protected $params = [ + 'LineNumber' => [ 'type' => 'LineNumber', 'required' => false, 'subobject' => false, 'comment' => '', 'minInclusive' => '1', 'maxInclusive' => '200', - ), - 'Quantity' => array( + ], + 'Quantity' => [ 'type' => 'Quantity', 'required' => false, 'subobject' => false, 'comment' => 'Quantity', 'maxInclusive' => '32000', - ), - 'QuantityUnit' => array( + ], + 'QuantityUnit' => [ 'type' => 'QuantityUnit', 'required' => false, 'subobject' => false, 'comment' => 'Quantity unit of measure (tens, hundreds, thousands, etc.)', 'maxLength' => '8', - ), - 'Description' => array( + ], + 'Description' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'Value' => array( + ], + 'Value' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'IsDomestic' => array( + ], + 'IsDomestic' => [ 'type' => 'YesNo', 'required' => false, 'subobject' => false, 'comment' => 'Boolean flag', 'length' => '1', 'enumeration' => 'Y,N', - ), - 'CommodityCode' => array( + ], + 'CommodityCode' => [ 'type' => 'CommodityCode', 'required' => false, 'subobject' => false, 'comment' => 'Commodity codes for shipment type', 'minLength' => '1', 'maxLength' => '20', - ), - 'ScheduleB' => array( + ], + 'ScheduleB' => [ 'type' => 'ScheduleB', 'required' => false, 'subobject' => false, 'comment' => 'Schedule B numner', 'maxLength' => '15', - ), - 'ECCN' => array( + ], + 'ECCN' => [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + 'Weight' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'Weight' => array( + ], + 'GrossWeight' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'License' => array( + ], + 'License' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'LicenseSymbol' => array( + ], + 'LicenseSymbol' => [ 'type' => 'LicenseNumber', 'required' => false, 'subobject' => false, 'comment' => 'Export license number', 'maxLength' => '16', - ), - ); + ], + 'ManufactureCountryCode' => [ + 'type' => 'ManufactureCountryCode', + 'required' => false, + 'subobject' => false, + 'comment' => 'Country Code for manufacturing', + ], + 'ImportCommodityCode' => [ + 'type' => 'ImportCommodityCode', + 'required' => false, + 'subobject' => false, + 'comment' => 'Commodity codes for shipment type', + 'minLength' => '1', + 'maxLength' => '20', + ], + ]; } diff --git a/DHL/Datatype/GB/Filing.php b/src/Datatype/EU/Filing.php similarity index 83% rename from DHL/Datatype/GB/Filing.php rename to src/Datatype/EU/Filing.php index 5eacd53..663fe7e 100644 --- a/DHL/Datatype/GB/Filing.php +++ b/src/Datatype/EU/Filing.php @@ -1,4 +1,5 @@ array( + protected $params = [ + 'FilingType' => [ 'type' => 'FilingType', 'required' => false, 'subobject' => false, @@ -49,31 +50,32 @@ class Filing extends Base 'minLength' => '3', 'maxLength' => '4', 'enumeration' => 'FTR,ITN,AES4', - ), - 'FTSR' => array( + ], + 'FTSR' => [ 'type' => 'FTSR', 'required' => false, 'subobject' => false, 'comment' => 'FTSR', 'minLength' => '5', 'maxLength' => '10', - 'enumeration' => '30.2(d)(2),30.36,30.37(a),30.37(b),30.37(e),30.37(f),30.37(g),30.37(h),30.37(j),30.37(k),30.39,30.40(a),30.40(b),30.40(c),30.40(d)', - ), - 'ITN' => array( + 'enumeration' => '30.2(d)(2),30.36,30.37(a),30.37(b),30.37(e),30.37(f),30.37(g),30.37(h),30.37(j),30.37(k),' + . '30.39,30.40(a),30.40(b),30.40(c),30.40(d)', + ], + 'ITN' => [ 'type' => 'ITN', 'required' => false, 'subobject' => false, 'comment' => 'ITN', 'length' => '15', 'pattern' => 'X[0-9]{14}', - ), - 'AES4EIN' => array( + ], + 'AES4EIN' => [ 'type' => 'AES4EIN', 'required' => false, 'subobject' => false, 'comment' => 'AES4', 'minLength' => '1', 'maxLength' => '11', - ), - ); + ], + ]; } diff --git a/src/Datatype/EU/GrossWeight.php b/src/Datatype/EU/GrossWeight.php new file mode 100644 index 0000000..6a20257 --- /dev/null +++ b/src/Datatype/EU/GrossWeight.php @@ -0,0 +1,32 @@ + [ + 'type' => 'Weight', + 'required' => false, + 'subobject' => false, + 'comment' => 'Weight of piece or shipment', + 'fractionDigits' => '3', + 'minInclusive' => '0.000', + 'maxInclusive' => '999999.999', + 'totalDigits' => '10', + ], + 'WeightUnit' => [ + 'type' => 'WeightUnit', + 'required' => false, + 'subobject' => false, + 'comment' => 'Unit of weight measurement (K:KiloGram)', + 'minLength' => '0', + 'maxLength' => '1', + 'enumeration' => 'K,L', + ], + ]; +} diff --git a/DHL/Datatype/GB/Notification.php b/src/Datatype/EU/Notification.php similarity index 86% rename from DHL/Datatype/GB/Notification.php rename to src/Datatype/EU/Notification.php index c9f4e39..a92615c 100644 --- a/DHL/Datatype/GB/Notification.php +++ b/src/Datatype/EU/Notification.php @@ -1,4 +1,5 @@ array( + protected $params = [ + 'EmailAddress' => [ 'type' => 'Message', 'required' => false, 'subobject' => false, 'comment' => 'Message', 'maxLength' => '250', - ), - 'Message' => array( + ], + 'Message' => [ 'type' => 'Message', 'required' => false, 'subobject' => false, 'comment' => 'Message', 'maxLength' => '250', - ), - ); + ], + ]; } diff --git a/src/Datatype/EU/OriginServiceArea.php b/src/Datatype/EU/OriginServiceArea.php new file mode 100644 index 0000000..3c07aaf --- /dev/null +++ b/src/Datatype/EU/OriginServiceArea.php @@ -0,0 +1,43 @@ + [ + 'type' => 'ServiceAreaCode', + 'required' => false, + 'subobject' => false, + 'comment' => 'DHL service area code', + 'length' => '3', + ], + 'Description' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'OutboundSortCode' => [ + 'type' => 'OutboundSortCode', + 'required' => false, + 'subobject' => false, + 'comment' => 'OutBound Sort Code', + 'maxLength' => '4', + ], + ]; +} diff --git a/src/Datatype/EU/OtherCharge.php b/src/Datatype/EU/OtherCharge.php new file mode 100644 index 0000000..9769def --- /dev/null +++ b/src/Datatype/EU/OtherCharge.php @@ -0,0 +1,37 @@ + [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'OtherChargeValue' => [ + 'type' => 'decimal', + 'required' => true, + 'subobject' => false, + ], + 'OtherChargeType' => [ + 'type' => 'string', + 'required' => true, + 'subobject' => false, + 'length' => '5', + 'enumeration' => 'ADMIN,DELIV,DOCUM,EXPED,EXCHA,FRCST,SSRGE,LOGST,SOTHR,SPKGN,PICUP,HRCRG,VATCR,INSCH,REVCH', + ] + ]; +} diff --git a/src/Datatype/EU/PUShipmentDetails.php b/src/Datatype/EU/PUShipmentDetails.php new file mode 100644 index 0000000..fdbdcea --- /dev/null +++ b/src/Datatype/EU/PUShipmentDetails.php @@ -0,0 +1,143 @@ + [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'AccountType', + 'minLength' => '1', + 'maxLength' => '6', + ], + 'AccountNumber' => [ + 'type' => 'AccountNumber', + 'required' => false, + 'subobject' => false, + 'comment' => 'DHL Account Number', + 'maxInclusive' => '9999999999', + 'minInclusive' => '100000000', + ], + 'BillToAccountNumber' => [ + 'type' => 'AccountNumber', + 'required' => false, + 'subobject' => false, + 'comment' => 'DHL Account Number', + 'maxInclusive' => '9999999999', + 'minInclusive' => '100000000', + ], + 'AWBNumber' => [ + 'type' => 'AWBNumber', + 'required' => false, + 'subobject' => false, + 'comment' => 'Airway bill number', + 'maxLength' => '11', + ], + 'NumberOfPieces' => [ + 'type' => 'integer', + 'required' => false, + 'subobject' => false, + ], + + 'Weight' => [ + 'type' => 'Weight', + 'required' => false, + 'subobject' => false, + 'comment' => 'Weight of piece or shipment', + 'fractionDigits' => '3', + 'minInclusive' => '0.000', + 'maxInclusive' => '999999.999', + 'totalDigits' => '10', + ], + 'WeightUnit' => [ + 'type' => 'WeightUnit', + 'required' => false, + 'subobject' => false, + 'comment' => 'Unit of weight measurement (K:KiloGram)', + 'minLength' => '0', + 'maxLength' => '1', + 'enumeration' => 'K,L', + ], + 'GlobalProductCode' => [ + 'type' => 'GlobalProductCode', + 'required' => false, + 'subobject' => false, + 'comment' => '', + 'pattern' => '([A-Z0-9])*', + 'minLength' => '1', + 'maxLength' => '4', + ], + 'DoorTo' => [ + 'type' => 'DoorTo', + 'required' => false, + 'subobject' => false, + 'comment' => 'Defines the type of delivery service that applies + to the shipment', + 'length' => '2', + 'enumeration' => 'DD,DA,AA,DC', + ], + 'DimensionUnit' => [ + 'type' => 'DimensionUnit', + 'required' => false, + 'subobject' => false, + 'comment' => 'Dimension Unit C (centimeter)', + 'length' => '1', + 'enumeration' => 'C,I', + ], + 'InsuredAmount' => [ + 'type' => 'Money', + 'required' => false, + 'subobject' => false, + 'comment' => 'Monetary amount (with 2 decimal precision)', + 'minInclusive' => '0.00', + 'maxInclusive' => '9999999999.99', + ], + + 'InsuredCurrencyCode' => [ + 'type' => 'CurrencyCode', + 'required' => false, + 'subobject' => false, + 'comment' => 'ISO currency code', + 'length' => '3', + ], + 'Pieces' => [ + 'type' => 'Piece', + 'required' => false, + 'subobject' => true, + 'multivalues' => true, + ], + 'SpecialService' => [ + 'disableParentNode' => true, + 'multivalues' => true, + 'type' => 'SpecialService', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/src/Datatype/EU/Pickup.php b/src/Datatype/EU/Pickup.php new file mode 100644 index 0000000..e5de145 --- /dev/null +++ b/src/Datatype/EU/Pickup.php @@ -0,0 +1,41 @@ + [ + 'type' => 'string', + 'required' => true, + 'subobject' => false, + 'comment' => 'Date Y-m-d', + 'maxLength' => '10', + ], + 'ReadyByTime' => [ + 'type' => 'string', + 'required' => true, + 'subobject' => false, + 'comment' => 'Time HH:MM', + 'maxLength' => '5', + ], + 'CloseTime' => [ + 'type' => 'string', + 'required' => true, + 'maxLength' => '5', + 'comment' => 'Time HH:MM', + 'subobject' => false, + ], + ]; +} diff --git a/src/Datatype/EU/PickupContact.php b/src/Datatype/EU/PickupContact.php new file mode 100644 index 0000000..ebfb631 --- /dev/null +++ b/src/Datatype/EU/PickupContact.php @@ -0,0 +1,41 @@ + [ + 'type' => 'PersonName', + 'required' => true, + 'subobject' => false, + 'comment' => 'Name', + 'maxLength' => '35', + ], + 'Phone' => [ + 'type' => 'PhoneNumber', + 'required' => true, + 'subobject' => false, + 'comment' => 'Phone Number', + 'maxLength' => '25', + ], + 'PhoneExtension' => [ + 'type' => 'PhoneExtension', + 'required' => false, + 'subobject' => false, + 'comment' => '', + 'maxLength' => '5', + ], + ]; +} diff --git a/DHL/Datatype/GB/Piece.php b/src/Datatype/EU/Piece.php similarity index 57% rename from DHL/Datatype/GB/Piece.php rename to src/Datatype/EU/Piece.php index a2821bd..c4541e3 100644 --- a/DHL/Datatype/GB/Piece.php +++ b/src/Datatype/EU/Piece.php @@ -1,54 +1,28 @@ array( + protected $params = [ + 'PieceID' => [ 'type' => 'PieceID', 'required' => false, 'subobject' => false, 'comment' => 'Piece ID', 'maxLength' => '35', - ), - 'PackageType' => array( + ], + 'PackageType' => [ 'type' => 'PackageType', 'required' => false, 'subobject' => false, @@ -57,8 +31,8 @@ class Piece extends Base Box, DF-DHL Flyer, YP-Your packaging)', 'length' => '2', 'enumeration' => 'BD,BP,CP,DC,DF,DM,ED,EE,FR,JB,JD,JJ,JP,OD,PA,YP', - ), - 'Weight' => array( + ], + 'Weight' => [ 'type' => 'Weight', 'required' => false, 'subobject' => false, @@ -67,8 +41,8 @@ class Piece extends Base 'minInclusive' => '0.000', 'maxInclusive' => '999999.999', 'totalDigits' => '10', - ), - 'DimWeight' => array( + ], + 'DimWeight' => [ 'type' => 'Weight', 'required' => false, 'subobject' => false, @@ -77,28 +51,28 @@ class Piece extends Base 'minInclusive' => '0.000', 'maxInclusive' => '999999.999', 'totalDigits' => '10', - ), - 'Width' => array( + ], + 'Width' => [ 'type' => 'positiveInteger', 'required' => false, 'subobject' => false, - ), - 'Height' => array( + ], + 'Height' => [ 'type' => 'positiveInteger', 'required' => false, 'subobject' => false, - ), - 'Depth' => array( + ], + 'Depth' => [ 'type' => 'positiveInteger', 'required' => false, 'subobject' => false, - ), - 'PieceContents' => array( + ], + 'PieceContents' => [ 'type' => 'PieceContents', 'required' => false, 'subobject' => false, 'comment' => 'Piece contents description', 'maxLength' => '35', - ), - ); + ], + ]; } diff --git a/src/Datatype/EU/PieceDetails.php b/src/Datatype/EU/PieceDetails.php new file mode 100644 index 0000000..cb90450 --- /dev/null +++ b/src/Datatype/EU/PieceDetails.php @@ -0,0 +1,66 @@ + [ + 'type' => 'TrackingPieceID', + 'required' => false, + 'subobject' => false, + 'comment' => 'Piece ID', + 'minLength' => '20', + 'maxLength' => '35', + ], + 'PackageType' => [ + 'type' => 'PackageType', + 'required' => false, + 'subobject' => false, + 'comment' => 'Package Type (EE: DHL Express Envelope, OD:Other + DHL Packaging, CP:Customer-provided, JB-Jumbo box, + JJ-Junior jumbo Box, DF-DHL Flyer, YP-Your packaging)', + 'length' => '2', + 'enumeration' => 'BD,BP,CP,DC,DF,DM,ED,EE,FR,JB,JD,JJ,JP,OD,PA,YP', + ], + 'Weight' => [ + 'type' => 'Weight', + 'required' => false, + 'subobject' => false, + 'comment' => 'Weight of piece or shipment', + 'fractionDigits' => '3', + 'minInclusive' => '0.000', + 'maxInclusive' => '999999.999', + 'totalDigits' => '10', + ], + 'DimWeight' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'Width' => [ + 'type' => 'positiveInteger', + 'required' => false, + 'subobject' => false, + ], + 'Height' => [ + 'type' => 'positiveInteger', + 'required' => false, + 'subobject' => false, + ], + 'Depth' => [ + 'type' => 'positiveInteger', + 'required' => false, + 'subobject' => false, + ], + ]; +} diff --git a/src/Datatype/EU/PieceFault.php b/src/Datatype/EU/PieceFault.php new file mode 100644 index 0000000..eacf09b --- /dev/null +++ b/src/Datatype/EU/PieceFault.php @@ -0,0 +1,37 @@ + [ + 'type' => 'TrackingPieceID', + 'required' => true, + 'subobject' => false, + 'comment' => 'Piece ID', + 'minLength' => '20', + 'maxLength' => '35', + ], + 'ConditionCode' => [ + 'type' => 'string', + 'required' => true, + 'subobject' => false, + ], + 'ConditionData' => [ + 'type' => 'string', + 'required' => true, + 'subobject' => false, + ], + ]; +} diff --git a/src/Datatype/EU/Pieces.php b/src/Datatype/EU/Pieces.php new file mode 100644 index 0000000..84a88a6 --- /dev/null +++ b/src/Datatype/EU/Pieces.php @@ -0,0 +1,24 @@ + [ + 'type' => 'Piece', + 'required' => false, + 'subobject' => true, + 'multivalues' => true, + ], + ]; +} diff --git a/src/Datatype/EU/Place.php b/src/Datatype/EU/Place.php new file mode 100644 index 0000000..9dc90ad --- /dev/null +++ b/src/Datatype/EU/Place.php @@ -0,0 +1,127 @@ + [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'B - business R - residence C - Business-residence', + 'maxLength' => '35', + ], + 'ResidenceOrBusiness' => [ + 'type' => 'ResidenceOrBusiness', + 'required' => false, + 'subobject' => false, + 'comment' => 'Identifies if a location is a business, residence, + or both (B:Business, R:Residence, C:Business Residence)', + 'length' => '1', + 'enumeration' => 'B,R,C', + ], + 'CompanyName' => [ + 'type' => 'CompanyNameValidator', + 'required' => false, + 'subobject' => false, + 'comment' => 'Name of company / business', + 'minLength' => '0', + 'maxLength' => '35', + ], + 'Address1' => [ + 'type' => 'string', + 'required' => true, + 'subobject' => false, + 'comment' => 'Address Line', + 'multivalues' => false, + ], + 'Address2' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'Address Line', + 'multivalues' => false, + ], + 'PackageLocation' => [ + 'type' => 'PackageLocation', + 'required' => false, + 'subobject' => false, + 'comment' => 'PackageLocation', + 'maxLength' => '40', + ], + 'City' => [ + 'type' => 'City', + 'required' => false, + 'subobject' => false, + 'comment' => 'City name', + 'maxLength' => '35', + ], + 'StateCode' => [ + 'type' => 'StateCode', + 'required' => false, + 'subobject' => false, + 'comment' => 'State Code', + 'maxLength' => '35', + ], + 'DivisionName' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'DivisionName', + 'maxLength' => '35', + ], + 'CountryCode' => [ + 'type' => 'CountryCode', + 'required' => false, + 'subobject' => false, + 'comment' => 'ISO country codes', + 'length' => '2', + ], + 'PostalCode' => [ + 'type' => 'PostalCode', + 'required' => false, + 'subobject' => false, + 'comment' => 'Full postal/zip code for address', + 'maxLength' => '12', + ], + + 'RouteCode' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'RouteCode', + 'maxLength' => '35', + ], + 'Suburb' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'Suburb', + 'maxLength' => '35', + ], + 'DivisionCode' => [ + 'type' => 'StateCode', + 'required' => false, + 'subobject' => false, + 'comment' => 'Division (state) code.', + 'maxLength' => '35', + ], + 'Division' => [ + 'type' => 'State', + 'required' => false, + 'subobject' => false, + 'comment' => 'State', + 'maxLength' => '35', + ], + ]; +} diff --git a/src/Datatype/EU/QtdSInAdCur.php b/src/Datatype/EU/QtdSInAdCur.php new file mode 100644 index 0000000..b4833b8 --- /dev/null +++ b/src/Datatype/EU/QtdSInAdCur.php @@ -0,0 +1,50 @@ + [ + 'type' => 'CurrencyCode', + 'required' => true, + 'subobject' => false, + 'comment' => 'ISO currency code', + 'length' => '3', + ], + 'CurrencyRoleTypeCode' => [ + 'type' => 'CurrencyRoleTypeCode', + 'required' => true, + 'subobject' => false, + 'comment' => 'CurrencyRoleTypeCode', + 'maxLength' => '6', + 'enumeration' => 'BILLC,BILLCU,PULCL,INVCU,BASEC', + ], + 'PackageCharge' => [ + 'type' => 'PackageCharge', + 'required' => true, + 'subobject' => false, + 'comment' => 'PackageCharge', + 'fractionDigits' => '3', + 'totalDigits' => '18', + ], + 'ShippingCharge' => [ + 'type' => 'ShippingCharge', + 'required' => true, + 'subobject' => false, + 'comment' => 'ShippingCharge', + 'fractionDigits' => '3', + 'totalDigits' => '18', + ], + ]; +} diff --git a/src/Datatype/EU/RegistrationNumber.php b/src/Datatype/EU/RegistrationNumber.php new file mode 100644 index 0000000..712fecc --- /dev/null +++ b/src/Datatype/EU/RegistrationNumber.php @@ -0,0 +1,33 @@ + [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'Number value', + ], + 'NumberTypeCode' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'Number type (e.g. VAT, EOR)', + ], + 'NumberIssuerCountryCode' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'ISO Country Code that issued the Number', + ], + ]; +} diff --git a/src/Datatype/EU/RegistrationNumbers.php b/src/Datatype/EU/RegistrationNumbers.php new file mode 100644 index 0000000..c4c38f1 --- /dev/null +++ b/src/Datatype/EU/RegistrationNumbers.php @@ -0,0 +1,22 @@ + [ + 'type' => 'RegistrationNumber', + 'required' => false, + 'subobject' => false, + 'comment' => '', + 'multivalues' => true, + ], + ]; +} diff --git a/src/Datatype/EU/Requestor.php b/src/Datatype/EU/Requestor.php new file mode 100644 index 0000000..d4fd9df --- /dev/null +++ b/src/Datatype/EU/Requestor.php @@ -0,0 +1,50 @@ + [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'Account type', + ], + 'AccountNumber' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'Account number', + ], + 'RequestorContact' => [ + 'type' => 'RequestorContact', + 'required' => false, + 'subobject' => true, + 'comment' => 'RequestorContact', + ], + 'CompanyName' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'Company Name', + ], + ]; +} diff --git a/DHL/Datatype/GB/Contact.php b/src/Datatype/EU/RequestorContact.php similarity index 51% rename from DHL/Datatype/GB/Contact.php rename to src/Datatype/EU/RequestorContact.php index d657f3a..8a20444 100644 --- a/DHL/Datatype/GB/Contact.php +++ b/src/Datatype/EU/RequestorContact.php @@ -1,87 +1,68 @@ array( + protected $params = [ + 'PersonName' => [ 'type' => 'PersonName', 'required' => false, 'subobject' => false, 'comment' => 'Name', 'maxLength' => '35', - ), - 'PhoneNumber' => array( + ], + 'Phone' => [ 'type' => 'PhoneNumber', 'required' => false, 'subobject' => false, 'comment' => 'Phone Number', 'maxLength' => '25', - ), - 'PhoneExtension' => array( + ], + 'PhoneExtension' => [ 'type' => 'PhoneExtension', 'required' => false, 'subobject' => false, 'comment' => '', 'maxLength' => '5', - ), - 'FaxNumber' => array( + ], + 'FaxNumber' => [ 'type' => 'PhoneNumber', 'required' => false, 'subobject' => false, 'comment' => 'Phone Number', 'maxLength' => '25', - ), - 'Telex' => array( + ], + 'Telex' => [ 'type' => 'Telex', 'required' => false, 'subobject' => false, 'comment' => 'Telex number and answer back code', 'maxLength' => '25', - ), - 'Email' => array( + ], + 'Email' => [ 'type' => 'EmailAddress', 'required' => false, 'subobject' => false, 'comment' => 'Email address containing \'@\'', 'maxLength' => '50', - ), - ); + ], + ]; } diff --git a/src/Datatype/EU/Response.php b/src/Datatype/EU/Response.php new file mode 100644 index 0000000..f43c972 --- /dev/null +++ b/src/Datatype/EU/Response.php @@ -0,0 +1,23 @@ + [ + 'type' => 'ResponseServiceHeader', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/src/Datatype/EU/ResponseServiceHeader.php b/src/Datatype/EU/ResponseServiceHeader.php new file mode 100644 index 0000000..8f94539 --- /dev/null +++ b/src/Datatype/EU/ResponseServiceHeader.php @@ -0,0 +1,47 @@ + [ + 'type' => 'dateTime', + 'required' => false, + 'subobject' => false, + ], + 'MessageReference' => [ + 'type' => 'MessageReference', + 'required' => false, + 'subobject' => false, + 'comment' => 'Reference to the requested Message', + 'minLength' => '28', + 'maxLength' => '32', + ], + 'SiteID' => [ + 'type' => 'SiteID', + 'required' => false, + 'subobject' => false, + 'comment' => 'Site ID used for verifying the sender', + 'minLength' => '6', + 'maxLength' => '20', + ], + ]; +} diff --git a/DHL/Datatype/GB/ShipValResponsePiece.php b/src/Datatype/EU/ShipValResponsePiece.php similarity index 58% rename from DHL/Datatype/GB/ShipValResponsePiece.php rename to src/Datatype/EU/ShipValResponsePiece.php index 11520b8..032480a 100644 --- a/DHL/Datatype/GB/ShipValResponsePiece.php +++ b/src/Datatype/EU/ShipValResponsePiece.php @@ -1,74 +1,47 @@ array( + protected $params = [ + 'PieceNumber' => [ 'type' => 'PieceNumber', 'required' => true, 'subobject' => false, 'comment' => 'Piece Number', - ), - 'Depth' => array( + ], + 'Depth' => [ 'type' => 'positiveInteger', 'required' => false, 'subobject' => false, - ), - 'Width' => array( + ], + 'Width' => [ 'type' => 'positiveInteger', 'required' => false, 'subobject' => false, - ), - 'Height' => array( + ], + 'Height' => [ 'type' => 'positiveInteger', 'required' => false, 'subobject' => false, - ), - 'Weight' => array( + ], + 'Weight' => [ 'type' => 'Weight', 'required' => false, 'subobject' => false, @@ -77,8 +50,8 @@ class ShipValResponsePiece extends Base 'minInclusive' => '0.000', 'maxInclusive' => '999999.999', 'totalDigits' => '10', - ), - 'PackageType' => array( + ], + 'PackageType' => [ 'type' => 'PackageType', 'required' => false, 'subobject' => false, @@ -87,8 +60,8 @@ class ShipValResponsePiece extends Base Box, DF-DHL Flyer, YP-Your packaging)', 'length' => '2', 'enumeration' => 'BD,BP,CP,DC,DF,DM,ED,EE,FR,JB,JD,JJ,JP,OD,PA,YP', - ), - 'DimWeight' => array( + ], + 'DimWeight' => [ 'type' => 'Weight', 'required' => false, 'subobject' => false, @@ -97,31 +70,31 @@ class ShipValResponsePiece extends Base 'minInclusive' => '0.000', 'maxInclusive' => '999999.999', 'totalDigits' => '10', - ), - 'PieceContents' => array( + ], + 'PieceContents' => [ 'type' => 'PieceContents', 'required' => false, 'subobject' => false, 'comment' => 'Piece contents description', 'maxLength' => '35', - ), - 'DataIdentifier' => array( + ], + 'DataIdentifier' => [ 'type' => 'string', 'required' => true, 'subobject' => false, - ), - 'LicensePlate' => array( + ], + 'LicensePlate' => [ 'type' => 'PieceID', 'required' => true, 'subobject' => false, 'comment' => 'Piece ID', 'maxLength' => '35', - ), - 'LicensePlateBarCode' => array( + ], + 'LicensePlateBarCode' => [ 'type' => 'BarCode', 'required' => true, 'subobject' => false, 'comment' => '', - ), - ); + ], + ]; } diff --git a/DHL/Datatype/GB/Shipment.php b/src/Datatype/EU/Shipment.php similarity index 65% rename from DHL/Datatype/GB/Shipment.php rename to src/Datatype/EU/Shipment.php index 7200d04..7d8dbf2 100644 --- a/DHL/Datatype/GB/Shipment.php +++ b/src/Datatype/EU/Shipment.php @@ -1,47 +1,20 @@ array( + protected $params = [ + 'Weight' => [ 'type' => 'Weight', 'required' => false, 'subobject' => false, @@ -50,8 +23,8 @@ class Shipment extends Base 'minInclusive' => '0.000', 'maxInclusive' => '999999.999', 'totalDigits' => '10', - ), - 'WeightUnit' => array( + ], + 'WeightUnit' => [ 'type' => 'WeightUnit', 'required' => false, 'subobject' => false, @@ -59,13 +32,13 @@ class Shipment extends Base 'minLength' => '0', 'maxLength' => '1', 'enumeration' => 'K,L', - ), - 'Pieces' => array( + ], + 'Pieces' => [ 'type' => 'Pieces', 'required' => false, 'subobject' => true, - ), - 'DoorTo' => array( + ], + 'DoorTo' => [ 'type' => 'DoorTo', 'required' => false, 'subobject' => false, @@ -73,73 +46,78 @@ class Shipment extends Base to the shipment', 'length' => '2', 'enumeration' => 'DD,DA,AA,DC', - ), - 'AirwarBillNumber' => array( + ], + 'AirwarBillNumber' => [ 'type' => 'AWBNumber', 'required' => false, 'subobject' => false, 'comment' => 'Airway bill number', 'maxLength' => '10', - ), - 'AccountType' => array( + ], + 'AccountType' => [ 'type' => 'AccountType', 'required' => false, 'subobject' => false, 'comment' => 'Account Type by method of payment ( DHL account vs. Credit card)', 'enumeration' => 'D', - ), - 'ProductType' => array( + ], + 'ProductType' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'GlobalProductType' => array( + ], + 'GlobalProductType' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'LocalProductType' => array( + ], + 'LocalProductType' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Commodity' => array( + ], + 'DHLInvoiceType' => [ + 'type' => 'DHLInvoiceType', + 'required' => false, + 'subobject' => false, + ], + 'Commodity' => [ 'type' => 'Commodity', 'required' => false, 'subobject' => true, - ), - 'DeclaredValue' => array( + ], + 'DeclaredValue' => [ 'type' => 'Money', 'required' => false, 'subobject' => false, 'comment' => 'Monetary amount (with 2 decimal precision)', 'minInclusive' => '0.00', 'maxInclusive' => '9999999999.99', - ), - 'DeclaredCurrency' => array( + ], + 'DeclaredCurrency' => [ 'type' => 'CurrencyCode', 'required' => false, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ), - 'InsuredValue' => array( + ], + 'InsuredValue' => [ 'type' => 'Money', 'required' => false, 'subobject' => false, 'comment' => 'Monetary amount (with 2 decimal precision)', 'minInclusive' => '0.00', 'maxInclusive' => '9999999999.99', - ), - 'InsuredCurrency' => array( + ], + 'InsuredCurrency' => [ 'type' => 'CurrencyCode', 'required' => false, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ), - 'DimensionalUnit' => array( + ], + 'DimensionalUnit' => [ 'type' => 'WeightUnit', 'required' => false, 'subobject' => false, @@ -147,8 +125,8 @@ class Shipment extends Base 'minLength' => '0', 'maxLength' => '1', 'enumeration' => 'K,L', - ), - 'DimensionalWeight' => array( + ], + 'DimensionalWeight' => [ 'type' => 'Weight', 'required' => false, 'subobject' => false, @@ -157,6 +135,6 @@ class Shipment extends Base 'minInclusive' => '0.000', 'maxInclusive' => '999999.999', 'totalDigits' => '10', - ), - ); + ], + ]; } diff --git a/src/Datatype/EU/ShipmentDate.php b/src/Datatype/EU/ShipmentDate.php new file mode 100644 index 0000000..7bf6d33 --- /dev/null +++ b/src/Datatype/EU/ShipmentDate.php @@ -0,0 +1,32 @@ + [ + 'type' => 'Date', + 'required' => false, + 'subobject' => false, + 'comment' => 'Date only', + 'pattern' => '[0-9][0-9][0-9][0-9](-)[0-9][0-9](-)[0-9][0-9]', + ], + 'ShipmentDateTo' => [ + 'type' => 'Date', + 'required' => false, + 'subobject' => false, + 'comment' => 'Date only', + 'pattern' => '[0-9][0-9][0-9][0-9](-)[0-9][0-9](-)[0-9][0-9]', + ], + ]; +} diff --git a/DHL/Datatype/GB/ShipmentDetails.php b/src/Datatype/EU/ShipmentDetails.php similarity index 68% rename from DHL/Datatype/GB/ShipmentDetails.php rename to src/Datatype/EU/ShipmentDetails.php index 352b7ef..e0233af 100644 --- a/DHL/Datatype/GB/ShipmentDetails.php +++ b/src/Datatype/EU/ShipmentDetails.php @@ -1,32 +1,13 @@ array( + protected $params = [ + 'NumberOfPieces' => [ 'type' => 'integer', 'required' => false, 'subobject' => false, - ), - 'Pieces' => array( + ], + 'Pieces' => [ 'type' => 'Piece', 'required' => false, 'subobject' => true, 'multivalues' => true, - ), - 'Weight' => array( + ], + 'Weight' => [ 'type' => 'Weight', 'required' => false, 'subobject' => false, @@ -61,8 +42,8 @@ class ShipmentDetails extends Base 'minInclusive' => '0.000', 'maxInclusive' => '999999.999', 'totalDigits' => '10', - ), - 'WeightUnit' => array( + ], + 'WeightUnit' => [ 'type' => 'WeightUnit', 'required' => false, 'subobject' => false, @@ -70,8 +51,8 @@ class ShipmentDetails extends Base 'minLength' => '0', 'maxLength' => '1', 'enumeration' => 'K,L', - ), - 'GlobalProductCode' => array( + ], + 'GlobalProductCode' => [ 'type' => 'GlobalProductCode', 'required' => false, 'subobject' => false, @@ -79,8 +60,8 @@ class ShipmentDetails extends Base 'pattern' => '([A-Z0-9])*', 'minLength' => '1', 'maxLength' => '4', - ), - 'LocalProductCode' => array( + ], + 'LocalProductCode' => [ 'type' => 'LocalProductCode', 'required' => false, 'subobject' => false, @@ -88,22 +69,22 @@ class ShipmentDetails extends Base 'minLength' => '1', 'maxLength' => '4', 'pattern' => '([A-Z0-9])*', - ), - 'Date' => array( + ], + 'Date' => [ 'type' => 'Date', 'required' => false, 'subobject' => false, 'comment' => 'Date only', 'pattern' => '[0-9][0-9][0-9][0-9](-)[0-9][0-9](-)[0-9][0-9]', - ), - 'Contents' => array( + ], + 'Contents' => [ 'type' => 'ShipmentContents', 'required' => false, 'subobject' => false, 'comment' => 'Shipment contents description', 'maxLength' => '90', - ), - 'DoorTo' => array( + ], + 'DoorTo' => [ 'type' => 'DoorTo', 'required' => false, 'subobject' => false, @@ -111,68 +92,68 @@ class ShipmentDetails extends Base to the shipment', 'length' => '2', 'enumeration' => 'DD,DA,AA,DC', - ), - 'DimensionUnit' => array( + ], + 'DimensionUnit' => [ 'type' => 'DimensionUnit', 'required' => false, 'subobject' => false, 'comment' => 'Dimension Unit C (centimeter)', 'length' => '1', 'enumeration' => 'C,I', - ), - 'InsuredAmount' => array( + ], + 'InsuredAmount' => [ 'type' => 'Money', 'required' => false, 'subobject' => false, 'comment' => 'Monetary amount (with 2 decimal precision)', 'minInclusive' => '0.00', 'maxInclusive' => '9999999999.99', - ), - 'PackageType' => array( + ], + 'PackageType' => [ 'type' => 'PackageType', 'required' => false, 'subobject' => false, 'comment' => 'Package Type (EE: DHL Express Envelope, OD:Other - DHL Packaging, CP:Customer-provided, JB-Jumbo box, JJ-Junior jumbo - Box, DF-DHL Flyer, YP-Your packaging)', + DHL Packaging, CP:Customer-provided, JB-Jumbo box, + JJ-Junior jumbo Box, DF-DHL Flyer, YP-Your packaging)', 'length' => '2', 'enumeration' => 'BD,BP,CP,DC,DF,DM,ED,EE,FR,JB,JD,JJ,JP,OD,PA,YP', - ), - 'IsDutiable' => array( + ], + 'IsDutiable' => [ 'type' => 'YesNo', 'required' => false, 'subobject' => false, 'comment' => 'Boolean flag', 'length' => '1', 'enumeration' => 'Y,N', - ), - 'CurrencyCode' => array( + ], + 'CurrencyCode' => [ 'type' => 'CurrencyCode', 'required' => false, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ), - 'AdditionalProtection' => array( + ], + 'AdditionalProtection' => [ 'type' => 'AdditionalProtection', 'required' => false, 'subobject' => true, - ), - 'DOSFlag' => array( + ], + 'DOSFlag' => [ 'type' => 'YesNo', 'required' => false, 'subobject' => false, 'comment' => 'Boolean flag', 'length' => '1', 'enumeration' => 'Y,N', - ), - 'CustData' => array( + ], + 'CustData' => [ 'type' => 'CustData', 'required' => false, 'subobject' => false, 'comment' => 'CustData', 'minLength' => '1', 'maxLength' => '100', - ), - ); + ], + ]; } diff --git a/src/Datatype/EU/ShipmentEvent.php b/src/Datatype/EU/ShipmentEvent.php new file mode 100644 index 0000000..4f0edc7 --- /dev/null +++ b/src/Datatype/EU/ShipmentEvent.php @@ -0,0 +1,44 @@ + [ + 'type' => 'date', + 'required' => false, + 'subobject' => false, + ], + 'Time' => [ + 'type' => 'time', + 'required' => false, + 'subobject' => false, + ], + 'ServiceEvent' => [ + 'type' => 'ServiceEvent', + 'required' => false, + 'subobject' => true, + ], + 'Signatory' => [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + 'ServiceArea' => [ + 'type' => 'ServiceArea', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/src/Datatype/EU/ShipmentInfo.php b/src/Datatype/EU/ShipmentInfo.php new file mode 100644 index 0000000..65196f9 --- /dev/null +++ b/src/Datatype/EU/ShipmentInfo.php @@ -0,0 +1,76 @@ + [ + 'type' => 'ServiceArea', + 'required' => false, + 'subobject' => true, + ], + 'DestinationServiceArea' => [ + 'type' => 'ServiceArea', + 'required' => false, + 'subobject' => true, + ], + 'ShipperName' => [ + 'type' => 'PersonName', + 'required' => false, + 'subobject' => false, + 'comment' => 'Name', + 'maxLength' => '35', + ], + 'ShipperAccountNumber' => [ + 'type' => 'AccountNumber', + 'required' => false, + 'subobject' => false, + 'comment' => 'DHL Account Number', + 'maxLength' => '12', + ], + 'ConsigneeName' => [ + 'type' => 'PersonName', + 'required' => false, + 'subobject' => false, + 'comment' => 'Name', + 'maxLength' => '35', + ], + 'ShipmentDate' => [ + 'type' => 'dateTime', + 'required' => false, + 'subobject' => false, + ], + 'Pieces' => [ + 'type' => 'Piece', + 'required' => false, + 'subobject' => true, + 'multivalues' => true, + ], + 'Weight' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'WeightUnit' => [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + 'EstDlvyDate' => [ + 'type' => 'dateTime', + 'required' => false, + 'subobject' => false, + ], + ]; +} diff --git a/DHL/Datatype/GB/Shipper.php b/src/Datatype/EU/Shipper.php similarity index 51% rename from DHL/Datatype/GB/Shipper.php rename to src/Datatype/EU/Shipper.php index fff2966..5f281c8 100644 --- a/DHL/Datatype/GB/Shipper.php +++ b/src/Datatype/EU/Shipper.php @@ -1,152 +1,184 @@ array( + protected $params = [ + 'ShipperID' => [ 'type' => 'ShipperID', - 'required' => false, + 'required' => true, 'subobject' => false, 'comment' => 'Shipper\'s ID', 'maxLength' => '30', - ), - 'CompanyName' => array( + ], + 'CompanyName' => [ 'type' => 'CompanyNameValidator', 'required' => false, 'subobject' => false, 'comment' => 'Name of company / business', 'minLength' => '0', 'maxLength' => '35', - ), - 'SuiteDepartmentName' => array( + ], + 'SuiteDepartmentName' => [ 'type' => 'SuiteDepartmentName', 'required' => false, 'subobject' => false, 'comment' => 'SuiteDepartmentName', 'maxLength' => '35', - ), - 'RegisteredAccount' => array( + ], + 'RegisteredAccount' => [ 'type' => 'AccountNumber', 'required' => false, 'subobject' => false, 'comment' => 'DHL Account Number', 'maxLength' => '12', - ), - 'AddressLine' => array( + ], + 'AddressLine1' => [ + 'type' => 'string', + 'required' => true, + 'subobject' => false, + 'comment' => 'Address Line 1', + 'multivalues' => true, + ], + 'AddressLine2' => [ 'type' => 'string', 'required' => true, 'subobject' => false, - 'comment' => 'Address Line', + 'comment' => 'Address Line 2', 'multivalues' => true, - ), - 'City' => array( + ], + 'AddressLine3' => [ + 'type' => 'string', + 'required' => true, + 'subobject' => false, + 'comment' => 'Address Line 3', + 'multivalues' => true, + ], + 'StreetName' => [ + 'type' => 'string', + 'required' => true, + 'subobject' => false, + 'comment' => 'Street Name', + 'multivalues' => true, + ], + 'BuildingName' => [ + 'type' => 'string', + 'required' => true, + 'subobject' => false, + 'comment' => 'Building Name', + 'multivalues' => true, + ], + 'StreetNUmber' => [ + 'type' => 'string', + 'required' => true, + 'subobject' => false, + 'comment' => 'Street Number', + 'multivalues' => true, + ], + 'City' => [ 'type' => 'City', - 'required' => false, + 'required' => true, 'subobject' => false, 'comment' => 'City name', 'maxLength' => '35', - ), - 'Division' => array( + ], + 'Division' => [ 'type' => 'Division', 'required' => false, 'subobject' => false, 'comment' => 'Division (e.g. state, prefecture, etc.) name', 'maxLength' => '35', - ), - 'DivisionCode' => array( + ], + 'DivisionCode' => [ 'type' => 'DivisionCode', 'required' => false, 'subobject' => false, 'comment' => 'Division (e.g. state, prefecture, etc.) code', 'maxLength' => '35', - ), - 'PostalCode' => array( + ], + 'PostalCode' => [ 'type' => 'PostalCode', 'required' => false, 'subobject' => false, 'comment' => 'Full postal/zip code for address', 'maxLength' => '12', - ), - 'OriginServiceAreaCode' => array( + ], + 'OriginServiceAreaCode' => [ 'type' => 'OriginServiceAreaCode', 'required' => false, 'subobject' => false, 'comment' => 'OriginServiceAreaCode', 'maxLength' => '3', - ), - 'OriginFacilityCode' => array( + ], + 'OriginFacilityCode' => [ 'type' => 'OriginFacilityCode', 'required' => false, 'subobject' => false, 'comment' => 'OriginFacilityCode', 'maxLength' => '3', - ), - 'CountryCode' => array( + ], + 'CountryCode' => [ 'type' => 'CountryCode', - 'required' => false, + 'required' => true, 'subobject' => false, 'comment' => 'ISO country codes', 'length' => '2', - ), - 'CountryName' => array( + ], + 'CountryName' => [ 'type' => 'CountryName', - 'required' => false, + 'required' => true, 'subobject' => false, 'comment' => 'ISO country name', 'maxLength' => '35', - ), - 'FederalTaxId' => array( + ], + 'FederalTaxId' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'StateTaxId' => array( + ], + 'StateTaxId' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'Contact' => array( + ], + 'Contact' => [ 'type' => 'Contact', + 'required' => true, + 'subobject' => true, + ], + 'RegistrationNumbers' => [ + 'type' => 'RegistrationNumber', 'required' => false, 'subobject' => true, - ), - ); + 'multivalues' => true, + ], + 'BusinessPartyTypeCode' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'Possible Values: + - BU (business) + - DC (direct consumer) + - GV (government) + - OT (other) + - PR (private) + - RE (reseller)', + ], + ]; } diff --git a/DHL/Datatype/AM/SpecialService.php b/src/Datatype/EU/SpecialService.php similarity index 52% rename from DHL/Datatype/AM/SpecialService.php rename to src/Datatype/EU/SpecialService.php index 6b9964d..08a0d74 100644 --- a/DHL/Datatype/AM/SpecialService.php +++ b/src/Datatype/EU/SpecialService.php @@ -1,97 +1,71 @@ array( - 'type' => 'SpecialServiceType', + protected $params = [ + 'SpecialServiceType' => [ + 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Special Service codes', 'maxLength' => '3', - ), - 'CommunicationAddress' => array( + ], + 'CommunicationAddress' => [ 'type' => 'CommunicationAddress', 'required' => false, 'subobject' => false, - 'comment' => 'Communications line number: phone number, fax number', + 'comment' => 'Communications line number: phone number, fax + number', 'maxLength' => '50', - ), - 'CommunicationType' => array( + ], + 'CommunicationType' => [ 'type' => 'CommunicationType', 'required' => false, 'subobject' => false, 'comment' => 'Communications line type (P: phone, F: fax)', 'length' => '1', 'enumeration' => 'P,F', - ), - 'SpecialServiceDesc' => array( + ], + 'SpecialServiceDesc' => [ 'type' => 'SpecialServiceDesc', 'required' => false, 'subobject' => false, 'comment' => 'Special Service Description', 'maxLength' => '45', - ), - 'ChargeValue' => array( + ], + 'ChargeValue' => [ 'type' => 'Money', 'required' => false, 'subobject' => false, 'comment' => 'Monetary amount (with 2 decimal precision)', 'minInclusive' => '0.00', 'maxInclusive' => '9999999999.99', - ), - 'CurrencyCode' => array( + ], + 'CurrencyCode' => [ 'type' => 'CurrencyCode', 'required' => false, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ), - 'IsWaived' => array( + ], + 'IsWaived' => [ 'type' => 'YesNo', 'required' => false, 'subobject' => false, 'comment' => 'Boolean flag', 'length' => '1', 'enumeration' => 'Y,N', - ), - ); + ], + ]; } diff --git a/src/Datatype/EU/ValueAddedServices.php b/src/Datatype/EU/ValueAddedServices.php new file mode 100644 index 0000000..a685481 --- /dev/null +++ b/src/Datatype/EU/ValueAddedServices.php @@ -0,0 +1,19 @@ + [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'Service Code. Usually WY for paperless invoicing', + ], + ]; +} \ No newline at end of file diff --git a/src/Datatype/EU/Weight.php b/src/Datatype/EU/Weight.php new file mode 100644 index 0000000..f78c15a --- /dev/null +++ b/src/Datatype/EU/Weight.php @@ -0,0 +1,32 @@ + [ + 'type' => 'Weight', + 'required' => false, + 'subobject' => false, + 'comment' => 'Weight of piece or shipment', + 'fractionDigits' => '3', + 'minInclusive' => '0.000', + 'maxInclusive' => '999999.999', + 'totalDigits' => '10', + ], + 'WeightUnit' => [ + 'type' => 'WeightUnit', + 'required' => false, + 'subobject' => false, + 'comment' => 'Unit of weight measurement (K:KiloGram)', + 'minLength' => '0', + 'maxLength' => '1', + 'enumeration' => 'K,L', + ], + ]; +} diff --git a/src/Datatype/EU/WeightSeg.php b/src/Datatype/EU/WeightSeg.php new file mode 100644 index 0000000..b1458a9 --- /dev/null +++ b/src/Datatype/EU/WeightSeg.php @@ -0,0 +1,37 @@ + [ + 'type' => 'Weight', + 'required' => false, + 'subobject' => false, + 'comment' => 'Weight of piece or shipment', + 'fractionDigits' => '3', + 'minInclusive' => '0.000', + 'maxInclusive' => '999999.999', + 'totalDigits' => '10', + ], + 'WeightUnit' => [ + 'type' => 'WeightUnit', + 'required' => false, + 'subobject' => false, + 'comment' => 'Unit of weight measurement (K:KiloGram)', + 'minLength' => '0', + 'maxLength' => '1', + 'enumeration' => 'K,L', + ], + ]; +} diff --git a/src/Entity/AM/BookPickupRequest.php b/src/Entity/AM/BookPickupRequest.php new file mode 100644 index 0000000..c84140f --- /dev/null +++ b/src/Entity/AM/BookPickupRequest.php @@ -0,0 +1,73 @@ + [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'Place' => [ + 'type' => 'Place', + 'required' => false, + 'subobject' => true, + ], + 'Pickup' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'PickupContact' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'ShipmentDetails' => [ + 'type' => 'ShipmentDetails', + 'required' => false, + 'subobject' => true, + ], + 'PickupType' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'LargestPiece' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + ]; +} diff --git a/src/Entity/AM/CancelPickupRequest.php b/src/Entity/AM/CancelPickupRequest.php new file mode 100644 index 0000000..86e868a --- /dev/null +++ b/src/Entity/AM/CancelPickupRequest.php @@ -0,0 +1,65 @@ + [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'minInclusive' => '1', + 'maxInclusive' => '999999999', + ], + 'RequestorName' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'maxLength' => '35', + ], + 'OriginSvcArea' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'maxLength' => '5', + ], + 'Reason' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'maxLength' => '3', + 'minLength' => '3', + 'enumeration' => '001,002,003,004,005,006,007,008', + ], + ]; +} diff --git a/src/Entity/AM/DCTRequest.php b/src/Entity/AM/DCTRequest.php new file mode 100644 index 0000000..2f98ae6 --- /dev/null +++ b/src/Entity/AM/DCTRequest.php @@ -0,0 +1,45 @@ + [ + 'type' => 'GetCapability', + 'required' => false, + 'subobject' => true, + 'multivalues' => false, + 'minOccurs' => 0, + ], + ]; +} diff --git a/src/Entity/AM/ErrorResponse.php b/src/Entity/AM/ErrorResponse.php new file mode 100644 index 0000000..75d9c73 --- /dev/null +++ b/src/Entity/AM/ErrorResponse.php @@ -0,0 +1,43 @@ + [ + 'type' => 'Response', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/src/Entity/AM/GetCapability.php b/src/Entity/AM/GetCapability.php new file mode 100644 index 0000000..9e99b4f --- /dev/null +++ b/src/Entity/AM/GetCapability.php @@ -0,0 +1,66 @@ + [ + 'type' => 'DCTFrom', + 'required' => false, + 'subobject' => true, + 'multivalues' => false, + 'minOccurs' => 1, + ], + 'BkgDetails' => [ + 'type' => 'BkgDetailsType', + 'required' => false, + 'subobject' => true, + 'multivalues' => false, + 'minOccurs' => 1, + ], + 'To' => [ + 'type' => 'DCTTo', + 'required' => false, + 'subobject' => true, + 'multivalues' => false, + 'minOccurs' => 1, + ], + 'Dutiable' => [ + 'type' => 'DCTDutiable', + 'required' => false, + 'subobject' => true, + 'multivalues' => false, + 'minOccurs' => 0, + ], + ]; +} diff --git a/src/Entity/AM/GetQuote.php b/src/Entity/AM/GetQuote.php new file mode 100644 index 0000000..6337b40 --- /dev/null +++ b/src/Entity/AM/GetQuote.php @@ -0,0 +1,66 @@ + [ + 'type' => 'DCTFrom', + 'required' => false, + 'subobject' => true, + 'multivalues' => false, + 'minOccurs' => 1, + ], + 'BkgDetails' => [ + 'type' => 'BkgDetailsType', + 'required' => false, + 'subobject' => true, + 'multivalues' => false, + 'minOccurs' => 1, + ], + 'To' => [ + 'type' => 'DCTTo', + 'required' => false, + 'subobject' => true, + 'multivalues' => false, + 'minOccurs' => 1, + ], + 'Dutiable' => [ + 'type' => 'DCTDutiable', + 'required' => false, + 'subobject' => true, + 'multivalues' => false, + 'minOccurs' => 0, + ], + ]; +} diff --git a/DHL/Entity/AM/KnownTrackingRequest.php b/src/Entity/AM/KnownTrackingRequest.php similarity index 50% rename from DHL/Entity/AM/KnownTrackingRequest.php rename to src/Entity/AM/KnownTrackingRequest.php index a02286e..fb06bd4 100644 --- a/DHL/Entity/AM/KnownTrackingRequest.php +++ b/src/Entity/AM/KnownTrackingRequest.php @@ -1,32 +1,13 @@ array( + protected $body_params = [ + 'LanguageCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO Language Code', - ), - 'AWBNumber' => array( + ], + 'AWBNumber' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Airway bill number', 'maxLength' => '11', - ), - 'LPNumber' => array( + ], + 'LPNumber' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'LevelOfDetails' => array( + ], + 'LevelOfDetails' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Checkpoint details selection flag', 'enumeration' => 'LAST_CHECK_POINT_ONLY,ALL_CHECK_POINTS', - ), - 'PiecesEnabled' => array( + ], + 'PiecesEnabled' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Pieces Enabling Flag', 'enumeration' => 'S,B,P', - ), - 'CountryCode' => array( + ], + 'CountryCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO country codes', 'length' => '2', - ), - ); + ], + ]; } diff --git a/src/Entity/AM/ModifyPickupRequest.php b/src/Entity/AM/ModifyPickupRequest.php new file mode 100644 index 0000000..7f6281b --- /dev/null +++ b/src/Entity/AM/ModifyPickupRequest.php @@ -0,0 +1,71 @@ + [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'minInclusive' => '1', + 'maxInclusive' => '999999999', + ], + 'Requestor' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'Place' => [ + 'type' => 'Place', + 'required' => false, + 'subobject' => true, + ], + 'Pickup' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'PickupContact' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'OriginSvcArea' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'maxLength' => '5', + ], + ]; +} diff --git a/src/Entity/AM/PickupErrorResponse.php b/src/Entity/AM/PickupErrorResponse.php new file mode 100644 index 0000000..2744496 --- /dev/null +++ b/src/Entity/AM/PickupErrorResponse.php @@ -0,0 +1,43 @@ + [ + 'type' => 'Response', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/DHL/Entity/EA/PickupResponse.php b/src/Entity/AM/PickupResponse.php similarity index 53% rename from DHL/Entity/EA/PickupResponse.php rename to src/Entity/AM/PickupResponse.php index 537257a..3925bb3 100644 --- a/DHL/Entity/EA/PickupResponse.php +++ b/src/Entity/AM/PickupResponse.php @@ -1,32 +1,13 @@ array( + protected $body_params = [ + 'Response' => [ 'type' => 'Response', 'required' => false, 'subobject' => true, - ), - 'Note' => array( + ], + 'Note' => [ 'type' => 'Note', 'required' => false, 'subobject' => true, - ), - 'ConfirmationNumber' => array( + ], + 'ConfirmationNumber' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'minInclusive' => '1', 'maxInclusive' => '999999999', - ), - 'ReadyByTime' => array( + ], + 'ReadyByTime' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'SecondReadyByTime' => array( + ], + 'SecondReadyByTime' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'NextPickupDate' => array( + ], + 'NextPickupDate' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'PickupCharge' => array( + ], + 'PickupCharge' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'CurrencyCode' => array( + ], + 'CurrencyCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ), - 'CallInTime' => array( + ], + 'CallInTime' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'SecondCallInTime' => array( + ], + 'SecondCallInTime' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'OriginSvcArea' => array( + ], + 'OriginSvcArea' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'minLength' => '3', 'maxLength' => '3', - ), - 'CountryCode' => array( + ], + 'CountryCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO country codes', 'length' => '2', - ), - ); + ], + ]; } diff --git a/src/Entity/AM/RoutingErrorResponse.php b/src/Entity/AM/RoutingErrorResponse.php new file mode 100644 index 0000000..522cf49 --- /dev/null +++ b/src/Entity/AM/RoutingErrorResponse.php @@ -0,0 +1,43 @@ + [ + 'type' => 'Response', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/DHL/Entity/AM/RoutingRequest.php b/src/Entity/AM/RoutingRequest.php similarity index 55% rename from DHL/Entity/AM/RoutingRequest.php rename to src/Entity/AM/RoutingRequest.php index 50b8699..18dd7c8 100644 --- a/DHL/Entity/AM/RoutingRequest.php +++ b/src/Entity/AM/RoutingRequest.php @@ -1,32 +1,13 @@ array( + protected $body_params = [ + 'RequestType' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'length' => '1', 'enumeration' => 'O,D', - ), - 'Address1' => array( + ], + 'Address1' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Address2' => array( + ], + 'Address2' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Address3' => array( + ], + 'Address3' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'PostalCode' => array( + ], + 'PostalCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Full postal/zip code for address', - ), - 'City' => array( + ], + 'City' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'City name', 'maxLength' => '35', - ), - 'Division' => array( + ], + 'Division' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Division (e.g. state, prefecture, etc.) name', 'maxLength' => '35', - ), - 'CountryCode' => array( + ], + 'CountryCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO country codes', 'length' => '2', - ), - 'CountryName' => array( + ], + 'CountryName' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO country name', 'maxLength' => '35', - ), - 'OriginCountryCode' => array( + ], + 'OriginCountryCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - ); + ], + ]; } diff --git a/src/Entity/AM/RoutingResponse.php b/src/Entity/AM/RoutingResponse.php new file mode 100644 index 0000000..f2feeef --- /dev/null +++ b/src/Entity/AM/RoutingResponse.php @@ -0,0 +1,67 @@ + [ + 'type' => 'Response', + 'required' => false, + 'subobject' => true, + ], + 'GMTNegativeIndicator' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'GMTOffset' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'RegionCode' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'RegionCode', + 'minLength' => '2', + 'maxLength' => '2', + 'enumeration' => 'AP,EA,AM', + ], + 'ServiceArea' => [ + 'type' => 'ServiceArea', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/src/Entity/AM/ShipmentBookRatingRequest.php b/src/Entity/AM/ShipmentBookRatingRequest.php new file mode 100644 index 0000000..7948a74 --- /dev/null +++ b/src/Entity/AM/ShipmentBookRatingRequest.php @@ -0,0 +1,58 @@ + [ + 'type' => 'Shipper', + 'required' => false, + 'subobject' => true, + ], + 'Consignee' => [ + 'type' => 'Consignee', + 'required' => false, + 'subobject' => true, + ], + 'ShipmentDetails' => [ + 'type' => 'ShipmentDetails', + 'required' => false, + 'subobject' => true, + ], + 'SpecialService' => [ + 'type' => 'SpecialService', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/src/Entity/AM/ShipmentCustRatingRequest.php b/src/Entity/AM/ShipmentCustRatingRequest.php new file mode 100644 index 0000000..857058c --- /dev/null +++ b/src/Entity/AM/ShipmentCustRatingRequest.php @@ -0,0 +1,63 @@ + [ + 'type' => 'Billing', + 'required' => false, + 'subobject' => true, + ], + 'Shipper' => [ + 'type' => 'Shipper', + 'required' => false, + 'subobject' => true, + ], + 'Consignee' => [ + 'type' => 'Consignee', + 'required' => false, + 'subobject' => true, + ], + 'ShipmentDetails' => [ + 'type' => 'ShipmentDetails', + 'required' => false, + 'subobject' => true, + ], + 'SpecialService' => [ + 'type' => 'SpecialService', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/src/Entity/AM/ShipmentRatingErrorResponse.php b/src/Entity/AM/ShipmentRatingErrorResponse.php new file mode 100644 index 0000000..cd63dcf --- /dev/null +++ b/src/Entity/AM/ShipmentRatingErrorResponse.php @@ -0,0 +1,43 @@ + [ + 'type' => 'Response', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/DHL/Entity/AM/ShipmentRatingResponse.php b/src/Entity/AM/ShipmentRatingResponse.php similarity index 58% rename from DHL/Entity/AM/ShipmentRatingResponse.php rename to src/Entity/AM/ShipmentRatingResponse.php index 96a1efb..f8cbbe5 100644 --- a/DHL/Entity/AM/ShipmentRatingResponse.php +++ b/src/Entity/AM/ShipmentRatingResponse.php @@ -1,32 +1,13 @@ array( + protected $body_params = [ + 'Response' => [ 'type' => 'Response', 'required' => false, 'subobject' => true, - ), - 'Note' => array( + ], + 'Note' => [ 'type' => 'Note', 'required' => false, 'subobject' => true, - ), - 'Rated' => array( + ], + 'Rated' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ShippingCharge' => array( + ], + 'ShippingCharge' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ShippingCharge', 'fractionDigits' => '3', 'totalDigits' => '18', - ), - 'SaturdayDeliveryCharge' => array( + ], + 'SaturdayDeliveryCharge' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ProofOfDeliveryCharge' => array( + ], + 'ProofOfDeliveryCharge' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'DutyPayCharge' => array( + ], + 'DutyPayCharge' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'OnForwardCharge' => array( + ], + 'OnForwardCharge' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'InsuranceCharge' => array( + ], + 'InsuranceCharge' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'PackageCharge' => array( + ], + 'PackageCharge' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'PackageCharge', 'fractionDigits' => '3', 'totalDigits' => '18', - ), - 'ChargeableWeight' => array( + ], + 'ChargeableWeight' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'DimensionalWeight' => array( + ], + 'DimensionalWeight' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'OriginServiceArea' => array( + ], + 'OriginServiceArea' => [ 'type' => 'OriginServiceArea', 'required' => false, 'subobject' => true, - ), - 'DestinationServiceArea' => array( + ], + 'DestinationServiceArea' => [ 'type' => 'DestinationServiceArea', 'required' => false, 'subobject' => true, - ), - 'CurrencyCode' => array( + ], + 'CurrencyCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ), - 'WeightUnit' => array( + ], + 'WeightUnit' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Unit of weight measurement (L:Pounds)', 'length' => '1', 'enumeration' => 'K,L', - ), - 'CountryCode' => array( + ], + 'CountryCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO country codes', 'length' => '2', - ), - 'Surcharge' => array( + ], + 'Surcharge' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ZoneID' => array( + ], + 'ZoneID' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - ); + ], + ]; } diff --git a/src/Entity/AM/ShipmentTrackingErrorResponse.php b/src/Entity/AM/ShipmentTrackingErrorResponse.php new file mode 100644 index 0000000..b0d12b6 --- /dev/null +++ b/src/Entity/AM/ShipmentTrackingErrorResponse.php @@ -0,0 +1,43 @@ + [ + 'type' => 'Response', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/src/Entity/AM/ShipmentValidateErrorResponse.php b/src/Entity/AM/ShipmentValidateErrorResponse.php new file mode 100644 index 0000000..263d937 --- /dev/null +++ b/src/Entity/AM/ShipmentValidateErrorResponse.php @@ -0,0 +1,43 @@ + [ + 'type' => 'Response', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/DHL/Entity/AM/ShipmentValidateRequest.php b/src/Entity/AM/ShipmentValidateRequest.php similarity index 57% rename from DHL/Entity/AM/ShipmentValidateRequest.php rename to src/Entity/AM/ShipmentValidateRequest.php index be7cfcb..4aaf365 100644 --- a/DHL/Entity/AM/ShipmentValidateRequest.php +++ b/src/Entity/AM/ShipmentValidateRequest.php @@ -1,32 +1,13 @@ array( + protected $body_params = [ + 'RequestedPickupTime' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'NewShipper' => array( + ], + 'NewShipper' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'LanguageCode' => array( + ], + 'LanguageCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO Language Code', - ), - 'PiecesEnabled' => array( + ], + 'PiecesEnabled' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Pieces Enabling Flag', 'enumeration' => 'Y,N', - ), - 'Billing' => array( + ], + 'Billing' => [ 'type' => 'Billing', 'required' => false, 'subobject' => true, - ), - 'Consignee' => array( + ], + 'Consignee' => [ 'type' => 'Consignee', 'required' => false, 'subobject' => true, - ), - 'Commodity' => array( + ], + 'Commodity' => [ 'type' => 'Commodity', 'required' => false, 'subobject' => true, - ), - 'Dutiable' => array( + ], + 'Dutiable' => [ 'type' => 'Dutiable', 'required' => false, 'subobject' => true, - ), - 'ExportDeclaration' => array( + ], + 'ExportDeclaration' => [ 'type' => 'ExportDeclaration', 'required' => false, 'subobject' => true, - ), - 'Reference' => array( + ], + 'Reference' => [ 'type' => 'Reference', 'required' => false, 'subobject' => true, - ), - 'ShipmentDetails' => array( + ], + 'ShipmentDetails' => [ 'type' => 'ShipmentDetails', 'required' => false, 'subobject' => true, - ), - 'Shipper' => array( + ], + 'Shipper' => [ 'type' => 'Shipper', 'required' => false, 'subobject' => true, - ), - 'SpecialService' => array( + ], + 'SpecialService' => [ 'type' => 'SpecialService', 'required' => false, 'subobject' => true, - ), - 'Place' => array( + ], + 'Place' => [ 'type' => 'Place', 'required' => false, 'subobject' => true, - ), - 'EProcShip' => array( + ], + 'EProcShip' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Airwaybill' => array( + ], + 'Airwaybill' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'DocImages' => array( + ], + 'DocImages' => [ 'type' => 'DocImages', 'required' => false, 'subobject' => true, - ), - 'LabelImageFormat' => array( + ], + 'LabelImageFormat' => [ 'type' => 'string', 'required' => false, 'subobject' => false, @@ -149,16 +130,16 @@ class ShipmentValidateRequest extends Base 'minLength' => '3', 'maxLength' => '4', 'enumeration' => 'PDF,ZPL2,EPL2', - ), - 'RequestArchiveDoc' => array( + ], + 'RequestArchiveDoc' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Label' => array( + ], + 'Label' => [ 'type' => 'Label', 'required' => false, 'subobject' => true, - ), - ); + ], + ]; } diff --git a/DHL/Entity/AM/ShipmentValidateResponse.php b/src/Entity/AM/ShipmentValidateResponse.php similarity index 65% rename from DHL/Entity/AM/ShipmentValidateResponse.php rename to src/Entity/AM/ShipmentValidateResponse.php index c8e7aab..7b245a4 100644 --- a/DHL/Entity/AM/ShipmentValidateResponse.php +++ b/src/Entity/AM/ShipmentValidateResponse.php @@ -1,32 +1,13 @@ array( + protected $body_params = [ + 'Response' => [ 'type' => 'Response', 'required' => false, 'subobject' => true, - ), - 'Note' => array( + ], + 'Note' => [ 'type' => 'Note', 'required' => false, 'subobject' => true, - ), - 'AirwayBillNumber' => array( + ], + 'AirwayBillNumber' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'BillingCode' => array( + ], + 'BillingCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ChargeCardConfirmationNumber' => array( + ], + 'ChargeCardConfirmationNumber' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'CurrencyCode' => array( + ], + 'CurrencyCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ), - 'CourierMessage' => array( + ], + 'CourierMessage' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'DHLRoutingCode' => array( + ], + 'DHLRoutingCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Routing Code Text', - ), - 'DHLRoutingDataId' => array( + ], + 'DHLRoutingDataId' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'DestinationServiceArea' => array( + ], + 'DestinationServiceArea' => [ 'type' => 'DestinationServiceArea', 'required' => false, 'subobject' => true, - ), - 'OriginServiceArea' => array( + ], + 'OriginServiceArea' => [ 'type' => 'OriginServiceArea', 'required' => false, 'subobject' => true, - ), - 'ProductContentCode' => array( + ], + 'ProductContentCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ProductShortName' => array( + ], + 'ProductShortName' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'InternalServiceCode' => array( + ], + 'InternalServiceCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Handling feature code returned by GLS', - ), - 'DeliveryDateCode' => array( + ], + 'DeliveryDateCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'DeliveryTimeCode' => array( + ], + 'DeliveryTimeCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Pieces' => array( + ], + 'Pieces' => [ 'type' => 'Pieces', 'required' => false, 'subobject' => true, - ), - 'PackageCharge' => array( + ], + 'PackageCharge' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'PackageCharge', 'fractionDigits' => '3', 'totalDigits' => '18', - ), - 'Rated' => array( + ], + 'Rated' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ShippingCharge' => array( + ], + 'ShippingCharge' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ShippingCharge', 'fractionDigits' => '3', 'totalDigits' => '18', - ), - 'ShippingChargeInUSD' => array( + ], + 'ShippingChargeInUSD' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'InsuredAmount' => array( + ], + 'InsuredAmount' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'WeightUnit' => array( + ], + 'WeightUnit' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Unit of weight measurement (L:Pounds)', 'minLength' => '0', 'maxLength' => '1', - ), - 'ChargeableWeight' => array( + ], + 'ChargeableWeight' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'DimensionalWeight' => array( + ], + 'DimensionalWeight' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ReadyByTime' => array( + ], + 'ReadyByTime' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'PickupCharge' => array( + ], + 'PickupCharge' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'CallInTime' => array( + ], + 'CallInTime' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'DaysAdvanceNotice' => array( + ], + 'DaysAdvanceNotice' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ConversionRate' => array( + ], + 'ConversionRate' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'CountryCode' => array( + ], + 'CountryCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO country codes', 'length' => '2', - ), - 'Barcodes' => array( + ], + 'Barcodes' => [ 'type' => 'string', 'required' => false, 'subobject' => true, - ), - 'Piece' => array( + ], + 'Piece' => [ 'type' => 'Piece', 'required' => false, 'subobject' => true, - ), - 'Contents' => array( + ], + 'Contents' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Reference' => array( + ], + 'Reference' => [ 'type' => 'Reference', 'required' => false, 'subobject' => true, - ), - 'Consignee' => array( + ], + 'Consignee' => [ 'type' => 'Consignee', 'required' => false, 'subobject' => true, - ), - 'Shipper' => array( + ], + 'Shipper' => [ 'type' => 'Shipper', 'required' => false, 'subobject' => true, - ), - 'AccountNumber' => array( + ], + 'AccountNumber' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'DHL Account Number', 'maxInclusive' => '9999999999', 'minInclusive' => '100000000', - ), - 'CustomerID' => array( + ], + 'CustomerID' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ShipmentDate' => array( + ], + 'ShipmentDate' => [ 'type' => 'ShipmentDate', 'required' => false, 'subobject' => true, - ), - 'GlobalProductCode' => array( + ], + 'GlobalProductCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => '', 'minLength' => '1', 'maxLength' => '4', - ), - 'SpecialService' => array( + ], + 'SpecialService' => [ 'type' => 'SpecialService', 'required' => false, 'subobject' => true, - ), - 'Billing' => array( + ], + 'Billing' => [ 'type' => 'Billing', 'required' => false, 'subobject' => true, - ), - 'Dutiable' => array( + ], + 'Dutiable' => [ 'type' => 'Dutiable', 'required' => false, 'subobject' => true, - ), - 'ExportDeclaration' => array( + ], + 'ExportDeclaration' => [ 'type' => 'ExportDeclaration', 'required' => false, 'subobject' => true, - ), - 'NewShipper' => array( + ], + 'NewShipper' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'SDeliveryDt' => array( + ], + 'SDeliveryDt' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'maxLength' => '10', - ), - 'EDeliveryDt' => array( + ], + 'EDeliveryDt' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'maxLength' => '4', - ), - 'LHPOrigCd' => array( + ], + 'LHPOrigCd' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'maxLength' => '4', - ), - 'LHPDestCd' => array( + ], + 'LHPDestCd' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'maxLength' => '4', - ), - 'PLTStatus' => array( + ], + 'PLTStatus' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'PLTStatus', 'length' => '1', 'enumeration' => 'A,D,S', - ), - 'QtdSInAdCur' => array( + ], + 'QtdSInAdCur' => [ 'type' => 'QtdSInAdCur', 'required' => false, 'subobject' => true, - ), - 'LabelImage' => array( + ], + 'LabelImage' => [ 'type' => 'LabelImage', 'required' => false, 'subobject' => true, - ), - ); + ], + ]; } diff --git a/src/Entity/AM/TrackingResponse.php b/src/Entity/AM/TrackingResponse.php new file mode 100644 index 0000000..7ae5c64 --- /dev/null +++ b/src/Entity/AM/TrackingResponse.php @@ -0,0 +1,59 @@ + [ + 'type' => 'Response', + 'required' => false, + 'subobject' => true, + ], + 'AWBInfo' => [ + 'type' => 'AWBInfo', + 'required' => false, + 'subobject' => true, + ], + 'Fault' => [ + 'type' => 'Fault', + 'required' => false, + 'subobject' => true, + ], + 'LanguageCode' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'ISO Language Code', + ], + ]; +} diff --git a/src/Entity/AM/UnknownTrackingRequest.php b/src/Entity/AM/UnknownTrackingRequest.php new file mode 100644 index 0000000..06aa4d6 --- /dev/null +++ b/src/Entity/AM/UnknownTrackingRequest.php @@ -0,0 +1,69 @@ + [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'ISO Language Code', + ], + 'AccountNumber' => [ + 'type' => 'string', + 'required' => true, + 'subobject' => false, + 'comment' => 'DHL Account Number', + 'maxInclusive' => '9999999999', + 'minInclusive' => '100000000', + ], + 'ShipperReference' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'ShipmentDate' => [ + 'type' => 'ShipmentDate', + 'required' => false, + 'subobject' => true, + ], + 'CountryCode' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'ISO country codes', + 'length' => '2', + ], + ]; +} diff --git a/src/Entity/AP/BookPickupRequest.php b/src/Entity/AP/BookPickupRequest.php new file mode 100644 index 0000000..42e5012 --- /dev/null +++ b/src/Entity/AP/BookPickupRequest.php @@ -0,0 +1,63 @@ + [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'Place' => [ + 'type' => 'Place', + 'required' => false, + 'subobject' => true, + ], + 'Pickup' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'PickupContact' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'ShipmentDetails' => [ + 'type' => 'ShipmentDetails', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/src/Entity/AP/CancelPickupRequest.php b/src/Entity/AP/CancelPickupRequest.php new file mode 100644 index 0000000..7444b4f --- /dev/null +++ b/src/Entity/AP/CancelPickupRequest.php @@ -0,0 +1,72 @@ + [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'minInclusive' => '1', + 'maxInclusive' => '999999999', + ], + 'RequestorName' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'maxLength' => '35', + ], + 'CountryCode' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'ISO country codes', + 'maxLength' => '2', + ], + 'OriginSvcArea' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'maxLength' => '5', + ], + 'Reason' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'maxLength' => '3', + 'minLength' => '3', + 'enumeration' => '001,002,003,004,005,006,007,008', + ], + ]; +} diff --git a/src/Entity/AP/ModifyPickupRequest.php b/src/Entity/AP/ModifyPickupRequest.php new file mode 100644 index 0000000..37e9c40 --- /dev/null +++ b/src/Entity/AP/ModifyPickupRequest.php @@ -0,0 +1,71 @@ + [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'minInclusive' => '1', + 'maxInclusive' => '999999999', + ], + 'Requestor' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'Place' => [ + 'type' => 'Place', + 'required' => false, + 'subobject' => true, + ], + 'Pickup' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'PickupContact' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'OriginSvcArea' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'maxLength' => '5', + ], + ]; +} diff --git a/DHL/Entity/AP/ShipmentValidateRequest.php b/src/Entity/AP/ShipmentValidateRequest.php similarity index 56% rename from DHL/Entity/AP/ShipmentValidateRequest.php rename to src/Entity/AP/ShipmentValidateRequest.php index 9926da5..ebe7f16 100644 --- a/DHL/Entity/AP/ShipmentValidateRequest.php +++ b/src/Entity/AP/ShipmentValidateRequest.php @@ -1,32 +1,13 @@ array( + protected $body_params = [ + 'LanguageCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO Language Code', - ), - 'PiecesEnabled' => array( + ], + 'PiecesEnabled' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Pieces Enabling Flag', 'enumeration' => 'Y,N', - ), - 'Billing' => array( + ], + 'Billing' => [ 'type' => 'Billing', 'required' => false, 'subobject' => true, - ), - 'Consignee' => array( + ], + 'Consignee' => [ 'type' => 'Consignee', 'required' => false, 'subobject' => true, - ), - 'Commodity' => array( + ], + 'Commodity' => [ 'type' => 'Commodity', 'required' => false, 'subobject' => true, - ), - 'Dutiable' => array( + ], + 'Dutiable' => [ 'type' => 'Dutiable', 'required' => false, 'subobject' => true, - ), - 'ExportDeclaration' => array( + ], + 'ExportDeclaration' => [ 'type' => 'ExportDeclaration', 'required' => false, 'subobject' => true, - ), - 'Reference' => array( + ], + 'Reference' => [ 'type' => 'Reference', 'required' => false, 'subobject' => true, - ), - 'ShipmentDetails' => array( + ], + 'ShipmentDetails' => [ 'type' => 'ShipmentDetails', 'required' => false, 'subobject' => true, - ), - 'Shipper' => array( + ], + 'Shipper' => [ 'type' => 'Shipper', 'required' => false, 'subobject' => true, - ), - 'SpecialService' => array( + ], + 'SpecialService' => [ 'type' => 'SpecialService', 'required' => false, 'subobject' => true, - ), - 'EProcShip' => array( + ], + 'EProcShip' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Airwaybill' => array( + ], + 'Airwaybill' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'DocImages' => array( + ], + 'DocImages' => [ 'type' => 'DocImages', 'required' => false, 'subobject' => true, - ), - 'LabelImageFormat' => array( + ], + 'LabelImageFormat' => [ 'type' => 'string', 'required' => false, 'subobject' => false, @@ -134,16 +115,16 @@ class ShipmentValidateRequest extends Base 'minLength' => '3', 'maxLength' => '4', 'enumeration' => 'PDF,ZPL2,EPL2', - ), - 'RequestArchiveDoc' => array( + ], + 'RequestArchiveDoc' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Label' => array( + ], + 'Label' => [ 'type' => 'Label', 'required' => false, 'subobject' => true, - ), - ); + ], + ]; } diff --git a/DHL/Entity/AP/ShipmentValidateResponse.php b/src/Entity/AP/ShipmentValidateResponse.php similarity index 63% rename from DHL/Entity/AP/ShipmentValidateResponse.php rename to src/Entity/AP/ShipmentValidateResponse.php index 7426e42..9fe4729 100644 --- a/DHL/Entity/AP/ShipmentValidateResponse.php +++ b/src/Entity/AP/ShipmentValidateResponse.php @@ -1,324 +1,285 @@ array( + protected $body_params = [ + 'Response' => [ 'type' => 'Response', 'required' => false, 'subobject' => true, - ), - 'Note' => array( + ], + 'Note' => [ 'type' => 'Note', 'required' => false, 'subobject' => true, - ), - 'AirwayBillNumber' => array( + ], + 'AirwayBillNumber' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'BillingCode' => array( + ], + 'BillingCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ChargeCardConfirmationNumber' => array( + ], + 'ChargeCardConfirmationNumber' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'CurrencyCode' => array( + ], + 'CurrencyCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ), - 'CourierMessage' => array( + ], + 'CourierMessage' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'DHLRoutingCode' => array( + ], + 'DHLRoutingCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Routing Code Text', - ), - 'DHLRoutingDataId' => array( + ], + 'DHLRoutingDataId' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'DestinationServiceArea' => array( + ], + 'DestinationServiceArea' => [ 'type' => 'DestinationServiceArea', 'required' => false, 'subobject' => true, - ), - 'OriginServiceArea' => array( + ], + 'OriginServiceArea' => [ 'type' => 'OriginServiceArea', 'required' => false, 'subobject' => true, - ), - 'ProductContentCode' => array( + ], + 'ProductContentCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ProductShortName' => array( + ], + 'ProductShortName' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'InternalServiceCode' => array( + ], + 'InternalServiceCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Handling feature code returned by GLS', - ), - 'DeliveryDateCode' => array( + ], + 'DeliveryDateCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'DeliveryTimeCode' => array( + ], + 'DeliveryTimeCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Pieces' => array( + ], + 'Pieces' => [ 'type' => 'Pieces', 'required' => false, 'subobject' => true, - ), - 'PackageCharge' => array( + ], + 'PackageCharge' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'PackageCharge', 'fractionDigits' => '3', 'totalDigits' => '18', - ), - 'Rated' => array( + ], + 'Rated' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ShippingCharge' => array( + ], + 'ShippingCharge' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ShippingCharge', 'fractionDigits' => '3', 'totalDigits' => '18', - ), - 'WeightUnit' => array( + ], + 'WeightUnit' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Unit of weight measurement (L:Pounds)', 'minLength' => '0', 'maxLength' => '1', - ), - 'ChargeableWeight' => array( + ], + 'ChargeableWeight' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'DimensionalWeight' => array( + ], + 'DimensionalWeight' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ReadyByTime' => array( + ], + 'ReadyByTime' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'PickupCharge' => array( + ], + 'PickupCharge' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'CallInTime' => array( + ], + 'CallInTime' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'DaysAdvanceNotice' => array( + ], + 'DaysAdvanceNotice' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ConversionRate' => array( + ], + 'ConversionRate' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'CountryCode' => array( + ], + 'CountryCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO country codes', 'length' => '2', - ), - 'Barcodes' => array( + ], + 'Barcodes' => [ 'type' => 'string', 'required' => false, 'subobject' => true, - ), - 'Piece' => array( + ], + 'Piece' => [ 'type' => 'Piece', 'required' => false, 'subobject' => true, - ), - 'Contents' => array( + ], + 'Contents' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Reference' => array( + ], + 'Reference' => [ 'type' => 'Reference', 'required' => false, 'subobject' => true, - ), - 'Consignee' => array( + ], + 'Consignee' => [ 'type' => 'Consignee', 'required' => false, 'subobject' => true, - ), - 'Shipper' => array( + ], + 'Shipper' => [ 'type' => 'Shipper', 'required' => false, 'subobject' => true, - ), - 'AccountNumber' => array( + ], + 'AccountNumber' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'DHL Account Number', 'maxInclusive' => '9999999999', 'minInclusive' => '100000000', - ), - 'CustomerID' => array( + ], + 'CustomerID' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ShipmentDate' => array( + ], + 'ShipmentDate' => [ 'type' => 'ShipmentDate', 'required' => false, 'subobject' => true, - ), - 'GlobalProductCode' => array( + ], + 'GlobalProductCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => '', 'minLength' => '1', 'maxLength' => '4', - ), - 'SpecialService' => array( + ], + 'SpecialService' => [ 'type' => 'SpecialService', 'required' => false, 'subobject' => true, - ), - 'Billing' => array( + ], + 'Billing' => [ 'type' => 'Billing', 'required' => false, 'subobject' => true, - ), - 'Dutiable' => array( + ], + 'Dutiable' => [ 'type' => 'Dutiable', 'required' => false, 'subobject' => true, - ), - 'ExportDeclaration' => array( + ], + 'ExportDeclaration' => [ 'type' => 'ExportDeclaration', 'required' => false, 'subobject' => true, - ), - 'NewShipper' => array( + ], + 'NewShipper' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'PLTStatus' => array( + ], + 'PLTStatus' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'PLTStatus', 'length' => '1', 'enumeration' => 'A,D,S', - ), - 'QtdSInAdCur' => array( + ], + 'QtdSInAdCur' => [ 'type' => 'QtdSInAdCur', 'required' => false, 'subobject' => true, - ), - 'LabelImage' => array( + ], + 'LabelImage' => [ 'type' => 'LabelImage', 'required' => false, 'subobject' => true, - ), - 'CustData' => array( + ], + 'CustData' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'CustData', 'minLength' => '1', 'maxLength' => '100', - ), - ); + ], + ]; } diff --git a/src/Entity/Base.php b/src/Entity/Base.php new file mode 100644 index 0000000..db711b0 --- /dev/null +++ b/src/Entity/Base.php @@ -0,0 +1,334 @@ + [ + 'type' => 'date-iso8601', + 'required' => true, + ], + 'MessageReference' => [ + 'type' => 'string', + 'required' => true, + 'size' => 28, + ], + 'SiteID' => [ + 'type' => 'string', + 'required' => true, + ], + 'Password' => [ + 'type' => 'string', + 'required' => true, + ], + ]; + + /** + * Parameters to be used in the header + * @var array + */ + protected $header_meta_params = []; + + /** + * Parameters to be used in the body + * + * @var array + */ + protected $body_params = []; + + /** + * Name of the service + * + * @var string + */ + protected $service_name; + + /** + * @var string + * Service XSD + */ + protected $service_xsd; + + /** + * Is object a subobject or not + * + * @var boolean + */ + protected $is_sub_object; + + /** + * @var string + * The schema version + */ + protected $schema_version = '1.0'; + + /** + * @var boolean + * Render the schema version or not + */ + protected $display_schema_version = false; + + /** + * Parent node name of the object + * @var string + */ + protected $xml_model_name; + + /** + * Class constants + */ + public const DHL_REQ = 'http://www.dhl.com'; + public const DHL_XSI = 'http://www.w3.org/2001/XMLSchema-instance'; + + /** + * Class constructor + */ + public function __construct() + { + $this->params = array_merge($this->header_params, $this->header_meta_params, $this->body_params); + $this->initializeValues(); + } + + /** + * Generates the XML to be sent to DHL + * + * @param \XMLWriter $xml_writer XMl Writer instance + * + * @return string + */ + public function toXML(\XMLWriter $xml_writer = null) + { + $this->validateParameters(); + + $xml_writer = new \XMLWriter(); + $xml_writer->openMemory(); + $xml_writer->setIndent(true); + $xml_writer->startDocument('1.0', 'UTF-8'); + + $xml_writer->startElement('req:' . $this->service_name); + $xml_writer->writeAttribute('xmlns:req', self::DHL_REQ); + $xml_writer->writeAttribute('xmlns:xsi', self::DHL_XSI); + $xml_writer->writeAttribute('xsi:schemaLocation', self::DHL_REQ . ' ' . $this->service_xsd); + + if ($this->display_schema_version) { + $xml_writer->writeAttribute('schemaVersion', $this->schema_version); + } + + if (null !== $this->xml_model_name) { + $xml_writer->startElement($this->xml_model_name); + } + + $xml_writer->startElement('Request'); + $xml_writer->startElement('ServiceHeader'); + foreach ($this->header_params as $name => $infos) { + $xml_writer->writeElement($name, $this->$name); + } + $xml_writer->endElement(); // End of ServiceHeader + + if (!empty($this->header_meta_params)) { + $xml_writer->startElement('MetaData'); + foreach ($this->header_meta_params as $name => $infos) { + $xml_writer->writeElement($name, $this->$name); + } + $xml_writer->endElement(); // End of MetaData + } + $xml_writer->endElement(); // End of Request + + foreach ($this->body_params as $name => $infos) { + if ($this->$name) { + if (is_object($this->$name)) { + $this->$name->toXML($xml_writer); + } elseif (is_array($this->$name)) { + if ('string' === $this->params[$name]['type']) { + foreach ($this->$name as $sub_element) { + $xml_writer->writeElement($name, $sub_element); + } + } else { + if ( + !isset($this->params[$name]['disableParentNode']) + || false == $this->params[$name]['disableParentNode'] + ) { + $xml_writer->startElement($name); + } + + foreach ($this->$name as $sub_element) { + $sub_element->toXML($xml_writer); + } + + if ( + !isset($this->params[$name]['disableParentNode']) + || false == $this->params[$name]['disableParentNode'] + ) { + $xml_writer->endElement(); + } + } + } else { + $xml_writer->writeElement($name, $this->$name); + } + } + } + + $xml_writer->endElement(); // End of parent node + + // End of class name tag + if (null !== $this->xml_model_name) { + $xml_writer->endElement(); + } + + $xml_writer->endDocument(); + + return $xml_writer->outputMemory(); + } + + /** + * Initialize object from an XML string + * + * @param string $xml XML String + * + * @return void + * @throws \Exception Exception thrown if response returned has an error + */ + public function initFromXML($xml) + { + $xml = simplexml_load_string(str_replace('req:', '', $xml)); + + if ((string)$xml->Response->Status->Condition->ConditionCode != '') { + $errorMsg = ((string)$xml->Response->Status->Condition->ConditionCode) . ' : ' + . ((string)$xml->Response->Status->Condition->ConditionData); + throw new \Exception('Error returned from DHL webservice : ' . $errorMsg); + } + + $parts = explode('\\', get_class($this)); + $class_name = array_pop($parts); + foreach ($xml->children() as $child) { + $child_name = $child->getName(); + switch ($child_name) { + case 'Response': + $this->MessageTime = (string)$child->ServiceHeader->MessageTime; + $this->MessageReference = (string)$child->ServiceHeader->MessageReference; + $this->SiteID = (string)$child->ServiceHeader->SiteID; + $this->Password = '#'; + break; + + default: + if (is_object($this->$child_name)) { + $this->$child_name->initFromXml($child->asXML()); + } elseif ( + isset($this->params[$child_name]['multivalues']) + && $this->params[$child_name]['multivalues'] + ) { + foreach ($child->children() as $sub_child) { + $sub_child_name = $sub_child->getName(); + if ($sub_child->count() > 1) { + $sub_child_name .= 's'; + } + + $child_class_name = implode('\\', $parts) . '\\' . $this->params[$sub_child_name]['type']; + $child_class_name = str_replace('Entity', 'Datatype', $child_class_name); + + if ('string' === $this->params[$sub_child_name]['type'] && ($sub_child->count() <= 1)) { + $childObj = trim((string)$sub_child); + } else { + $childObj = new $child_class_name(); + $childObj->initFromXml($sub_child->asXML()); + } + + $addMethodName = 'add' . ucfirst($sub_child_name); + $this->$addMethodName($childObj); + } + } elseif (isset($this->$child_name)) { + $this->$child_name = trim((string)$child); + } + break; + } + } + } + + /** + * Initialize property values bag + * + * @return void + */ + protected function initializeValues(): void + { + foreach ($this->params as $name => $infos) { + if (!$this->is_sub_object && isset($infos['subobject']) && $infos['subobject']) { + if (isset($infos['multivalues']) && $infos['multivalues']) { + $this->values[$name] = []; + } else { + $tmp = get_class($this); + $parts = explode('\\', $tmp); + array_pop($parts); + $class_name = implode('\\', $parts) . '\\' . $infos['type']; + $class_name = str_replace('Entity', 'Datatype', $class_name); + if (!class_exists($class_name)) { + $class_name = str_replace(['\\EU\\', '\\AP\\', '\\EA\\'], '\\AM\\', $class_name); + } + $this->values[$name] = new $class_name(); + } + } else { + $this->values[$name] = null; + } + } + } + + /** + * Validate all parameters + * + * @return boolean True upon success + * @throws InvalidArgumentException Throws exception if type not valid or if value are missing + */ + protected function validateParameters(): bool + { + foreach ($this->params as $name => $infos) { + if (isset($infos['required']) && true === $infos['required'] && $this->values[$name] === null) { + throw new InvalidArgumentException('Field ' . $name . ' has no value'); + } + + if ($this->values[$name]) { + if (is_array($this->values[$name])) { + foreach ($this->values[$name] as $sub_element) { + $sub_element->validateParameters(); + } + } else { + $this->validateParameterType($name, $this->values[$name]); + $this->validateParameterValue($name, $this->values[$name]); + } + } + } + + if (null === $this->service_name) { + throw new InvalidArgumentException( + 'Class ' . get_class($this) + . ' must have a valid serviceName property defined' + ); + } + + return true; + } +} diff --git a/src/Entity/EA/BookPickupRequest.php b/src/Entity/EA/BookPickupRequest.php new file mode 100644 index 0000000..4e070e1 --- /dev/null +++ b/src/Entity/EA/BookPickupRequest.php @@ -0,0 +1,63 @@ + [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'Place' => [ + 'type' => 'Place', + 'required' => false, + 'subobject' => true, + ], + 'Pickup' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'PickupContact' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'ShipmentDetails' => [ + 'type' => 'ShipmentDetails', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/src/Entity/EA/CancelPickupRequest.php b/src/Entity/EA/CancelPickupRequest.php new file mode 100644 index 0000000..3bc8d57 --- /dev/null +++ b/src/Entity/EA/CancelPickupRequest.php @@ -0,0 +1,77 @@ + [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'minInclusive' => '1', + 'maxInclusive' => '999999999', + ], + 'RequestorName' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'maxLength' => '35', + ], + 'Reason' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'maxLength' => '3', + 'minLength' => '3', + 'enumeration' => '001,002,003,004,005,006,007', + ], + 'PickupDate' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'CountryCode' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'ISO country codes', + 'maxLength' => '2', + 'minLength' => '2', + ], + 'CancelTime' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + ]; +} diff --git a/DHL/Entity/EA/RoutingRequest.php b/src/Entity/EA/RoutingRequest.php similarity index 55% rename from DHL/Entity/EA/RoutingRequest.php rename to src/Entity/EA/RoutingRequest.php index 00c03ce..632de2e 100644 --- a/DHL/Entity/EA/RoutingRequest.php +++ b/src/Entity/EA/RoutingRequest.php @@ -1,32 +1,13 @@ array( + protected $body_params = [ + 'RequestType' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'length' => '1', 'enumeration' => 'O,D', - ), - 'Address1' => array( + ], + 'Address1' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Address2' => array( + ], + 'Address2' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Address3' => array( + ], + 'Address3' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'PostalCode' => array( + ], + 'PostalCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Full postal/zip code for address', - ), - 'City' => array( + ], + 'City' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'City name', 'maxLength' => '35', - ), - 'Division' => array( + ], + 'Division' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Division (e.g. state, prefecture, etc.) name', 'maxLength' => '35', - ), - 'CountryCode' => array( + ], + 'CountryCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO country codes', 'length' => '2', - ), - 'CountryName' => array( + ], + 'CountryName' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO country name', 'maxLength' => '35', - ), - 'OriginCountryCode' => array( + ], + 'OriginCountryCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - ); + ], + ]; } diff --git a/DHL/Entity/EA/ShipmentValidateRequest.php b/src/Entity/EA/ShipmentValidateRequest.php similarity index 57% rename from DHL/Entity/EA/ShipmentValidateRequest.php rename to src/Entity/EA/ShipmentValidateRequest.php index 496aaea..21af8a3 100644 --- a/DHL/Entity/EA/ShipmentValidateRequest.php +++ b/src/Entity/EA/ShipmentValidateRequest.php @@ -1,32 +1,13 @@ array( + protected $body_params = [ + 'NewShipper' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'LanguageCode' => array( + ], + 'LanguageCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO Language Code', - ), - 'PiecesEnabled' => array( + ], + 'PiecesEnabled' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Pieces Enabling Flag', 'enumeration' => 'Y,N', - ), - 'Billing' => array( + ], + 'Billing' => [ 'type' => 'Billing', 'required' => false, 'subobject' => true, - ), - 'Consignee' => array( + ], + 'Consignee' => [ 'type' => 'Consignee', 'required' => false, 'subobject' => true, - ), - 'Commodity' => array( + ], + 'Commodity' => [ 'type' => 'Commodity', 'required' => false, 'subobject' => true, - ), - 'Dutiable' => array( + ], + 'Dutiable' => [ 'type' => 'Dutiable', 'required' => false, 'subobject' => true, - ), - 'ExportDeclaration' => array( + ], + 'ExportDeclaration' => [ 'type' => 'ExportDeclaration', 'required' => false, 'subobject' => true, - ), - 'Reference' => array( + ], + 'Reference' => [ 'type' => 'Reference', 'required' => false, 'subobject' => true, - ), - 'ShipmentDetails' => array( + ], + 'ShipmentDetails' => [ 'type' => 'ShipmentDetails', 'required' => false, 'subobject' => true, - ), - 'Shipper' => array( + ], + 'Shipper' => [ 'type' => 'Shipper', 'required' => false, 'subobject' => true, - ), - 'SpecialService' => array( + ], + 'SpecialService' => [ 'type' => 'SpecialService', 'required' => false, 'subobject' => true, - ), - 'Place' => array( + ], + 'Place' => [ 'type' => 'Place', 'required' => false, 'subobject' => true, - ), - 'EProcShip' => array( + ], + 'EProcShip' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Airwaybill' => array( + ], + 'Airwaybill' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'DocImages' => array( + ], + 'DocImages' => [ 'type' => 'DocImages', 'required' => false, 'subobject' => true, - ), - 'LabelImageFormat' => array( + ], + 'LabelImageFormat' => [ 'type' => 'string', 'required' => false, 'subobject' => false, @@ -144,16 +125,16 @@ class ShipmentValidateRequest extends Base 'minLength' => '3', 'maxLength' => '4', 'enumeration' => 'PDF,ZPL2,EPL2', - ), - 'RequestArchiveDoc' => array( + ], + 'RequestArchiveDoc' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Label' => array( + ], + 'Label' => [ 'type' => 'Label', 'required' => false, 'subobject' => true, - ), - ); + ], + ]; } diff --git a/DHL/Entity/EA/ShipmentValidateResponse.php b/src/Entity/EA/ShipmentValidateResponse.php similarity index 62% rename from DHL/Entity/EA/ShipmentValidateResponse.php rename to src/Entity/EA/ShipmentValidateResponse.php index f4cde7b..2f947f6 100644 --- a/DHL/Entity/EA/ShipmentValidateResponse.php +++ b/src/Entity/EA/ShipmentValidateResponse.php @@ -1,291 +1,252 @@ array( + protected $body_params = [ + 'Response' => [ 'type' => 'Response', 'required' => false, 'subobject' => true, - ), - 'Note' => array( + ], + 'Note' => [ 'type' => 'Note', 'required' => false, 'subobject' => true, - ), - 'AirwayBillNumber' => array( + ], + 'AirwayBillNumber' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'BillingCode' => array( + ], + 'BillingCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'CurrencyCode' => array( + ], + 'CurrencyCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ), - 'CourierMessage' => array( + ], + 'CourierMessage' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'DHLRoutingCode' => array( + ], + 'DHLRoutingCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Routing Code Text', - ), - 'DHLRoutingDataId' => array( + ], + 'DHLRoutingDataId' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'DestinationServiceArea' => array( + ], + 'DestinationServiceArea' => [ 'type' => 'DestinationServiceArea', 'required' => false, 'subobject' => true, - ), - 'OriginServiceArea' => array( + ], + 'OriginServiceArea' => [ 'type' => 'OriginServiceArea', 'required' => false, 'subobject' => true, - ), - 'ProductContentCode' => array( + ], + 'ProductContentCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ProductShortName' => array( + ], + 'ProductShortName' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'InternalServiceCode' => array( + ], + 'InternalServiceCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Handling feature code returned by GLS', - ), - 'DeliveryDateCode' => array( + ], + 'DeliveryDateCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'DeliveryTimeCode' => array( + ], + 'DeliveryTimeCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Pieces' => array( + ], + 'Pieces' => [ 'type' => 'Pieces', 'required' => false, 'subobject' => true, - ), - 'PackageCharge' => array( + ], + 'PackageCharge' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'PackageCharge', 'fractionDigits' => '3', 'totalDigits' => '18', - ), - 'Rated' => array( + ], + 'Rated' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ShippingCharge' => array( + ], + 'ShippingCharge' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ShippingCharge', 'fractionDigits' => '3', 'totalDigits' => '18', - ), - 'ShippingChargeInUSD' => array( + ], + 'ShippingChargeInUSD' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'WeightUnit' => array( + ], + 'WeightUnit' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Unit of weight measurement (L:Pounds)', 'minLength' => '0', 'maxLength' => '1', - ), - 'ChargeableWeight' => array( + ], + 'ChargeableWeight' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'DimensionalWeight' => array( + ], + 'DimensionalWeight' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'CountryCode' => array( + ], + 'CountryCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO country codes', 'length' => '2', - ), - 'Barcodes' => array( + ], + 'Barcodes' => [ 'type' => 'string', 'required' => false, 'subobject' => true, - ), - 'Piece' => array( + ], + 'Piece' => [ 'type' => 'Piece', 'required' => false, 'subobject' => true, - ), - 'Contents' => array( + ], + 'Contents' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Reference' => array( + ], + 'Reference' => [ 'type' => 'Reference', 'required' => false, 'subobject' => true, - ), - 'Consignee' => array( + ], + 'Consignee' => [ 'type' => 'Consignee', 'required' => false, 'subobject' => true, - ), - 'Shipper' => array( + ], + 'Shipper' => [ 'type' => 'Shipper', 'required' => false, 'subobject' => true, - ), - 'CustomerID' => array( + ], + 'CustomerID' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ShipmentDate' => array( + ], + 'ShipmentDate' => [ 'type' => 'ShipmentDate', 'required' => false, 'subobject' => true, - ), - 'GlobalProductCode' => array( + ], + 'GlobalProductCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => '', 'minLength' => '1', 'maxLength' => '4', - ), - 'SpecialService' => array( + ], + 'SpecialService' => [ 'type' => 'SpecialService', 'required' => false, 'subobject' => true, - ), - 'Billing' => array( + ], + 'Billing' => [ 'type' => 'Billing', 'required' => false, 'subobject' => true, - ), - 'Dutiable' => array( + ], + 'Dutiable' => [ 'type' => 'Dutiable', 'required' => false, 'subobject' => true, - ), - 'ExportDeclaration' => array( + ], + 'ExportDeclaration' => [ 'type' => 'ExportDeclaration', 'required' => false, 'subobject' => true, - ), - 'NewShipper' => array( + ], + 'NewShipper' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'PLTStatus' => array( + ], + 'PLTStatus' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'PLTStatus', 'length' => '1', 'enumeration' => 'A,D,S', - ), - 'QtdSInAdCur' => array( + ], + 'QtdSInAdCur' => [ 'type' => 'QtdSInAdCur', 'required' => false, 'subobject' => true, - ), - 'LabelImage' => array( + ], + 'LabelImage' => [ 'type' => 'LabelImage', 'required' => false, 'subobject' => true, - ), - 'CustData' => array( + ], + 'CustData' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'CustData', 'minLength' => '1', 'maxLength' => '100', - ), - ); + ], + ]; } diff --git a/src/Entity/EU/BookPURequest.php b/src/Entity/EU/BookPURequest.php new file mode 100644 index 0000000..0b79bea --- /dev/null +++ b/src/Entity/EU/BookPURequest.php @@ -0,0 +1,84 @@ + [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'RegionCode', + 'minLength' => '2', + 'maxLength' => '2', + 'enumeration' => 'AP,EU,AM', + ], + 'Requestor' => [ + 'type' => 'Requestor', + 'required' => false, + 'subobject' => true, + ], + 'Place' => [ + 'type' => 'Place', + 'required' => false, + 'subobject' => true, + ], + 'Pickup' => [ + 'type' => 'Pickup', + 'required' => false, + 'subobject' => true, + ], + 'PickupContact' => [ + 'type' => 'PickupContact', + 'required' => false, + 'subobject' => true, + ], + 'ShipmentDetails' => [ + 'type' => 'PUShipmentDetails', + 'required' => false, + 'subobject' => true, + ], + 'ConsigneeDetails' => [ + 'type' => 'Consignee', + 'required' => false, + 'subobject' => true, + + ] + ]; +} diff --git a/DHL/Entity/GB/BookPUResponse.php b/src/Entity/EU/BookPUResponse.php similarity index 56% rename from DHL/Entity/GB/BookPUResponse.php rename to src/Entity/EU/BookPUResponse.php index 06f4a30..054f452 100644 --- a/DHL/Entity/GB/BookPUResponse.php +++ b/src/Entity/EU/BookPUResponse.php @@ -1,32 +1,13 @@ array( + protected $body_params = [ + 'Response' => [ 'type' => 'Response', 'required' => false, 'subobject' => true, - ), - 'RegionCode' => array( + ], + 'RegionCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, @@ -66,69 +47,69 @@ class BookPUResponse extends Base 'minLength' => '2', 'maxLength' => '2', 'enumeration' => 'AP,EU,AM', - ), - 'Note' => array( + ], + 'Note' => [ 'type' => 'Note', 'required' => false, 'subobject' => true, - ), - 'ConfirmationNumber' => array( + ], + 'ConfirmationNumber' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'minInclusive' => '1', 'maxInclusive' => '999999999', - ), - 'ReadyByTime' => array( + ], + 'ReadyByTime' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'SecondReadyByTime' => array( + ], + 'SecondReadyByTime' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'NextPickupDate' => array( + ], + 'NextPickupDate' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'PickupCharge' => array( + ], + 'PickupCharge' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'CurrencyCode' => array( + ], + 'CurrencyCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ), - 'CallInTime' => array( + ], + 'CallInTime' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'SecondCallInTime' => array( + ], + 'SecondCallInTime' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'OriginSvcArea' => array( + ], + 'OriginSvcArea' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'minLength' => '3', 'maxLength' => '3', - ), - 'CountryCode' => array( + ], + 'CountryCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO country codes', 'length' => '2', - ), - ); + ], + ]; } diff --git a/DHL/Entity/GB/CancelPURequest.php b/src/Entity/EU/CancelPURequest.php similarity index 54% rename from DHL/Entity/GB/CancelPURequest.php rename to src/Entity/EU/CancelPURequest.php index 66e779e..ab955a0 100644 --- a/DHL/Entity/GB/CancelPURequest.php +++ b/src/Entity/EU/CancelPURequest.php @@ -1,32 +1,13 @@ array( + protected $body_params = [ + 'RegionCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, @@ -61,51 +48,51 @@ class CancelPURequest extends Base 'minLength' => '2', 'maxLength' => '2', 'enumeration' => 'AP,EU,AM', - ), - 'ConfirmationNumber' => array( + ], + 'ConfirmationNumber' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'minInclusive' => '1', 'maxInclusive' => '999999999', - ), - 'RequestorName' => array( + ], + 'RequestorName' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'maxLength' => '35', - ), - 'CountryCode' => array( + ], + 'CountryCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO country codes', 'length' => '2', - ), - 'OriginSvcArea' => array( + ], + 'OriginSvcArea' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'minLength' => '3', 'maxLength' => '3', - ), - 'Reason' => array( + ], + 'Reason' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'maxLength' => '3', 'minLength' => '3', 'enumeration' => '001,002,003,004,005,006,007,008', - ), - 'PickupDate' => array( + ], + 'PickupDate' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'CancelTime' => array( + ], + 'CancelTime' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - ); + ], + ]; } diff --git a/DHL/Entity/GB/CancelPUResponse.php b/src/Entity/EU/CancelPUResponse.php similarity index 56% rename from DHL/Entity/GB/CancelPUResponse.php rename to src/Entity/EU/CancelPUResponse.php index 6024dbf..0522c88 100644 --- a/DHL/Entity/GB/CancelPUResponse.php +++ b/src/Entity/EU/CancelPUResponse.php @@ -1,32 +1,13 @@ array( + protected $body_params = [ + 'Response' => [ 'type' => 'Response', 'required' => false, 'subobject' => true, - ), - 'RegionCode' => array( + ], + 'RegionCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, @@ -66,69 +47,69 @@ class CancelPUResponse extends Base 'minLength' => '2', 'maxLength' => '2', 'enumeration' => 'AP,EU,AM', - ), - 'Note' => array( + ], + 'Note' => [ 'type' => 'Note', 'required' => false, 'subobject' => true, - ), - 'ConfirmationNumber' => array( + ], + 'ConfirmationNumber' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'minInclusive' => '1', 'maxInclusive' => '999999999', - ), - 'ReadyByTime' => array( + ], + 'ReadyByTime' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'SecondReadyByTime' => array( + ], + 'SecondReadyByTime' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'NextPickupDate' => array( + ], + 'NextPickupDate' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'PickupCharge' => array( + ], + 'PickupCharge' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'CurrencyCode' => array( + ], + 'CurrencyCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ), - 'CallInTime' => array( + ], + 'CallInTime' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'SecondCallInTime' => array( + ], + 'SecondCallInTime' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'OriginSvcArea' => array( + ], + 'OriginSvcArea' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'minLength' => '3', 'maxLength' => '3', - ), - 'CountryCode' => array( + ], + 'CountryCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO country codes', 'length' => '2', - ), - ); + ], + ]; } diff --git a/DHL/Entity/GB/KnownTrackingRequest.php b/src/Entity/EU/KnownTrackingRequest.php similarity index 51% rename from DHL/Entity/GB/KnownTrackingRequest.php rename to src/Entity/EU/KnownTrackingRequest.php index 36e2a01..9ea6316 100644 --- a/DHL/Entity/GB/KnownTrackingRequest.php +++ b/src/Entity/EU/KnownTrackingRequest.php @@ -1,32 +1,13 @@ array( + protected $body_params = [ + 'LanguageCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO Language Code', 'maxLength' => '2', - ), - 'AWBNumber' => array( + ], + 'AWBNumber' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Airway bill number', 'maxLength' => '10', - ), - 'LPNumber' => array( + ], + 'LPNumber' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'LevelOfDetails' => array( + ], + 'LevelOfDetails' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Checkpoint details selection flag', 'enumeration' => 'LAST_CHECK_POINT_ONLY,ALL_CHECK_POINTS', - ), - 'PiecesEnabled' => array( + ], + 'PiecesEnabled' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Pieces Enabling Flag', 'enumeration' => 'S,B,P', - ), - 'CountryCode' => array( + ], + 'CountryCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO country codes', 'length' => '2', - ), - ); + ], + ]; } diff --git a/src/Entity/EU/ModifyPURequest.php b/src/Entity/EU/ModifyPURequest.php new file mode 100644 index 0000000..b6895e5 --- /dev/null +++ b/src/Entity/EU/ModifyPURequest.php @@ -0,0 +1,80 @@ + [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'RegionCode', + 'minLength' => '2', + 'maxLength' => '2', + 'enumeration' => 'AP,EU,AM', + ], + 'ConfirmationNumber' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'minInclusive' => '1', + 'maxInclusive' => '999999999', + ], + 'Requestor' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'Place' => [ + 'type' => 'Place', + 'required' => false, + 'subobject' => true, + ], + 'Pickup' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'PickupContact' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'OriginSvcArea' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'maxLength' => '5', + ], + ]; +} diff --git a/DHL/Entity/GB/ModifyPUResponse.php b/src/Entity/EU/ModifyPUResponse.php similarity index 56% rename from DHL/Entity/GB/ModifyPUResponse.php rename to src/Entity/EU/ModifyPUResponse.php index 00f29f7..3a8b861 100644 --- a/DHL/Entity/GB/ModifyPUResponse.php +++ b/src/Entity/EU/ModifyPUResponse.php @@ -1,32 +1,13 @@ array( + protected $body_params = [ + 'Response' => [ 'type' => 'Response', 'required' => false, 'subobject' => true, - ), - 'RegionCode' => array( + ], + 'RegionCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, @@ -66,69 +47,69 @@ class ModifyPUResponse extends Base 'minLength' => '2', 'maxLength' => '2', 'enumeration' => 'AP,EU,AM', - ), - 'Note' => array( + ], + 'Note' => [ 'type' => 'Note', 'required' => false, 'subobject' => true, - ), - 'ConfirmationNumber' => array( + ], + 'ConfirmationNumber' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'minInclusive' => '1', 'maxInclusive' => '999999999', - ), - 'ReadyByTime' => array( + ], + 'ReadyByTime' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'SecondReadyByTime' => array( + ], + 'SecondReadyByTime' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'NextPickupDate' => array( + ], + 'NextPickupDate' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'PickupCharge' => array( + ], + 'PickupCharge' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'CurrencyCode' => array( + ], + 'CurrencyCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ), - 'CallInTime' => array( + ], + 'CallInTime' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'SecondCallInTime' => array( + ], + 'SecondCallInTime' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'OriginSvcArea' => array( + ], + 'OriginSvcArea' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'minLength' => '3', 'maxLength' => '3', - ), - 'CountryCode' => array( + ], + 'CountryCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO country codes', 'length' => '2', - ), - ); + ], + ]; } diff --git a/DHL/Entity/GB/RouteRequest.php b/src/Entity/EU/RouteRequest.php similarity index 57% rename from DHL/Entity/GB/RouteRequest.php rename to src/Entity/EU/RouteRequest.php index b02d0c0..59ac6fa 100644 --- a/DHL/Entity/GB/RouteRequest.php +++ b/src/Entity/EU/RouteRequest.php @@ -1,32 +1,13 @@ array( + protected $body_params = [ + 'RegionCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, @@ -67,68 +48,68 @@ class RouteRequest extends Base 'minLength' => '2', 'maxLength' => '2', 'enumeration' => 'AP,EU,AM', - ), - 'RequestType' => array( + ], + 'RequestType' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'length' => '1', 'enumeration' => 'O,D', - ), - 'Address1' => array( + ], + 'Address1' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Address2' => array( + ], + 'Address2' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Address3' => array( + ], + 'Address3' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'PostalCode' => array( + ], + 'PostalCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Full postal/zip code for address', 'maxLength' => '12', - ), - 'City' => array( + ], + 'City' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'City name', 'maxLength' => '35', - ), - 'Division' => array( + ], + 'Division' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Division (e.g. state, prefecture, etc.) name', 'maxLength' => '35', - ), - 'CountryCode' => array( + ], + 'CountryCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO country codes', 'length' => '2', - ), - 'CountryName' => array( + ], + 'CountryName' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO country name', 'maxLength' => '35', - ), - 'OriginCountryCode' => array( + ], + 'OriginCountryCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - ); + ], + ]; } diff --git a/src/Entity/EU/RouteResponse.php b/src/Entity/EU/RouteResponse.php new file mode 100644 index 0000000..5e948a7 --- /dev/null +++ b/src/Entity/EU/RouteResponse.php @@ -0,0 +1,67 @@ + [ + 'type' => 'Response', + 'required' => false, + 'subobject' => true, + ], + 'RegionCode' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'RegionCode', + 'minLength' => '2', + 'maxLength' => '2', + 'enumeration' => 'AP,EU,AM', + ], + 'GMTNegativeIndicator' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'GMTOffset' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'ServiceArea' => [ + 'type' => 'ServiceArea', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/DHL/Entity/GB/ShipmentRequest.php b/src/Entity/EU/ShipmentRequest.php similarity index 58% rename from DHL/Entity/GB/ShipmentRequest.php rename to src/Entity/EU/ShipmentRequest.php index c87d77c..28c6786 100644 --- a/DHL/Entity/GB/ShipmentRequest.php +++ b/src/Entity/EU/ShipmentRequest.php @@ -1,32 +1,13 @@ [ + 'type' => 'string', + 'required' => true, + 'subobject' => false, + ], + 'SoftwareVersion' => [ + 'type' => 'string', + 'required' => true, + 'subobject' => false, + ], + ]; + + /** + * @var string + * The schema version + */ + protected $schema_version = '10.0'; /** * Parameters to be send in the body * @var array */ - protected $_bodyParams = array( - 'RegionCode' => array( + protected $body_params = [ + 'RegionCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, @@ -73,105 +70,130 @@ class ShipmentRequest extends Base 'minLength' => '2', 'maxLength' => '2', 'enumeration' => 'AP,EU,AM', - ), - 'RequestedPickupTime' => array( + ], + 'RequestedPickupTime' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'NewShipper' => array( + ], + 'NewShipper' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'LanguageCode' => array( + ], + 'LanguageCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO Language Code', 'maxLength' => '2', - ), - 'PiecesEnabled' => array( + ], + 'PiecesEnabled' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Pieces Enabling Flag', 'enumeration' => 'Y,N', - ), - 'Billing' => array( + ], + 'Billing' => [ 'type' => 'Billing', 'required' => false, 'subobject' => true, - ), - 'Consignee' => array( + ], + 'ValueAddedServices' => [ + 'type' => 'ValueAddedServices', + 'required' => false, + 'subobject' => true, + ], + 'Consignee' => [ 'type' => 'Consignee', 'required' => false, 'subobject' => true, - ), - 'Commodity' => array( + ], + 'Commodity' => [ 'type' => 'Commodity', 'required' => false, 'subobject' => true, - ), - 'Dutiable' => array( + ], + 'Dutiable' => [ 'type' => 'Dutiable', 'required' => false, 'subobject' => true, - ), - 'ExportDeclaration' => array( + ], + 'UseDHLInvoice' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'enumeration' => 'Y,N', + ], + 'DHLInvoiceLanguageCode' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'ISO Language Code', + 'maxLength' => '2', + ], + 'DHLInvoiceType' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'maxLength' => '3', + 'comment' => 'CMI (commercial invoice) / PFI (Proforma Invoice)' + ], + 'ExportDeclaration' => [ 'type' => 'ExportDeclaration', 'required' => false, 'subobject' => true, - ), - 'Reference' => array( + ], + 'Reference' => [ 'type' => 'Reference', 'required' => false, 'subobject' => true, - ), - 'ShipmentDetails' => array( + ], + 'ShipmentDetails' => [ 'type' => 'ShipmentDetails', 'required' => false, 'subobject' => true, - ), - 'Shipper' => array( + ], + 'Shipper' => [ 'type' => 'Shipper', 'required' => false, 'subobject' => true, - ), - 'SpecialService' => array( + ], + 'SpecialService' => [ 'disableParentNode' => true, 'multivalues' => true, 'type' => 'SpecialService', 'required' => false, 'subobject' => true, - ), - 'Notification' => array( + ], + 'Notification' => [ 'type' => 'Notification', 'required' => false, 'subobject' => true, - ), - 'Place' => array( + ], + 'Place' => [ 'type' => 'Place', 'required' => false, 'subobject' => true, - ), - 'EProcShip' => array( + ], + 'EProcShip' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Airwaybill' => array( + ], + 'Airwaybill' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'DocImages' => array( + ], + 'DocImages' => [ 'type' => 'DocImage', 'multivalues' => true, 'required' => false, 'subobject' => true, - ), - 'LabelImageFormat' => array( + ], + 'LabelImageFormat' => [ 'type' => 'string', 'required' => false, 'subobject' => false, @@ -179,21 +201,21 @@ class ShipmentRequest extends Base 'minLength' => '3', 'maxLength' => '4', 'enumeration' => 'PDF,ZPL2,EPL2', - ), - 'RequestArchiveDoc' => array( + ], + 'RequestArchiveDoc' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'NumberOfArchiveDoc' => array( + ], + 'NumberOfArchiveDoc' => [ 'type' => 'integer', 'required' => false, 'subobject' => false, - ), - 'Label' => array( + ], + 'Label' => [ 'type' => 'Label', 'required' => false, 'subobject' => true, - ), - ); + ], + ]; } diff --git a/DHL/Entity/GB/ShipmentResponse.php b/src/Entity/EU/ShipmentResponse.php similarity index 66% rename from DHL/Entity/GB/ShipmentResponse.php rename to src/Entity/EU/ShipmentResponse.php index 0772fa3..c4b81b7 100644 --- a/DHL/Entity/GB/ShipmentResponse.php +++ b/src/Entity/EU/ShipmentResponse.php @@ -1,32 +1,13 @@ array( + protected $body_params = [ + 'Response' => [ 'type' => 'Response', 'required' => false, 'subobject' => true, - ), - 'RegionCode' => array( + ], + 'RegionCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, @@ -66,187 +47,187 @@ class ShipmentResponse extends Base 'minLength' => '2', 'maxLength' => '2', 'enumeration' => 'AP,EU,AM', - ), - 'Note' => array( + ], + 'Note' => [ 'type' => 'Note', 'required' => false, 'subobject' => true, - ), - 'AirwayBillNumber' => array( + ], + 'AirwayBillNumber' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'DHLRoutingCode' => array( + ], + 'DHLRoutingCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Routing Code Text', - ), - 'DHLRoutingDataId' => array( + ], + 'DHLRoutingDataId' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'BillingCode' => array( + ], + 'BillingCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'CurrencyCode' => array( + ], + 'CurrencyCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ), - 'CourierMessage' => array( + ], + 'CourierMessage' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'DestinationServiceArea' => array( + ], + 'DestinationServiceArea' => [ 'type' => 'DestinationServiceArea', 'required' => false, 'subobject' => true, - ), - 'OriginServiceArea' => array( + ], + 'OriginServiceArea' => [ 'type' => 'OriginServiceArea', 'required' => false, 'subobject' => true, - ), - 'PackageCharge' => array( + ], + 'PackageCharge' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'PackageCharge', 'fractionDigits' => '3', 'totalDigits' => '18', - ), - 'Rated' => array( + ], + 'Rated' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ShippingCharge' => array( + ], + 'ShippingCharge' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ShippingCharge', 'fractionDigits' => '3', 'totalDigits' => '18', - ), - 'InsuredAmount' => array( + ], + 'InsuredAmount' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'WeightUnit' => array( + ], + 'WeightUnit' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Unit of weight measurement (K:KiloGram)', 'minLength' => '0', 'maxLength' => '1', - ), - 'ChargeableWeight' => array( + ], + 'ChargeableWeight' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'DimensionalWeight' => array( + ], + 'DimensionalWeight' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ReadyByTime' => array( + ], + 'ReadyByTime' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'PickupCharge' => array( + ], + 'PickupCharge' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'CallInTime' => array( + ], + 'CallInTime' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'DaysAdvanceNotice' => array( + ], + 'DaysAdvanceNotice' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ConversionRate' => array( + ], + 'ConversionRate' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'CountryCode' => array( + ], + 'CountryCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'ISO country codes', 'length' => '2', - ), - 'Pieces' => array( + ], + 'Pieces' => [ 'type' => 'ShipValResponsePiece', 'required' => false, 'subobject' => true, 'multivalues' => true, - ), - 'BarCodes' => array( + ], + 'BarCodes' => [ 'type' => 'BarCodes', 'required' => false, 'subobject' => true, 'multivalues' => false, - ), - 'Piece' => array( + ], + 'Piece' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'multivalues' => false, - ), - 'Contents' => array( + ], + 'Contents' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'Reference' => array( + ], + 'Reference' => [ 'type' => 'Reference', 'required' => false, 'subobject' => true, - ), - 'Consignee' => array( + ], + 'Consignee' => [ 'type' => 'Consignee', 'required' => false, 'subobject' => true, - ), - 'Shipper' => array( + ], + 'Shipper' => [ 'type' => 'Shipper', 'required' => false, 'subobject' => true, - ), - 'AccountNumber' => array( + ], + 'AccountNumber' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'DHL Account Number', 'maxLength' => '12', - ), - 'CustomerID' => array( + ], + 'CustomerID' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ShipmentDate' => array( + ], + 'ShipmentDate' => [ 'type' => 'ShipmentDate', 'required' => false, 'subobject' => true, - ), - 'GlobalProductCode' => array( + ], + 'GlobalProductCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, @@ -254,83 +235,83 @@ class ShipmentResponse extends Base 'pattern' => '([A-Z0-9])*', 'minLength' => '1', 'maxLength' => '4', - ), - 'ProductContentCode' => array( + ], + 'ProductContentCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'ProductShortName' => array( + ], + 'ProductShortName' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'InternalServiceCode' => array( + ], + 'InternalServiceCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Handling feature code returned by GLS', - ), - 'DeliveryDateCode' => array( + ], + 'DeliveryDateCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'DeliveryTimeCode' => array( + ], + 'DeliveryTimeCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'SpecialService' => array( + ], + 'SpecialService' => [ 'type' => 'SpecialService', 'required' => false, 'subobject' => true, - ), - 'Billing' => array( + ], + 'Billing' => [ 'type' => 'Billing', 'required' => false, 'subobject' => true, - ), - 'Dutiable' => array( + ], + 'Dutiable' => [ 'type' => 'Dutiable', 'required' => false, 'subobject' => true, - ), - 'ExportDeclaration' => array( + ], + 'ExportDeclaration' => [ 'type' => 'ExportDeclaration', 'required' => false, 'subobject' => true, - ), - 'NewShipper' => array( + ], + 'NewShipper' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - 'PLTStatus' => array( + ], + 'PLTStatus' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'PLTStatus', 'length' => '1', 'enumeration' => 'A,D,S', - ), - 'QtdSInAdCur' => array( + ], + 'QtdSInAdCur' => [ 'type' => 'QtdSInAdCur', 'required' => false, 'subobject' => true, - ), - 'LabelImage' => array( + ], + 'LabelImage' => [ 'type' => 'LabelImage', 'required' => false, 'subobject' => true, - ), - 'CustData' => array( + ], + 'CustData' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'CustData', 'minLength' => '1', 'maxLength' => '100', - ), - ); + ], + ]; } diff --git a/src/Entity/EU/TrackingResponse.php b/src/Entity/EU/TrackingResponse.php new file mode 100644 index 0000000..2c277fb --- /dev/null +++ b/src/Entity/EU/TrackingResponse.php @@ -0,0 +1,60 @@ + [ + 'type' => 'Response', + 'required' => false, + 'subobject' => true, + ], + 'AWBInfo' => [ + 'type' => 'AWBInfo', + 'required' => false, + 'subobject' => true, + ], + 'Fault' => [ + 'type' => 'Fault', + 'required' => false, + 'subobject' => true, + ], + 'LanguageCode' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'ISO Language Code', + 'maxLength' => '2', + ], + ]; +} diff --git a/src/Entity/EU/UnknownTrackingRequest.php b/src/Entity/EU/UnknownTrackingRequest.php new file mode 100644 index 0000000..6ab5911 --- /dev/null +++ b/src/Entity/EU/UnknownTrackingRequest.php @@ -0,0 +1,69 @@ + [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'ISO Language Code', + 'maxLength' => '2', + ], + 'AccountNumber' => [ + 'type' => 'string', + 'required' => true, + 'subobject' => false, + 'comment' => 'DHL Account Number', + 'maxLength' => '12', + ], + 'ShipperReference' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + ], + 'ShipmentDate' => [ + 'type' => 'ShipmentDate', + 'required' => false, + 'subobject' => true, + ], + 'CountryCode' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'ISO country codes', + 'length' => '2', + ], + ]; +} diff --git a/src/Service.php b/src/Service.php new file mode 100644 index 0000000..7f48ad6 --- /dev/null +++ b/src/Service.php @@ -0,0 +1,59 @@ +client = $client; + } + + /** + * Send a shipment request to DHL + * + * @param ShipmentRequest Request to send + * + * @return bool|ShipmentResponse The Shipment response object upon success, false otherwise + */ + public function sendShipmentRequest(ShipmentRequest $request) + { + // Call DHL XML API + try { + $xml = $this->client->call($request); + $response = new ShipmentResponse(); + $response->initFromXML($xml); + } catch (\Exception $e) { + $this->error_message = $e->getMessage(); + return false; + } + + return $response; + } +} diff --git a/vendor/autoloadManager/README.md b/vendor/autoloadManager/README.md deleted file mode 100644 index b0b36c0..0000000 --- a/vendor/autoloadManager/README.md +++ /dev/null @@ -1,124 +0,0 @@ - - _______________________ - - AutoLoad Manager README - _______________________ - - -AUTHORS & CONTACT -================= - -Al-Fallouji Bashar - - bashar@alfallouji.com - -Charron Pierrick - - pierrick@webstart.fr - - -DOCUMENTATION & DOWNLOAD -======================== - -Latest version is available on github at : - - http://github.com/alfallouji/PHP-Autoload-Manager/ - -Documentation can be found on : - - http://bashar.alfallouji.com/PHP-Autoload-Manager/ - - -LICENSE -======= - -This Code is released under the GNU LGPL - -Please do not change the header of the file(s). - -This library is free software; you can redistribute it and/or modify it -under the terms of the GNU Lesser General Public License as published -by the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This library is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU Lesser General Public License for more details. - - -DESCRIPTION -=========== - -AutoLoad Manager is a generic autoloader that can be used with any -framework or library. - -Using the PHP tokenizer mechanism, it will parse folder(s) and discover -the different classes and interfaces defined. - -The big advantage of using this autoloadManager is that it will allow -you to implement whatever naming rules you want and may have mutliple -classes in one file (if you want to have a such feature). - -So basically, you don’t have anymore to implement some complex naming rules -between the filename and the classname. You may organize the way you want -your API (may have as many subfolders as you want, or have multiple -API folders, etc.). - - -How does it work ? -================== - -It will scan any given folder and find any defined PHP classes or interfaces. -It will then create an hashtable that will reference what class can be -found in what file. This hash table is serialized and cached in a file. - -Whenever, your program or script will look for a non-existing class, -the autoloadManager will look on that hash table and load the file if it exists. - -A fallback mechanism can be used also in a development environment that will -try to rescan all the folders once more (this mechanism is usefull when -you are often adding new classes to your program). - - -How can I use it ? -================== - -First, you will have simply to load the autoloadManager class into your script. - - include('api/autoloadManager.php'); - - -Secondly, you will have to instanciate your autoloadManager and define -the path where the autoloadManager will store the file containing the -hash table. - - $autoloadManager = new AutoloadManager(); - $autoloadManager->setSaveFile('./autoload.php'); - -Then, you have the four main features offered by this script. - -1. Register the loadClass function: - - $autoloadManager->register(); - -2. Add a folder to process: - - $autoloadManager->addFolder('{YOUR_FOLDER_PATH}'); - - -For instance, if your classes are found in ‘/var/www/myProject/lib’ and -‘/var/www/myProject/includes’, then you can do something like this. - - $autoloadManager->addFolder('/var/www/myProject/lib'); - $autoloadManager->addFolder('/var/www/myProject/includes'); - $autoloadManager->register(); - -3. Add or remove file extensions to scan: - -By default the autoloadManager will parse all .php and .inc files. You can -modify this behavior by using the setFileRegex method as bellow - - $autoloadManager->setFileRegex('/\.php$/'); - - -4. Exclude a folder from the process list: - - $autoloadManager->excludeFolder('/var/www/myProject/includes/lib1'); diff --git a/vendor/autoloadManager/autoloadManager.php b/vendor/autoloadManager/autoloadManager.php deleted file mode 100644 index 1bbefe2..0000000 --- a/vendor/autoloadManager/autoloadManager.php +++ /dev/null @@ -1,508 +0,0 @@ -register(); - * Add a folder to process: $autoloader->addFolder('{YOUR_FOLDER_PATH}'); - * - * Read documentation for more information. - */ -class autoloadManager -{ - /** - * Constants used by the checkClass method - * @var int - */ - const CLASS_NOT_FOUND = 0; - const CLASS_EXISTS = 1; - const CLASS_IS_NULL = 2; - - /** - * Constants used for the scan options - * @var int - */ - const SCAN_NEVER = 0; // 0b000 - const SCAN_ONCE = 1; // 0b001 - const SCAN_ALWAYS = 3; // 0b011 - const SCAN_CACHE = 4; // 0b100 - - /** - * Folders that should be parsed - * @var array - */ - private $_folders = array(); - - /** - * Excluded folders - * @var array - */ - private $_excludedFolders = array(); - - /** - * Classes and their matching filename - * @var array - */ - private $_classes = array(); - - /** - * Scan files matching this regex - * @var string - */ - private $_filesRegex = '/\.(inc|php)$/'; - - /** - * Save path (Default is null) - * @var string - */ - private $_saveFile = null; - - /** - * Scan options - * @var Integer (options) - */ - private $_scanOptions = self::SCAN_ONCE; - - /** - * Constructor - * - * @param string $saveFile Path where autoload files will be saved - * @param int $scanOptions Scan options - * @return void - */ - public function __construct($saveFile = null, $scanOptions = self::SCAN_ONCE) - { - $this->setSaveFile($saveFile); - $this->setScanOptions($scanOptions); - } - - /** - * Get the path where autoload files are saved - * - * @return string path where autoload files will be saved - */ - public function getSaveFile() - { - return $this->_saveFile; - } - - /** - * Set the path where autoload files are saved - * - * @param string $path path where autoload files will be saved - */ - public function setSaveFile($pathToFile) - { - $this->_saveFile = $pathToFile; - if ($this->_saveFile && file_exists($this->_saveFile)) - { - $this->_classes = include($this->_saveFile); - } - } - - /** - * Set the file regex - * - * @param string - */ - public function setFileRegex($regex) - { - $this->_filesRegex = $regex; - } - - /** - * Set the file extensions - * - * Another method to set up the $_filesRegex - * - * @param string|array allowed extension string or array with extension strings - * @return void - */ - public function setAllowedFileExtensions($extensions) - { - $regex = '/\.'; - if (is_array($extensions)) - { - $regex .= '(' . implode('|', $extensions) . ')'; - } - else { - $regex .= $extensions; - } - - $this->_filesRegex = $regex . '$/'; - } - - /** - * Add a new folder to parse - * - * @param string $path Root path to process - */ - public function addFolder($path) - { - if ($realpath = realpath($path) and is_dir($realpath)) - { - $this->_folders[] = $realpath; - } - else - { - throw new Exception('Failed to open dir : ' . $path); - } - } - - /** - * Exclude a folder from the parsing - * - * @param string $path Folder to exclude - */ - public function excludeFolder($path) - { - if ($realpath = realpath($path) and is_dir($realpath)) - { - $this->_excludedFolders[] = $realpath . DIRECTORY_SEPARATOR; - } - else - { - throw new Exception('Failed to open dir : ' . $path); - } - } - - /** - * Checks if the class has been defined - * - * @param string $className Name of the class - * @return bool true if class exists, false otherwise. - */ - public function classExists($className) - { - return self::CLASS_EXISTS === $this->checkClass($className, $this->_classes); - } - - /** - * Set the scan options - * - * @param int $options scan options. - * @return void - */ - public function setScanOptions($options) - { - $this->_scanOptions = $options; - } - - /** - * Get the scan options. - * - * @return int - */ - public function getScanOptions() - { - return $this->_scanOptions; - } - - /** - * Method used by the spl_autoload_register - * - * @param string $className Name of the class - * @return void - */ - public function loadClass($className) - { - $className = strtolower($className); - // check if the class already exists in the cache file - $loaded = $this->checkClass($className, $this->_classes); - if (!$loaded && (self::SCAN_ONCE & $this->_scanOptions)) - { - // parse the folders returns the list of all the classes - // in the application - $this->refresh(); - - // recheck if the class exists again in the reloaded classes - $loaded = $this->checkClass($className, $this->_classes); - if (!$loaded && (self::SCAN_CACHE & $this->_scanOptions)) - { - // set it to null to flag that it was not found - // This behaviour fixes the problem with infinite - // loop if we have a class_exists() for an inexistant - // class. - $this->_classes[$className] = null; - } - - // write to a single file - if ($this->getSaveFile()) - { - $this->saveToFile($this->_classes); - } - - // scan just once per call - if (!($this->_scanOptions & 2)) - { - $this->_scanOptions = $this->_scanOptions & ~ self::SCAN_ONCE; - } - } - } - - /** - * checks if a className exists in the class array - * - * @param mixed $className the classname to check - * @param array $classes an array of classes - * @return int errorCode 1 if the class exists - * 2 if the class exists and is null - * (there have been an attempt done) - * 0 if the class does not exist - */ - private function checkClass($className, array $classes) - { - if (isset($classes[$className])) - { - require $classes[$className]; - return self::CLASS_EXISTS; - } - elseif (array_key_exists($className, $classes)) - { - return self::CLASS_IS_NULL; - } - return self::CLASS_NOT_FOUND; - } - - - /** - * Parse every registred folders, regenerate autoload files and update the $_classes - * - * @return array Array containing all the classes found - */ - private function parseFolders() - { - $classesArray = array(); - foreach ($this->_folders as $folder) - { - $classesArray = array_merge($classesArray, $this->parseFolder($folder)); - } - return $classesArray; - } - - /** - * Parse folder and update $_classes array - * - * @param string $folder Folder to process - * @return array Array containing all the classes found - */ - private function parseFolder($folder) - { - $classes = array(); - $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($folder)); - - foreach ($files as $file) - { - if ($file->isFile() && preg_match($this->_filesRegex, $file->getFilename())) - { - foreach ($this->_excludedFolders as $folder) - { - $len = strlen($folder); - if (0 === strncmp($folder, $file->getPathname(), $len)) - { - continue 2; - } - } - - if ($classNames = $this->getClassesFromFile($file->getPathname())) - { - foreach ($classNames as $className) - { - // Adding class to map - $classes[$className] = $file->getPathname(); - } - } - } - } - return $classes; - } - - /** - * Extract the classname contained inside the php file - * - * @param string $file Filename to process - * @return array Array of classname(s) and interface(s) found in the file - */ - private function getClassesFromFile($file) - { - $namespace = null; - $classes = array(); - $tokens = token_get_all(file_get_contents($file)); - $nbtokens = count($tokens); - - for ($i = 0 ; $i < $nbtokens ; $i++) - { - switch ($tokens[$i][0]) - { - case T_NAMESPACE: - $i+=2; - while ($tokens[$i][0] === T_STRING || $tokens[$i][0] === T_NS_SEPARATOR) - { - $namespace .= $tokens[$i++][1]; - } - break; - case T_INTERFACE: - case T_CLASS: - case T_TRAIT: - $i+=2; - if ($namespace) - { - $classes[] = strtolower($namespace . '\\' . $tokens[$i][1]); - } - else - { - $classes[] = strtolower($tokens[$i][1]); - } - break; - } - } - - return $classes; - } - - /** - * Generate a file containing an array. - * File is generated under the _savePath folder. - * - * @param array $classes Contains all the classes found and the corresponding filename (e.g. {$className} => {fileName}) - * @param string $folder Folder to process - * @return void - */ - private function saveToFile(array $classes) - { - // Write header and comment - $content = 'getSaveFile(), $content); - } - - /** - * Returns previously registered classes - * - * @return array the list of registered classes - */ - public function getRegisteredClasses() - { - return $this->_classes; - } - - /** - * Refreshes an already generated cache file - * This solves problems with previously unexistant classes that - * have been made available after. - * The optimize functionnality will look at all null values of - * the available classes and does a new parse. if it founds that - * there are classes that has been made available, it will update - * the file. - * - * @return bool true if there has been a change to the array, false otherwise - */ - public function refresh() - { - $existantClasses = $this->_classes; - $nullClasses = array_filter($existantClasses, array('self','_getNullElements')); - $newClasses = $this->parseFolders(); - - // $newClasses will override $nullClasses if the same key exists - // this allows new added classes (that were flagged as null) to be - // added - $this->_classes = array_merge($nullClasses, $newClasses); - return true; - } - - /** - * Generate the autoload file - * - * @return void - */ - public function generate() - { - if ($this->getSaveFile()) - { - $this->refresh(); - $this->saveToFile($this->_classes); - } - } - - /** - * returns null elements (used in an array filter) - * - * @param mixed $element the element to check - * @return bool true if element is null, false otherwise - */ - private function _getNullElements($element) - { - return null === $element; - } - - /** - * Registers this autoloadManager on the SPL autoload stack. - * - * @return void - */ - public function register() - { - spl_autoload_register(array($this, 'loadClass')); - } - - /** - * Removes this autoloadManager from the SPL autoload stack. - * - * @return void - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - } -} -