From 51f084a86ec5b5978c50496e77e44a3d588d4579 Mon Sep 17 00:00:00 2001 From: Martins Fridenbergs Date: Sat, 20 Apr 2019 10:38:35 +0300 Subject: [PATCH 01/42] PSR-2 & PSR-4 restructure DRY for entity and datatype objects remove redundant comments remove deprecated protected variable underscore prefix --- DHL/Datatype/AM/AWBInfo.php | 67 --- DHL/Datatype/AM/BarCodes.php | 51 -- DHL/Datatype/AM/Billing.php | 85 --- DHL/Datatype/AM/Commodity.php | 60 --- DHL/Datatype/AM/Condition.php | 55 -- DHL/Datatype/AM/Consignee.php | 113 ---- DHL/Datatype/AM/Customer.php | 55 -- DHL/Datatype/AM/CustomerLogo.php | 59 -- DHL/Datatype/AM/DCTDutiable.php | 61 --- DHL/Datatype/AM/DCTFrom.php | 76 --- DHL/Datatype/AM/DCTTo.php | 76 --- DHL/Datatype/AM/DestinationServiceArea.php | 71 --- DHL/Datatype/AM/DocImage.php | 67 --- DHL/Datatype/AM/DocImages.php | 50 -- DHL/Datatype/AM/Email.php | 81 --- DHL/Datatype/AM/ErrorResponse.php | 55 -- DHL/Datatype/AM/EventRemarks.php | 57 -- DHL/Datatype/AM/ExportDeclaration.php | 117 ---- DHL/Datatype/AM/ExportLineItem.php | 125 ----- DHL/Datatype/AM/Fault.php | 50 -- DHL/Datatype/AM/Label.php | 73 --- DHL/Datatype/AM/LabelImage.php | 63 --- DHL/Datatype/AM/Note.php | 55 -- DHL/Datatype/AM/OriginServiceArea.php | 64 --- DHL/Datatype/AM/Piece.php | 98 ---- DHL/Datatype/AM/PieceDetails.php | 126 ----- DHL/Datatype/AM/PieceFault.php | 63 --- DHL/Datatype/AM/PieceInfo.php | 55 -- DHL/Datatype/AM/PieceType.php | 81 --- DHL/Datatype/AM/Pieces.php | 50 -- DHL/Datatype/AM/QtdSInAdCur.php | 76 --- DHL/Datatype/AM/QtdShpExChrgType.php | 61 --- DHL/Datatype/AM/QtdShpType.php | 66 --- DHL/Datatype/AM/Reference.php | 59 -- DHL/Datatype/AM/Request.php | 50 -- DHL/Datatype/AM/Response.php | 50 -- DHL/Datatype/AM/ServiceArea.php | 57 -- DHL/Datatype/AM/ServiceEvent.php | 55 -- DHL/Datatype/AM/ServiceHeader.php | 74 --- DHL/Datatype/AM/ShipValResponsePiece.php | 117 ---- DHL/Datatype/AM/ShipValResponsePieces.php | 50 -- DHL/Datatype/AM/Shipment.php | 156 ------ DHL/Datatype/AM/ShipmentDate.php | 57 -- DHL/Datatype/AM/ShipmentEvent.php | 75 --- DHL/Datatype/AM/Shipper.php | 142 ----- DHL/Datatype/AM/Status.php | 55 -- DHL/Datatype/AM/TrackingPieces.php | 50 -- DHL/Datatype/AM/WeightSeg.php | 62 --- DHL/Datatype/AP/AWBInfo.php | 67 --- DHL/Datatype/AP/BarCodes.php | 51 -- DHL/Datatype/AP/Billing.php | 85 --- DHL/Datatype/AP/ChargeCard.php | 76 --- DHL/Datatype/AP/Commodity.php | 60 --- DHL/Datatype/AP/Condition.php | 55 -- DHL/Datatype/AP/Contact.php | 83 --- DHL/Datatype/AP/Customer.php | 55 -- DHL/Datatype/AP/CustomerLogo.php | 59 -- DHL/Datatype/AP/DestinationServiceArea.php | 71 --- DHL/Datatype/AP/DocImage.php | 67 --- DHL/Datatype/AP/DocImages.php | 50 -- DHL/Datatype/AP/Dutiable.php | 102 ---- DHL/Datatype/AP/Email.php | 81 --- DHL/Datatype/AP/ErrorResponse.php | 55 -- DHL/Datatype/AP/EventRemarks.php | 57 -- DHL/Datatype/AP/ExportDeclaration.php | 117 ---- DHL/Datatype/AP/Fault.php | 50 -- DHL/Datatype/AP/Label.php | 73 --- DHL/Datatype/AP/LabelImage.php | 63 --- DHL/Datatype/AP/Note.php | 55 -- DHL/Datatype/AP/OriginServiceArea.php | 64 --- DHL/Datatype/AP/Piece.php | 98 ---- DHL/Datatype/AP/PieceDetails.php | 126 ----- DHL/Datatype/AP/PieceEvent.php | 70 --- DHL/Datatype/AP/PieceFault.php | 63 --- DHL/Datatype/AP/PieceInfo.php | 55 -- DHL/Datatype/AP/Pieces.php | 50 -- DHL/Datatype/AP/Place.php | 102 ---- DHL/Datatype/AP/QtdSInAdCur.php | 76 --- DHL/Datatype/AP/Reference.php | 59 -- DHL/Datatype/AP/Request.php | 50 -- DHL/Datatype/AP/Response.php | 50 -- DHL/Datatype/AP/ServiceArea.php | 57 -- DHL/Datatype/AP/ServiceEvent.php | 55 -- DHL/Datatype/AP/ShipValResponsePieces.php | 50 -- DHL/Datatype/AP/ShipmentDate.php | 57 -- DHL/Datatype/AP/ShipmentEvent.php | 75 --- DHL/Datatype/AP/ShipmentInfo.php | 135 ----- DHL/Datatype/AP/SpecialService.php | 97 ---- DHL/Datatype/AP/Status.php | 55 -- DHL/Datatype/AP/TrackingPieces.php | 50 -- DHL/Datatype/AP/WeightSeg.php | 62 --- DHL/Datatype/EA/AWBInfo.php | 67 --- DHL/Datatype/EA/BarCodes.php | 51 -- DHL/Datatype/EA/ChargeCard.php | 76 --- DHL/Datatype/EA/Commodity.php | 60 --- DHL/Datatype/EA/Condition.php | 55 -- DHL/Datatype/EA/Consignee.php | 113 ---- DHL/Datatype/EA/Contact.php | 83 --- DHL/Datatype/EA/Customer.php | 55 -- DHL/Datatype/EA/CustomerLogo.php | 59 -- DHL/Datatype/EA/DestinationServiceArea.php | 71 --- DHL/Datatype/EA/DocImage.php | 67 --- DHL/Datatype/EA/DocImages.php | 50 -- DHL/Datatype/EA/Dutiable.php | 102 ---- DHL/Datatype/EA/ErrorResponse.php | 55 -- DHL/Datatype/EA/EventRemarks.php | 57 -- DHL/Datatype/EA/ExportLineItem.php | 125 ----- DHL/Datatype/EA/Fault.php | 50 -- DHL/Datatype/EA/Label.php | 73 --- DHL/Datatype/EA/LabelImage.php | 63 --- DHL/Datatype/EA/Note.php | 55 -- DHL/Datatype/EA/OriginServiceArea.php | 64 --- DHL/Datatype/EA/PieceEvent.php | 70 --- DHL/Datatype/EA/PieceFault.php | 63 --- DHL/Datatype/EA/PieceInfo.php | 55 -- DHL/Datatype/EA/Pieces.php | 50 -- DHL/Datatype/EA/Place.php | 102 ---- DHL/Datatype/EA/Reference.php | 59 -- DHL/Datatype/EA/Request.php | 50 -- DHL/Datatype/EA/Response.php | 50 -- DHL/Datatype/EA/ServiceArea.php | 57 -- DHL/Datatype/EA/ServiceHeader.php | 74 --- DHL/Datatype/EA/ShipValResponsePiece.php | 117 ---- DHL/Datatype/EA/ShipValResponsePieces.php | 50 -- DHL/Datatype/EA/Shipment.php | 156 ------ DHL/Datatype/EA/ShipmentDate.php | 57 -- DHL/Datatype/EA/ShipmentEvent.php | 75 --- DHL/Datatype/EA/Shipper.php | 142 ----- DHL/Datatype/EA/Status.php | 55 -- DHL/Datatype/EA/TrackingPieces.php | 50 -- DHL/Datatype/EA/WeightSeg.php | 62 --- DHL/Datatype/GB/AWBInfo.php | 67 --- DHL/Datatype/GB/AdditionalProtection.php | 60 --- DHL/Datatype/GB/BarCode.php | 51 -- DHL/Datatype/GB/BarCodes.php | 69 --- DHL/Datatype/GB/Billing.php | 82 --- DHL/Datatype/GB/ChargeCard.php | 76 --- DHL/Datatype/GB/Commodity.php | 60 --- DHL/Datatype/GB/Condition.php | 55 -- DHL/Datatype/GB/Contact.php | 87 --- DHL/Datatype/GB/Customer.php | 55 -- DHL/Datatype/GB/CustomerLogo.php | 59 -- DHL/Datatype/GB/DestinationServiceArea.php | 71 --- DHL/Datatype/GB/DocImage.php | 67 --- DHL/Datatype/GB/ErrorResponse.php | 55 -- DHL/Datatype/GB/Fault.php | 50 -- DHL/Datatype/GB/LabelImage.php | 63 --- DHL/Datatype/GB/Note.php | 55 -- DHL/Datatype/GB/OriginServiceArea.php | 64 --- DHL/Datatype/GB/PieceEvent.php | 70 --- DHL/Datatype/GB/PieceFault.php | 63 --- DHL/Datatype/GB/PieceInfo.php | 55 -- DHL/Datatype/GB/Pieces.php | 51 -- DHL/Datatype/GB/QtdSInAdCur.php | 76 --- DHL/Datatype/GB/Reference.php | 59 -- DHL/Datatype/GB/Request.php | 50 -- DHL/Datatype/GB/Response.php | 50 -- DHL/Datatype/GB/ResponseServiceHeader.php | 66 --- DHL/Datatype/GB/ServiceArea.php | 57 -- DHL/Datatype/GB/ServiceEvent.php | 55 -- DHL/Datatype/GB/ServiceHeader.php | 74 --- DHL/Datatype/GB/ShipValResponsePieces.php | 50 -- DHL/Datatype/GB/ShipmentDate.php | 59 -- DHL/Datatype/GB/ShipmentEvent.php | 70 --- DHL/Datatype/GB/ShipmentInfo.php | 102 ---- DHL/Datatype/GB/Status.php | 55 -- DHL/Datatype/GB/TrackingPieces.php | 50 -- DHL/Datatype/GB/WeightSeg.php | 64 --- DHL/Entity/AM/BookPickupRequest.php | 92 ---- DHL/Entity/AM/CancelPickupRequest.php | 84 --- DHL/Entity/AM/DCTRequest.php | 64 --- DHL/Entity/AM/ErrorResponse.php | 62 --- DHL/Entity/AM/GetCapability.php | 85 --- DHL/Entity/AM/GetQuote.php | 85 --- DHL/Entity/AM/ModifyPickupRequest.php | 90 ---- DHL/Entity/AM/PickupErrorResponse.php | 62 --- DHL/Entity/AM/PickupResponse.php | 125 ----- DHL/Entity/AM/RoutingErrorResponse.php | 62 --- DHL/Entity/AM/RoutingResponse.php | 86 --- DHL/Entity/AM/ShipmentBookRatingRequest.php | 77 --- DHL/Entity/AM/ShipmentCustRatingRequest.php | 82 --- DHL/Entity/AM/ShipmentRatingErrorResponse.php | 62 --- .../AM/ShipmentTrackingErrorResponse.php | 62 --- .../AM/ShipmentValidateErrorResponse.php | 62 --- DHL/Entity/AM/TrackingResponse.php | 78 --- DHL/Entity/AM/UnknownTrackingRequest.php | 88 --- DHL/Entity/AP/BookPickupRequest.php | 82 --- DHL/Entity/AP/CancelPickupRequest.php | 91 ---- DHL/Entity/AP/ErrorResponse.php | 62 --- DHL/Entity/AP/KnownTrackingRequest.php | 96 ---- DHL/Entity/AP/ModifyPickupRequest.php | 90 ---- DHL/Entity/AP/PickupErrorResponse.php | 62 --- DHL/Entity/AP/PickupResponse.php | 125 ----- DHL/Entity/AP/RoutingErrorResponse.php | 62 --- DHL/Entity/AP/RoutingRequest.php | 118 ---- DHL/Entity/AP/RoutingResponse.php | 86 --- .../AP/ShipmentTrackingErrorResponse.php | 62 --- .../AP/ShipmentValidateErrorResponse.php | 62 --- DHL/Entity/AP/TrackingResponse.php | 78 --- DHL/Entity/AP/UnknownTrackingRequest.php | 88 --- DHL/Entity/Base.php | 364 ------------- DHL/Entity/EA/BookPickupRequest.php | 82 --- DHL/Entity/EA/CancelPickupRequest.php | 96 ---- DHL/Entity/EA/ErrorResponse.php | 62 --- DHL/Entity/EA/KnownTrackingRequest.php | 96 ---- DHL/Entity/EA/PickupErrorResponse.php | 62 --- DHL/Entity/EA/RoutingErrorResponse.php | 62 --- DHL/Entity/EA/RoutingResponse.php | 86 --- .../EA/ShipmentTrackingErrorResponse.php | 62 --- .../EA/ShipmentValidateErrorResponse.php | 62 --- DHL/Entity/EA/TrackingResponse.php | 78 --- DHL/Entity/EA/UnknownTrackingRequest.php | 88 --- DHL/Entity/GB/BookPURequest.php | 91 ---- DHL/Entity/GB/ModifyPURequest.php | 99 ---- DHL/Entity/GB/RouteResponse.php | 86 --- DHL/Entity/GB/TrackingResponse.php | 79 --- DHL/Entity/GB/UnknownTrackingRequest.php | 88 --- DHL/Service.php | 79 --- composer.json | 25 +- conf/config.sample.php | 40 -- config/dhl.php | 5 + {DHL => src}/Client/Web.php | 52 +- src/Datatype/AM/AWBInfo.php | 46 ++ src/Datatype/AM/BarCodes.php | 30 ++ .../EA => src/Datatype/AM}/Billing.php | 49 +- {DHL => src}/Datatype/AM/BkgDetailsType.php | 125 ++--- {DHL => src}/Datatype/AM/ChargeCard.php | 45 +- src/Datatype/AM/Commodity.php | 39 ++ src/Datatype/AM/Condition.php | 34 ++ .../AP => src/Datatype/AM}/Consignee.php | 73 +-- {DHL => src}/Datatype/AM/Contact.php | 53 +- src/Datatype/AM/Customer.php | 34 ++ src/Datatype/AM/CustomerLogo.php | 38 ++ src/Datatype/AM/DCTDutiable.php | 40 ++ src/Datatype/AM/DCTFrom.php | 55 ++ src/Datatype/AM/DCTTo.php | 55 ++ src/Datatype/AM/DestinationServiceArea.php | 50 ++ src/Datatype/AM/DocImage.php | 46 ++ src/Datatype/AM/DocImages.php | 29 + {DHL => src}/Datatype/AM/Dutiable.php | 69 +-- .../Datatype/EA => src/Datatype/AM}/Email.php | 53 +- src/Datatype/AM/ErrorResponse.php | 34 ++ src/Datatype/AM/EventRemarks.php | 36 ++ .../Datatype/AM}/ExportDeclaration.php | 73 +-- .../AP => src/Datatype/AM}/ExportLineItem.php | 77 +-- src/Datatype/AM/Fault.php | 29 + .../Datatype/GB => src/Datatype/AM}/Label.php | 45 +- src/Datatype/AM/LabelImage.php | 42 ++ src/Datatype/AM/Note.php | 34 ++ src/Datatype/AM/OriginServiceArea.php | 43 ++ .../Datatype/EA => src/Datatype/AM}/Piece.php | 61 +-- .../EA => src/Datatype/AM}/PieceDetails.php | 89 ++- src/Datatype/AM/PieceEvent.php | 49 ++ src/Datatype/AM/PieceFault.php | 42 ++ src/Datatype/AM/PieceInfo.php | 34 ++ src/Datatype/AM/PieceType.php | 60 +++ src/Datatype/AM/Pieces.php | 29 + {DHL => src}/Datatype/AM/Place.php | 61 +-- .../EA => src/Datatype/AM}/QtdSInAdCur.php | 45 +- src/Datatype/AM/QtdShpExChrgType.php | 40 ++ src/Datatype/AM/QtdShpType.php | 45 ++ src/Datatype/AM/Reference.php | 38 ++ src/Datatype/AM/Request.php | 29 + src/Datatype/AM/Response.php | 29 + src/Datatype/AM/ServiceArea.php | 36 ++ .../EA => src/Datatype/AM}/ServiceEvent.php | 16 +- .../AP => src/Datatype/AM}/ServiceHeader.php | 45 +- .../Datatype/AM}/ShipValResponsePiece.php | 73 +-- src/Datatype/AM/ShipValResponsePieces.php | 29 + .../AP => src/Datatype/AM}/Shipment.php | 93 ++-- src/Datatype/AM/ShipmentDate.php | 36 ++ {DHL => src}/Datatype/AM/ShipmentDetails.php | 97 ++-- src/Datatype/AM/ShipmentEvent.php | 54 ++ {DHL => src}/Datatype/AM/ShipmentInfo.php | 93 ++-- .../AP => src/Datatype/AM}/Shipper.php | 89 ++- {DHL => src}/Datatype/AM/SpecialService.php | 57 +- src/Datatype/AM/Status.php | 34 ++ src/Datatype/AM/TrackingPieces.php | 29 + src/Datatype/AM/WeightSeg.php | 41 ++ .../Datatype/AP}/ShipmentDetails.php | 104 ++-- {DHL => src}/Datatype/Base.php | 359 +++++-------- src/Datatype/EA/Label.php | 47 ++ .../Datatype/EA}/ShipmentDetails.php | 104 ++-- {DHL => src}/Datatype/EA/ShipmentInfo.php | 104 ++-- {DHL => src}/Datatype/EA/SpecialService.php | 65 +-- src/Datatype/GB/AWBInfo.php | 41 ++ src/Datatype/GB/AdditionalProtection.php | 41 ++ src/Datatype/GB/BarCode.php | 32 ++ src/Datatype/GB/BarCodes.php | 42 ++ src/Datatype/GB/Billing.php | 55 ++ src/Datatype/GB/ChargeCard.php | 48 ++ {DHL => src}/Datatype/GB/Consignee.php | 89 ++- src/Datatype/GB/Contact.php | 60 +++ src/Datatype/GB/DestinationServiceArea.php | 44 ++ {DHL => src}/Datatype/GB/Dutiable.php | 88 ++- .../Datatype/GB/ExportDeclaration.php | 85 +-- {DHL => src}/Datatype/GB/ExportLineItem.php | 89 ++- {DHL => src}/Datatype/GB/Filing.php | 26 +- {DHL => src}/Datatype/GB/Notification.php | 16 +- src/Datatype/GB/OriginServiceArea.php | 38 ++ {DHL => src}/Datatype/GB/Piece.php | 72 +-- {DHL => src}/Datatype/GB/PieceDetails.php | 69 +-- .../AM => src/Datatype/GB}/PieceEvent.php | 30 +- src/Datatype/GB/PieceFault.php | 37 ++ src/Datatype/GB/Pieces.php | 24 + {DHL => src}/Datatype/GB/Place.php | 77 +-- src/Datatype/GB/QtdSInAdCur.php | 50 ++ {DHL => src}/Datatype/GB/Requestor.php | 44 +- src/Datatype/GB/Response.php | 23 + src/Datatype/GB/ResponseServiceHeader.php | 46 ++ .../Datatype/GB/ShipValResponsePiece.php | 87 ++- {DHL => src}/Datatype/GB/Shipment.php | 105 ++-- src/Datatype/GB/ShipmentDate.php | 32 ++ {DHL => src}/Datatype/GB/ShipmentDetails.php | 102 ++-- src/Datatype/GB/ShipmentEvent.php | 44 ++ src/Datatype/GB/ShipmentInfo.php | 76 +++ {DHL => src}/Datatype/GB/Shipper.php | 99 ++-- {DHL => src}/Datatype/GB/SpecialService.php | 69 +-- src/Datatype/GB/WeightSeg.php | 37 ++ src/Entity/AM/BookPickupRequest.php | 73 +++ src/Entity/AM/CancelPickupRequest.php | 65 +++ src/Entity/AM/DCTRequest.php | 45 ++ src/Entity/AM/ErrorResponse.php | 43 ++ src/Entity/AM/GetCapability.php | 66 +++ src/Entity/AM/GetQuote.php | 66 +++ .../Entity/AM/KnownTrackingRequest.php | 63 +-- src/Entity/AM/ModifyPickupRequest.php | 71 +++ src/Entity/AM/PickupErrorResponse.php | 43 ++ .../EA => src/Entity/AM}/PickupResponse.php | 87 ++- src/Entity/AM/RoutingErrorResponse.php | 43 ++ {DHL => src}/Entity/AM/RoutingRequest.php | 79 ++- src/Entity/AM/RoutingResponse.php | 67 +++ src/Entity/AM/ShipmentBookRatingRequest.php | 58 ++ src/Entity/AM/ShipmentCustRatingRequest.php | 63 +++ src/Entity/AM/ShipmentRatingErrorResponse.php | 43 ++ .../Entity/AM/ShipmentRatingResponse.php | 115 ++-- .../AM/ShipmentTrackingErrorResponse.php | 43 ++ .../AM/ShipmentValidateErrorResponse.php | 43 ++ .../Entity/AM/ShipmentValidateRequest.php | 119 ++-- .../Entity/AM/ShipmentValidateResponse.php | 251 ++++----- src/Entity/AM/TrackingResponse.php | 59 ++ src/Entity/AM/UnknownTrackingRequest.php | 69 +++ src/Entity/AP/BookPickupRequest.php | 63 +++ src/Entity/AP/CancelPickupRequest.php | 72 +++ src/Entity/AP/ModifyPickupRequest.php | 71 +++ .../Entity/AP/ShipmentValidateRequest.php | 107 ++-- .../Entity/AP/ShipmentValidateResponse.php | 245 ++++----- src/Entity/Base.php | 303 +++++++++++ src/Entity/EA/BookPickupRequest.php | 63 +++ src/Entity/EA/CancelPickupRequest.php | 77 +++ {DHL => src}/Entity/EA/RoutingRequest.php | 79 ++- .../Entity/EA/ShipmentValidateRequest.php | 115 ++-- .../Entity/EA/ShipmentValidateResponse.php | 221 ++++---- src/Entity/GB/BookPURequest.php | 72 +++ {DHL => src}/Entity/GB/BookPUResponse.php | 91 ++-- {DHL => src}/Entity/GB/CancelPURequest.php | 71 +-- {DHL => src}/Entity/GB/CancelPUResponse.php | 91 ++-- .../Entity/GB/KnownTrackingRequest.php | 63 +-- src/Entity/GB/ModifyPURequest.php | 80 +++ {DHL => src}/Entity/GB/ModifyPUResponse.php | 91 ++-- {DHL => src}/Entity/GB/RouteRequest.php | 85 ++- src/Entity/GB/RouteResponse.php | 67 +++ {DHL => src}/Entity/GB/ShipmentRequest.php | 139 ++--- {DHL => src}/Entity/GB/ShipmentResponse.php | 235 ++++---- src/Entity/GB/TrackingResponse.php | 60 +++ src/Entity/GB/UnknownTrackingRequest.php | 69 +++ src/Service.php | 59 ++ vendor/autoloadManager/README.md | 124 ----- vendor/autoloadManager/autoloadManager.php | 508 ------------------ 369 files changed, 6407 insertions(+), 20179 deletions(-) delete mode 100644 DHL/Datatype/AM/AWBInfo.php delete mode 100644 DHL/Datatype/AM/BarCodes.php delete mode 100644 DHL/Datatype/AM/Billing.php delete mode 100644 DHL/Datatype/AM/Commodity.php delete mode 100644 DHL/Datatype/AM/Condition.php delete mode 100644 DHL/Datatype/AM/Consignee.php delete mode 100644 DHL/Datatype/AM/Customer.php delete mode 100644 DHL/Datatype/AM/CustomerLogo.php delete mode 100644 DHL/Datatype/AM/DCTDutiable.php delete mode 100644 DHL/Datatype/AM/DCTFrom.php delete mode 100644 DHL/Datatype/AM/DCTTo.php delete mode 100644 DHL/Datatype/AM/DestinationServiceArea.php delete mode 100644 DHL/Datatype/AM/DocImage.php delete mode 100644 DHL/Datatype/AM/DocImages.php delete mode 100644 DHL/Datatype/AM/Email.php delete mode 100644 DHL/Datatype/AM/ErrorResponse.php delete mode 100644 DHL/Datatype/AM/EventRemarks.php delete mode 100644 DHL/Datatype/AM/ExportDeclaration.php delete mode 100644 DHL/Datatype/AM/ExportLineItem.php delete mode 100644 DHL/Datatype/AM/Fault.php delete mode 100644 DHL/Datatype/AM/Label.php delete mode 100644 DHL/Datatype/AM/LabelImage.php delete mode 100644 DHL/Datatype/AM/Note.php delete mode 100644 DHL/Datatype/AM/OriginServiceArea.php delete mode 100644 DHL/Datatype/AM/Piece.php delete mode 100644 DHL/Datatype/AM/PieceDetails.php delete mode 100644 DHL/Datatype/AM/PieceFault.php delete mode 100644 DHL/Datatype/AM/PieceInfo.php delete mode 100644 DHL/Datatype/AM/PieceType.php delete mode 100644 DHL/Datatype/AM/Pieces.php delete mode 100644 DHL/Datatype/AM/QtdSInAdCur.php delete mode 100644 DHL/Datatype/AM/QtdShpExChrgType.php delete mode 100644 DHL/Datatype/AM/QtdShpType.php delete mode 100644 DHL/Datatype/AM/Reference.php delete mode 100644 DHL/Datatype/AM/Request.php delete mode 100644 DHL/Datatype/AM/Response.php delete mode 100644 DHL/Datatype/AM/ServiceArea.php delete mode 100644 DHL/Datatype/AM/ServiceEvent.php delete mode 100644 DHL/Datatype/AM/ServiceHeader.php delete mode 100644 DHL/Datatype/AM/ShipValResponsePiece.php delete mode 100644 DHL/Datatype/AM/ShipValResponsePieces.php delete mode 100644 DHL/Datatype/AM/Shipment.php delete mode 100644 DHL/Datatype/AM/ShipmentDate.php delete mode 100644 DHL/Datatype/AM/ShipmentEvent.php delete mode 100644 DHL/Datatype/AM/Shipper.php delete mode 100644 DHL/Datatype/AM/Status.php delete mode 100644 DHL/Datatype/AM/TrackingPieces.php delete mode 100644 DHL/Datatype/AM/WeightSeg.php delete mode 100644 DHL/Datatype/AP/AWBInfo.php delete mode 100644 DHL/Datatype/AP/BarCodes.php delete mode 100644 DHL/Datatype/AP/Billing.php delete mode 100644 DHL/Datatype/AP/ChargeCard.php delete mode 100644 DHL/Datatype/AP/Commodity.php delete mode 100644 DHL/Datatype/AP/Condition.php delete mode 100644 DHL/Datatype/AP/Contact.php delete mode 100644 DHL/Datatype/AP/Customer.php delete mode 100644 DHL/Datatype/AP/CustomerLogo.php delete mode 100644 DHL/Datatype/AP/DestinationServiceArea.php delete mode 100644 DHL/Datatype/AP/DocImage.php delete mode 100644 DHL/Datatype/AP/DocImages.php delete mode 100644 DHL/Datatype/AP/Dutiable.php delete mode 100644 DHL/Datatype/AP/Email.php delete mode 100644 DHL/Datatype/AP/ErrorResponse.php delete mode 100644 DHL/Datatype/AP/EventRemarks.php delete mode 100644 DHL/Datatype/AP/ExportDeclaration.php delete mode 100644 DHL/Datatype/AP/Fault.php delete mode 100644 DHL/Datatype/AP/Label.php delete mode 100644 DHL/Datatype/AP/LabelImage.php delete mode 100644 DHL/Datatype/AP/Note.php delete mode 100644 DHL/Datatype/AP/OriginServiceArea.php delete mode 100644 DHL/Datatype/AP/Piece.php delete mode 100644 DHL/Datatype/AP/PieceDetails.php delete mode 100644 DHL/Datatype/AP/PieceEvent.php delete mode 100644 DHL/Datatype/AP/PieceFault.php delete mode 100644 DHL/Datatype/AP/PieceInfo.php delete mode 100644 DHL/Datatype/AP/Pieces.php delete mode 100644 DHL/Datatype/AP/Place.php delete mode 100644 DHL/Datatype/AP/QtdSInAdCur.php delete mode 100644 DHL/Datatype/AP/Reference.php delete mode 100644 DHL/Datatype/AP/Request.php delete mode 100644 DHL/Datatype/AP/Response.php delete mode 100644 DHL/Datatype/AP/ServiceArea.php delete mode 100644 DHL/Datatype/AP/ServiceEvent.php delete mode 100644 DHL/Datatype/AP/ShipValResponsePieces.php delete mode 100644 DHL/Datatype/AP/ShipmentDate.php delete mode 100644 DHL/Datatype/AP/ShipmentEvent.php delete mode 100644 DHL/Datatype/AP/ShipmentInfo.php delete mode 100644 DHL/Datatype/AP/SpecialService.php delete mode 100644 DHL/Datatype/AP/Status.php delete mode 100644 DHL/Datatype/AP/TrackingPieces.php delete mode 100644 DHL/Datatype/AP/WeightSeg.php delete mode 100644 DHL/Datatype/EA/AWBInfo.php delete mode 100644 DHL/Datatype/EA/BarCodes.php delete mode 100644 DHL/Datatype/EA/ChargeCard.php delete mode 100644 DHL/Datatype/EA/Commodity.php delete mode 100644 DHL/Datatype/EA/Condition.php delete mode 100644 DHL/Datatype/EA/Consignee.php delete mode 100644 DHL/Datatype/EA/Contact.php delete mode 100644 DHL/Datatype/EA/Customer.php delete mode 100644 DHL/Datatype/EA/CustomerLogo.php delete mode 100644 DHL/Datatype/EA/DestinationServiceArea.php delete mode 100644 DHL/Datatype/EA/DocImage.php delete mode 100644 DHL/Datatype/EA/DocImages.php delete mode 100644 DHL/Datatype/EA/Dutiable.php delete mode 100644 DHL/Datatype/EA/ErrorResponse.php delete mode 100644 DHL/Datatype/EA/EventRemarks.php delete mode 100644 DHL/Datatype/EA/ExportLineItem.php delete mode 100644 DHL/Datatype/EA/Fault.php delete mode 100644 DHL/Datatype/EA/Label.php delete mode 100644 DHL/Datatype/EA/LabelImage.php delete mode 100644 DHL/Datatype/EA/Note.php delete mode 100644 DHL/Datatype/EA/OriginServiceArea.php delete mode 100644 DHL/Datatype/EA/PieceEvent.php delete mode 100644 DHL/Datatype/EA/PieceFault.php delete mode 100644 DHL/Datatype/EA/PieceInfo.php delete mode 100644 DHL/Datatype/EA/Pieces.php delete mode 100644 DHL/Datatype/EA/Place.php delete mode 100644 DHL/Datatype/EA/Reference.php delete mode 100644 DHL/Datatype/EA/Request.php delete mode 100644 DHL/Datatype/EA/Response.php delete mode 100644 DHL/Datatype/EA/ServiceArea.php delete mode 100644 DHL/Datatype/EA/ServiceHeader.php delete mode 100644 DHL/Datatype/EA/ShipValResponsePiece.php delete mode 100644 DHL/Datatype/EA/ShipValResponsePieces.php delete mode 100644 DHL/Datatype/EA/Shipment.php delete mode 100644 DHL/Datatype/EA/ShipmentDate.php delete mode 100644 DHL/Datatype/EA/ShipmentEvent.php delete mode 100644 DHL/Datatype/EA/Shipper.php delete mode 100644 DHL/Datatype/EA/Status.php delete mode 100644 DHL/Datatype/EA/TrackingPieces.php delete mode 100644 DHL/Datatype/EA/WeightSeg.php delete mode 100644 DHL/Datatype/GB/AWBInfo.php delete mode 100644 DHL/Datatype/GB/AdditionalProtection.php delete mode 100644 DHL/Datatype/GB/BarCode.php delete mode 100644 DHL/Datatype/GB/BarCodes.php delete mode 100644 DHL/Datatype/GB/Billing.php delete mode 100644 DHL/Datatype/GB/ChargeCard.php delete mode 100644 DHL/Datatype/GB/Commodity.php delete mode 100644 DHL/Datatype/GB/Condition.php delete mode 100644 DHL/Datatype/GB/Contact.php delete mode 100644 DHL/Datatype/GB/Customer.php delete mode 100644 DHL/Datatype/GB/CustomerLogo.php delete mode 100644 DHL/Datatype/GB/DestinationServiceArea.php delete mode 100644 DHL/Datatype/GB/DocImage.php delete mode 100644 DHL/Datatype/GB/ErrorResponse.php delete mode 100644 DHL/Datatype/GB/Fault.php delete mode 100644 DHL/Datatype/GB/LabelImage.php delete mode 100644 DHL/Datatype/GB/Note.php delete mode 100644 DHL/Datatype/GB/OriginServiceArea.php delete mode 100644 DHL/Datatype/GB/PieceEvent.php delete mode 100644 DHL/Datatype/GB/PieceFault.php delete mode 100644 DHL/Datatype/GB/PieceInfo.php delete mode 100644 DHL/Datatype/GB/Pieces.php delete mode 100644 DHL/Datatype/GB/QtdSInAdCur.php delete mode 100644 DHL/Datatype/GB/Reference.php delete mode 100644 DHL/Datatype/GB/Request.php delete mode 100644 DHL/Datatype/GB/Response.php delete mode 100644 DHL/Datatype/GB/ResponseServiceHeader.php delete mode 100644 DHL/Datatype/GB/ServiceArea.php delete mode 100644 DHL/Datatype/GB/ServiceEvent.php delete mode 100644 DHL/Datatype/GB/ServiceHeader.php delete mode 100644 DHL/Datatype/GB/ShipValResponsePieces.php delete mode 100644 DHL/Datatype/GB/ShipmentDate.php delete mode 100644 DHL/Datatype/GB/ShipmentEvent.php delete mode 100644 DHL/Datatype/GB/ShipmentInfo.php delete mode 100644 DHL/Datatype/GB/Status.php delete mode 100644 DHL/Datatype/GB/TrackingPieces.php delete mode 100644 DHL/Datatype/GB/WeightSeg.php delete mode 100644 DHL/Entity/AM/BookPickupRequest.php delete mode 100644 DHL/Entity/AM/CancelPickupRequest.php delete mode 100644 DHL/Entity/AM/DCTRequest.php delete mode 100644 DHL/Entity/AM/ErrorResponse.php delete mode 100644 DHL/Entity/AM/GetCapability.php delete mode 100644 DHL/Entity/AM/GetQuote.php delete mode 100644 DHL/Entity/AM/ModifyPickupRequest.php delete mode 100644 DHL/Entity/AM/PickupErrorResponse.php delete mode 100644 DHL/Entity/AM/PickupResponse.php delete mode 100644 DHL/Entity/AM/RoutingErrorResponse.php delete mode 100644 DHL/Entity/AM/RoutingResponse.php delete mode 100644 DHL/Entity/AM/ShipmentBookRatingRequest.php delete mode 100644 DHL/Entity/AM/ShipmentCustRatingRequest.php delete mode 100644 DHL/Entity/AM/ShipmentRatingErrorResponse.php delete mode 100644 DHL/Entity/AM/ShipmentTrackingErrorResponse.php delete mode 100644 DHL/Entity/AM/ShipmentValidateErrorResponse.php delete mode 100644 DHL/Entity/AM/TrackingResponse.php delete mode 100644 DHL/Entity/AM/UnknownTrackingRequest.php delete mode 100644 DHL/Entity/AP/BookPickupRequest.php delete mode 100644 DHL/Entity/AP/CancelPickupRequest.php delete mode 100644 DHL/Entity/AP/ErrorResponse.php delete mode 100644 DHL/Entity/AP/KnownTrackingRequest.php delete mode 100644 DHL/Entity/AP/ModifyPickupRequest.php delete mode 100644 DHL/Entity/AP/PickupErrorResponse.php delete mode 100644 DHL/Entity/AP/PickupResponse.php delete mode 100644 DHL/Entity/AP/RoutingErrorResponse.php delete mode 100644 DHL/Entity/AP/RoutingRequest.php delete mode 100644 DHL/Entity/AP/RoutingResponse.php delete mode 100644 DHL/Entity/AP/ShipmentTrackingErrorResponse.php delete mode 100644 DHL/Entity/AP/ShipmentValidateErrorResponse.php delete mode 100644 DHL/Entity/AP/TrackingResponse.php delete mode 100644 DHL/Entity/AP/UnknownTrackingRequest.php delete mode 100644 DHL/Entity/Base.php delete mode 100644 DHL/Entity/EA/BookPickupRequest.php delete mode 100644 DHL/Entity/EA/CancelPickupRequest.php delete mode 100644 DHL/Entity/EA/ErrorResponse.php delete mode 100644 DHL/Entity/EA/KnownTrackingRequest.php delete mode 100644 DHL/Entity/EA/PickupErrorResponse.php delete mode 100644 DHL/Entity/EA/RoutingErrorResponse.php delete mode 100644 DHL/Entity/EA/RoutingResponse.php delete mode 100644 DHL/Entity/EA/ShipmentTrackingErrorResponse.php delete mode 100644 DHL/Entity/EA/ShipmentValidateErrorResponse.php delete mode 100644 DHL/Entity/EA/TrackingResponse.php delete mode 100644 DHL/Entity/EA/UnknownTrackingRequest.php delete mode 100644 DHL/Entity/GB/BookPURequest.php delete mode 100644 DHL/Entity/GB/ModifyPURequest.php delete mode 100644 DHL/Entity/GB/RouteResponse.php delete mode 100644 DHL/Entity/GB/TrackingResponse.php delete mode 100644 DHL/Entity/GB/UnknownTrackingRequest.php delete mode 100644 DHL/Service.php delete mode 100644 conf/config.sample.php create mode 100644 config/dhl.php rename {DHL => src}/Client/Web.php (59%) create mode 100644 src/Datatype/AM/AWBInfo.php create mode 100644 src/Datatype/AM/BarCodes.php rename {DHL/Datatype/EA => src/Datatype/AM}/Billing.php (58%) rename {DHL => src}/Datatype/AM/BkgDetailsType.php (56%) rename {DHL => src}/Datatype/AM/ChargeCard.php (54%) create mode 100644 src/Datatype/AM/Commodity.php create mode 100644 src/Datatype/AM/Condition.php rename {DHL/Datatype/AP => src/Datatype/AM}/Consignee.php (59%) rename {DHL => src}/Datatype/AM/Contact.php (52%) create mode 100644 src/Datatype/AM/Customer.php create mode 100644 src/Datatype/AM/CustomerLogo.php create mode 100644 src/Datatype/AM/DCTDutiable.php create mode 100644 src/Datatype/AM/DCTFrom.php create mode 100644 src/Datatype/AM/DCTTo.php create mode 100644 src/Datatype/AM/DestinationServiceArea.php create mode 100644 src/Datatype/AM/DocImage.php create mode 100644 src/Datatype/AM/DocImages.php rename {DHL => src}/Datatype/AM/Dutiable.php (54%) rename {DHL/Datatype/EA => src/Datatype/AM}/Email.php (53%) create mode 100644 src/Datatype/AM/ErrorResponse.php create mode 100644 src/Datatype/AM/EventRemarks.php rename {DHL/Datatype/EA => src/Datatype/AM}/ExportDeclaration.php (60%) rename {DHL/Datatype/AP => src/Datatype/AM}/ExportLineItem.php (63%) create mode 100644 src/Datatype/AM/Fault.php rename {DHL/Datatype/GB => src/Datatype/AM}/Label.php (51%) create mode 100644 src/Datatype/AM/LabelImage.php create mode 100644 src/Datatype/AM/Note.php create mode 100644 src/Datatype/AM/OriginServiceArea.php rename {DHL/Datatype/EA => src/Datatype/AM}/Piece.php (59%) rename {DHL/Datatype/EA => src/Datatype/AM}/PieceDetails.php (58%) create mode 100644 src/Datatype/AM/PieceEvent.php create mode 100644 src/Datatype/AM/PieceFault.php create mode 100644 src/Datatype/AM/PieceInfo.php create mode 100644 src/Datatype/AM/PieceType.php create mode 100644 src/Datatype/AM/Pieces.php rename {DHL => src}/Datatype/AM/Place.php (61%) rename {DHL/Datatype/EA => src/Datatype/AM}/QtdSInAdCur.php (52%) create mode 100644 src/Datatype/AM/QtdShpExChrgType.php create mode 100644 src/Datatype/AM/QtdShpType.php create mode 100644 src/Datatype/AM/Reference.php create mode 100644 src/Datatype/AM/Request.php create mode 100644 src/Datatype/AM/Response.php create mode 100644 src/Datatype/AM/ServiceArea.php rename {DHL/Datatype/EA => src/Datatype/AM}/ServiceEvent.php (87%) rename {DHL/Datatype/AP => src/Datatype/AM}/ServiceHeader.php (51%) rename {DHL/Datatype/AP => src/Datatype/AM}/ShipValResponsePiece.php (62%) create mode 100644 src/Datatype/AM/ShipValResponsePieces.php rename {DHL/Datatype/AP => src/Datatype/AM}/Shipment.php (68%) create mode 100644 src/Datatype/AM/ShipmentDate.php rename {DHL => src}/Datatype/AM/ShipmentDetails.php (74%) create mode 100644 src/Datatype/AM/ShipmentEvent.php rename {DHL => src}/Datatype/AM/ShipmentInfo.php (58%) rename {DHL/Datatype/AP => src/Datatype/AM}/Shipper.php (64%) rename {DHL => src}/Datatype/AM/SpecialService.php (60%) create mode 100644 src/Datatype/AM/Status.php create mode 100644 src/Datatype/AM/TrackingPieces.php create mode 100644 src/Datatype/AM/WeightSeg.php rename {DHL/Datatype/EA => src/Datatype/AP}/ShipmentDetails.php (71%) rename {DHL => src}/Datatype/Base.php (60%) create mode 100644 src/Datatype/EA/Label.php rename {DHL/Datatype/AP => src/Datatype/EA}/ShipmentDetails.php (71%) rename {DHL => src}/Datatype/EA/ShipmentInfo.php (54%) rename {DHL => src}/Datatype/EA/SpecialService.php (51%) create mode 100644 src/Datatype/GB/AWBInfo.php create mode 100644 src/Datatype/GB/AdditionalProtection.php create mode 100644 src/Datatype/GB/BarCode.php create mode 100644 src/Datatype/GB/BarCodes.php create mode 100644 src/Datatype/GB/Billing.php create mode 100644 src/Datatype/GB/ChargeCard.php rename {DHL => src}/Datatype/GB/Consignee.php (55%) create mode 100644 src/Datatype/GB/Contact.php create mode 100644 src/Datatype/GB/DestinationServiceArea.php rename {DHL => src}/Datatype/GB/Dutiable.php (55%) rename {DHL => src}/Datatype/GB/ExportDeclaration.php (56%) rename {DHL => src}/Datatype/GB/ExportLineItem.php (56%) rename {DHL => src}/Datatype/GB/Filing.php (81%) rename {DHL => src}/Datatype/GB/Notification.php (88%) create mode 100644 src/Datatype/GB/OriginServiceArea.php rename {DHL => src}/Datatype/GB/Piece.php (57%) rename {DHL => src}/Datatype/GB/PieceDetails.php (52%) rename {DHL/Datatype/AM => src/Datatype/GB}/PieceEvent.php (81%) create mode 100644 src/Datatype/GB/PieceFault.php create mode 100644 src/Datatype/GB/Pieces.php rename {DHL => src}/Datatype/GB/Place.php (57%) create mode 100644 src/Datatype/GB/QtdSInAdCur.php rename {DHL => src}/Datatype/GB/Requestor.php (85%) create mode 100644 src/Datatype/GB/Response.php create mode 100644 src/Datatype/GB/ResponseServiceHeader.php rename {DHL => src}/Datatype/GB/ShipValResponsePiece.php (59%) rename {DHL => src}/Datatype/GB/Shipment.php (65%) create mode 100644 src/Datatype/GB/ShipmentDate.php rename {DHL => src}/Datatype/GB/ShipmentDetails.php (71%) create mode 100644 src/Datatype/GB/ShipmentEvent.php create mode 100644 src/Datatype/GB/ShipmentInfo.php rename {DHL => src}/Datatype/GB/Shipper.php (64%) rename {DHL => src}/Datatype/GB/SpecialService.php (54%) create mode 100644 src/Datatype/GB/WeightSeg.php create mode 100644 src/Entity/AM/BookPickupRequest.php create mode 100644 src/Entity/AM/CancelPickupRequest.php create mode 100644 src/Entity/AM/DCTRequest.php create mode 100644 src/Entity/AM/ErrorResponse.php create mode 100644 src/Entity/AM/GetCapability.php create mode 100644 src/Entity/AM/GetQuote.php rename {DHL => src}/Entity/AM/KnownTrackingRequest.php (50%) create mode 100644 src/Entity/AM/ModifyPickupRequest.php create mode 100644 src/Entity/AM/PickupErrorResponse.php rename {DHL/Entity/EA => src/Entity/AM}/PickupResponse.php (53%) create mode 100644 src/Entity/AM/RoutingErrorResponse.php rename {DHL => src}/Entity/AM/RoutingRequest.php (55%) create mode 100644 src/Entity/AM/RoutingResponse.php create mode 100644 src/Entity/AM/ShipmentBookRatingRequest.php create mode 100644 src/Entity/AM/ShipmentCustRatingRequest.php create mode 100644 src/Entity/AM/ShipmentRatingErrorResponse.php rename {DHL => src}/Entity/AM/ShipmentRatingResponse.php (58%) create mode 100644 src/Entity/AM/ShipmentTrackingErrorResponse.php create mode 100644 src/Entity/AM/ShipmentValidateErrorResponse.php rename {DHL => src}/Entity/AM/ShipmentValidateRequest.php (57%) rename {DHL => src}/Entity/AM/ShipmentValidateResponse.php (65%) create mode 100644 src/Entity/AM/TrackingResponse.php create mode 100644 src/Entity/AM/UnknownTrackingRequest.php create mode 100644 src/Entity/AP/BookPickupRequest.php create mode 100644 src/Entity/AP/CancelPickupRequest.php create mode 100644 src/Entity/AP/ModifyPickupRequest.php rename {DHL => src}/Entity/AP/ShipmentValidateRequest.php (56%) rename {DHL => src}/Entity/AP/ShipmentValidateResponse.php (63%) create mode 100644 src/Entity/Base.php create mode 100644 src/Entity/EA/BookPickupRequest.php create mode 100644 src/Entity/EA/CancelPickupRequest.php rename {DHL => src}/Entity/EA/RoutingRequest.php (55%) rename {DHL => src}/Entity/EA/ShipmentValidateRequest.php (57%) rename {DHL => src}/Entity/EA/ShipmentValidateResponse.php (62%) create mode 100644 src/Entity/GB/BookPURequest.php rename {DHL => src}/Entity/GB/BookPUResponse.php (56%) rename {DHL => src}/Entity/GB/CancelPURequest.php (54%) rename {DHL => src}/Entity/GB/CancelPUResponse.php (56%) rename {DHL => src}/Entity/GB/KnownTrackingRequest.php (51%) create mode 100644 src/Entity/GB/ModifyPURequest.php rename {DHL => src}/Entity/GB/ModifyPUResponse.php (56%) rename {DHL => src}/Entity/GB/RouteRequest.php (58%) create mode 100644 src/Entity/GB/RouteResponse.php rename {DHL => src}/Entity/GB/ShipmentRequest.php (60%) rename {DHL => src}/Entity/GB/ShipmentResponse.php (66%) create mode 100644 src/Entity/GB/TrackingResponse.php create mode 100644 src/Entity/GB/UnknownTrackingRequest.php create mode 100644 src/Service.php delete mode 100644 vendor/autoloadManager/README.md delete mode 100644 vendor/autoloadManager/autoloadManager.php 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/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/Shipper.php b/DHL/Datatype/AM/Shipper.php deleted file mode 100644 index 0ad682f..0000000 --- a/DHL/Datatype/AM/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/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/Piece.php b/DHL/Datatype/AP/Piece.php deleted file mode 100644 index a5ef6e1..0000000 --- a/DHL/Datatype/AP/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/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/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/ShipmentInfo.php b/DHL/Datatype/AP/ShipmentInfo.php deleted file mode 100644 index 4908487..0000000 --- a/DHL/Datatype/AP/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/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/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/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/Contact.php b/DHL/Datatype/GB/Contact.php deleted file mode 100644 index d657f3a..0000000 --- a/DHL/Datatype/GB/Contact.php +++ /dev/null @@ -1,87 +0,0 @@ - array( - 'type' => 'PersonName', - 'required' => false, - 'subobject' => false, - 'comment' => 'Name', - 'maxLength' => '35', - ), - 'PhoneNumber' => array( - 'type' => 'PhoneNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'Phone Number', - 'maxLength' => '25', - ), - 'PhoneExtension' => array( - 'type' => 'PhoneExtension', - 'required' => false, - 'subobject' => false, - 'comment' => '', - 'maxLength' => '5', - ), - 'FaxNumber' => array( - 'type' => 'PhoneNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'Phone Number', - 'maxLength' => '25', - ), - 'Telex' => array( - 'type' => 'Telex', - 'required' => false, - 'subobject' => false, - 'comment' => 'Telex number and answer back code', - 'maxLength' => '25', - ), - 'Email' => array( - 'type' => 'EmailAddress', - 'required' => false, - 'subobject' => false, - 'comment' => 'Email address containing \'@\'', - 'maxLength' => '50', - ), - ); -} 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/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/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/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/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/composer.json b/composer.json index d495a1a..c2537dc 100644 --- a/composer.json +++ b/composer.json @@ -1,22 +1,19 @@ { - "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.3" }, - - "license": "LGPL-2.1", - - "autoload": { - "classmap" : [ "DHL" ] - }, - - "authors": [ + "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/config/dhl.php b/config/dhl.php new file mode 100644 index 0000000..25058db --- /dev/null +++ b/config/dhl.php @@ -0,0 +1,5 @@ +_mode = $mode; @@ -65,32 +42,27 @@ public function __construct($mode = 'staging') /** * Call DHL Service - * + * * @param Request $request Request to send - * + * * @return string DHL XML response string */ public function call(Request $request) { - if (!$ch = curl_init()) - { + 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_PORT, 443); curl_setopt($ch, CURLOPT_POSTFIELDS, $request->toXML()); $result = curl_exec($ch); - - if (curl_error($ch)) - { + + if (curl_error($ch)) { return false; - } - else - { + } else { curl_close($ch); } @@ -99,7 +71,7 @@ public function call(Request $request) /** * Get url associated to a specific service - * + * * @return string URL for the service */ private function _getUrl() diff --git a/src/Datatype/AM/AWBInfo.php b/src/Datatype/AM/AWBInfo.php new file mode 100644 index 0000000..b34716b --- /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..dd844d4 --- /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 58% rename from DHL/Datatype/EA/Billing.php rename to src/Datatype/AM/Billing.php index a2df114..2a0ea8e 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 56% rename from DHL/Datatype/AM/BkgDetailsType.php rename to src/Datatype/AM/BkgDetailsType.php index e635d9a..d8f614e 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 54% rename from DHL/Datatype/AM/ChargeCard.php rename to src/Datatype/AM/ChargeCard.php index f96584a..1540589 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..665c8a7 --- /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..8ebec51 --- /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 59% rename from DHL/Datatype/AP/Consignee.php rename to src/Datatype/AM/Consignee.php index e5d9da8..72db432 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, - ), - ); + ], + ]; } diff --git a/DHL/Datatype/AM/Contact.php b/src/Datatype/AM/Contact.php similarity index 52% rename from DHL/Datatype/AM/Contact.php rename to src/Datatype/AM/Contact.php index 9bfb0b5..d1fea09 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..4e99425 --- /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..bfdbf4b --- /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..2baaee0 --- /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..ffaf9af --- /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..322c24d --- /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..0779433 --- /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..52332ed --- /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..fa5dd9f --- /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 54% rename from DHL/Datatype/AM/Dutiable.php rename to src/Datatype/AM/Dutiable.php index d8a466e..2ef49aa 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 53% rename from DHL/Datatype/EA/Email.php rename to src/Datatype/AM/Email.php index b9e1836..a2de847 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..3d8d052 --- /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..f8a3f1b --- /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 60% rename from DHL/Datatype/EA/ExportDeclaration.php rename to src/Datatype/AM/ExportDeclaration.php index 37b69cf..73121c0 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 63% rename from DHL/Datatype/AP/ExportLineItem.php rename to src/Datatype/AM/ExportLineItem.php index 487769c..26908d4 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..9a2458b --- /dev/null +++ b/src/Datatype/AM/Fault.php @@ -0,0 +1,29 @@ + [ + 'type' => 'PieceFault', + 'required' => true, + 'subobject' => true, + ], + ]; +} diff --git a/DHL/Datatype/GB/Label.php b/src/Datatype/AM/Label.php similarity index 51% rename from DHL/Datatype/GB/Label.php rename to src/Datatype/AM/Label.php index 4f514c5..f8f7ebf 100644 --- a/DHL/Datatype/GB/Label.php +++ b/src/Datatype/AM/Label.php @@ -1,29 +1,8 @@ array( + protected $params = [ + 'LabelTemplate' => [ '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( + ], + 'Logo' => [ 'type' => 'YesNo', 'required' => false, 'subobject' => false, 'comment' => 'Boolean flag', 'length' => '1', 'enumeration' => 'Y,N', - ), - 'CustomerLogo' => array( + ], + 'CustomerLogo' => [ 'type' => 'CustomerLogo', 'required' => false, 'subobject' => true, - ), - 'Resolution' => array( + ], + '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..fd88390 --- /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..beed3e5 --- /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..52ecfa2 --- /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/EA/Piece.php b/src/Datatype/AM/Piece.php similarity index 59% rename from DHL/Datatype/EA/Piece.php rename to src/Datatype/AM/Piece.php index 94d8ff8..3be838a 100644 --- a/DHL/Datatype/EA/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)', 'length' => '2', 'enumeration' => 'EE,OD,CP', - ), - 'Weight' => array( + ], + 'Weight' => [ 'type' => 'Weight', 'required' => false, 'subobject' => false, @@ -64,8 +43,8 @@ class Piece extends Base 'fractionDigits' => '1', 'maxInclusive' => '999999.9', 'totalDigits' => '7', - ), - 'DimWeight' => array( + ], + 'DimWeight' => [ 'type' => 'Weight', 'required' => false, 'subobject' => false, @@ -73,26 +52,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 58% rename from DHL/Datatype/EA/PieceDetails.php rename to src/Datatype/AM/PieceDetails.php index 4a0a7bc..5a2bc06 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)', '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..80b271c --- /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..c4c8874 --- /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..ee4244b --- /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..e6e230c --- /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..2c4b50b --- /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 61% rename from DHL/Datatype/AM/Place.php rename to src/Datatype/AM/Place.php index 25df20f..982b392 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)', '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 52% rename from DHL/Datatype/EA/QtdSInAdCur.php rename to src/Datatype/AM/QtdSInAdCur.php index 3f2a5e2..e7b5f06 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..bd0f5ba --- /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..030d1ef --- /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..1b4c32d --- /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..08bdb69 --- /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..d822a1e --- /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..e41d2e3 --- /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 87% rename from DHL/Datatype/EA/ServiceEvent.php rename to src/Datatype/AM/ServiceEvent.php index 25c9175..d461537 100644 --- a/DHL/Datatype/EA/ServiceEvent.php +++ b/src/Datatype/AM/ServiceEvent.php @@ -22,8 +22,8 @@ * @version 0.1 */ -namespace DHL\Datatype\EA; -use DHL\Datatype\Base; +namespace Mtc\Dhl\Datatype\AM; +use Mtc\Dhl\Datatype\Base; /** * ServiceEvent Request model for DHL API @@ -40,16 +40,16 @@ class ServiceEvent extends Base * Parameters of the datatype * @var array */ - protected $_params = array( - 'EventCode' => array( + protected $params = [ + 'EventCode' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'Description' => array( + ], + 'Description' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - ); + ], + ]; } diff --git a/DHL/Datatype/AP/ServiceHeader.php b/src/Datatype/AM/ServiceHeader.php similarity index 51% rename from DHL/Datatype/AP/ServiceHeader.php rename to src/Datatype/AM/ServiceHeader.php index 8a16b3d..f3d2c7b 100644 --- a/DHL/Datatype/AP/ServiceHeader.php +++ b/src/Datatype/AM/ServiceHeader.php @@ -1,29 +1,8 @@ array( + protected $params = [ + 'MessageTime' => [ 'type' => 'dateTime', 'required' => false, 'subobject' => false, - ), - 'MessageReference' => array( + ], + 'MessageReference' => [ 'type' => 'MessageReference', 'required' => false, 'subobject' => false, 'comment' => 'Reference to the requested Message', 'minLength' => '28', 'maxLength' => '32', - ), - 'SiteID' => array( + ], + 'SiteID' => [ 'type' => 'SiteID', 'required' => false, 'subobject' => false, 'comment' => 'Site ID used for verifying the sender', 'minLength' => '6', 'maxLength' => '20', - ), - 'Password' => array( + ], + '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 62% rename from DHL/Datatype/AP/ShipValResponsePiece.php rename to src/Datatype/AM/ShipValResponsePiece.php index 173ee0a..7e13409 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,16 @@ 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)', 'length' => '2', 'enumeration' => 'EE,OD,CP', - ), - 'DimWeight' => array( + ], + 'DimWeight' => [ 'type' => 'Weight', 'required' => false, 'subobject' => false, @@ -87,31 +66,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..d1eddbc --- /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 68% rename from DHL/Datatype/AP/Shipment.php rename to src/Datatype/AM/Shipment.php index 204f5bb..391233e 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..cfdfd96 --- /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 74% rename from DHL/Datatype/AM/ShipmentDetails.php rename to src/Datatype/AM/ShipmentDetails.php index cefd548..913d07f 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,16 +41,16 @@ 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, @@ -83,8 +64,8 @@ class ShipmentDetails extends Base 'pattern' => '([A-Z0-9])*', 'minLength' => '1', 'maxLength' => '4', - ), - 'GlobalProductCode' => array( + ], + 'GlobalProductCode' => [ 'type' => 'ProductCode', 'required' => false, 'subobject' => false, @@ -98,82 +79,82 @@ 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)', '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..d3b4efd --- /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/AM/ShipmentInfo.php b/src/Datatype/AM/ShipmentInfo.php similarity index 58% rename from DHL/Datatype/AM/ShipmentInfo.php rename to src/Datatype/AM/ShipmentInfo.php index 80ad9fa..39c75c7 100644 --- a/DHL/Datatype/AM/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( + ], + 'Pieces' => [ 'type' => '', 'required' => false, 'subobject' => true, - ), - '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/AP/Shipper.php b/src/Datatype/AM/Shipper.php similarity index 64% rename from DHL/Datatype/AP/Shipper.php rename to src/Datatype/AM/Shipper.php index d5325ae..982e932 100644 --- a/DHL/Datatype/AP/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/AM/SpecialService.php b/src/Datatype/AM/SpecialService.php similarity index 60% rename from DHL/Datatype/AM/SpecialService.php rename to src/Datatype/AM/SpecialService.php index 6b9964d..6e24c1e 100644 --- a/DHL/Datatype/AM/SpecialService.php +++ b/src/Datatype/AM/SpecialService.php @@ -1,29 +1,8 @@ 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', - ), - '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..8a7abfc --- /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..b2d136d --- /dev/null +++ b/src/Datatype/AM/TrackingPieces.php @@ -0,0 +1,29 @@ + [ + 'type' => 'PieceInfo', + 'required' => true, + 'subobject' => true, + ], + ]; +} diff --git a/src/Datatype/AM/WeightSeg.php b/src/Datatype/AM/WeightSeg.php new file mode 100644 index 0000000..448f4d7 --- /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 71% rename from DHL/Datatype/EA/ShipmentDetails.php rename to src/Datatype/AP/ShipmentDetails.php index f006d58..a7bce02 100644 --- a/DHL/Datatype/EA/ShipmentDetails.php +++ b/src/Datatype/AP/ShipmentDetails.php @@ -1,57 +1,31 @@ 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,16 +33,16 @@ 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, @@ -82,8 +56,8 @@ class ShipmentDetails extends Base 'pattern' => '([A-Z0-9])*', 'minLength' => '1', 'maxLength' => '4', - ), - 'GlobalProductCode' => array( + ], + 'GlobalProductCode' => [ 'type' => 'ProductCode', 'required' => false, 'subobject' => false, @@ -97,82 +71,82 @@ 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)', '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/Base.php b/src/Datatype/Base.php similarity index 60% rename from DHL/Datatype/Base.php rename to src/Datatype/Base.php index dd30b7a..849f51a 100644 --- a/DHL/Datatype/Base.php +++ b/src/Datatype/Base.php @@ -1,31 +1,11 @@ initializeValues(); @@ -57,22 +37,17 @@ public function __construct() /** * 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()) - { + foreach ($this->values as $k => $v) { + if (is_object($v)) { + if (!$v->isEmpty()) { return false; } - } - elseif (!empty($v) && $v !== null) - { + } elseif (!empty($v) && $v !== null) { return false; } } @@ -82,70 +57,52 @@ public function isEmpty() /** * 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()) - { + if ($this->isEmpty()) { return; } $displayedParentNode = false; $this->validateParameters(); - if (null !== $this->_xmlNodeName) - { - $parentNode = $this->_xmlNodeName; - } - else - { + 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)) - { + 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) - { + } 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']) - { + } else { + if (!isset($this->_params[$name]['disableParentNode']) || false == $this->_params[$name]['disableParentNode']) { $xmlWriter->startElement($name); } - foreach ($this->$name as $subelement) - { + foreach ($this->$name as $subelement) { $subelement->toXML($xmlWriter); } - if (!isset($this->_params[$name]['disableParentNode']) || false == $this->_params[$name]['disableParentNode']) - { + if (!isset($this->_params[$name]['disableParentNode']) || false == $this->_params[$name]['disableParentNode']) { $xmlWriter->endElement(); } } - } - else - { + } else { $xmlWriter->writeElement($name, $this->$name); } } @@ -156,146 +113,128 @@ public function toXML(\XMLWriter $xmlWriter = null) /** * Initialize object from an XML string - * + * * @param string $xml XML String - * + * * @return void */ - public function initFromXML($xml) + 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) - { + foreach ($xml->children() as $child) { $childName = $child->getName(); - if (isset($this->$childName) && is_object($this->$childName)) - { + 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) - { + } 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 - { + 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); + } 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) + 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']) - { + 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)) - { + 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) - { + 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 - { + + 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 + * + * @return bolean True if it exsits, false otherwise */ - final public function __isset($key) + final public function __isset($key) { - return array_key_exists($key, $this->_values); + return array_key_exists($key, $this->values); } /** * Magic getter function - * + * * @param string $key Key to get - * - * @return mixed Value of the property + * + * @return mixed Value of the property * @throws \InvalidArgumentException Throws exceptin if key is not valid */ - final public function __get($key) + final public function __get($key) { - if (!array_key_exists($key, $this->_values)) - { + if (!array_key_exists($key, $this->values)) { throw new \InvalidArgumentException('Field : ' . $key . ' is not defined for ' . get_class($this)); } - return $this->_values[$key]; + 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) + final public function __set($key, $value) { - if (!array_key_exists($key, $this->_values)) - { + 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; + $this->values[$key] = $value; } - + /** * Initialize property values bag * @@ -303,50 +242,38 @@ final public function __set($key, $value) */ 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']) - { + 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; + $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) - { + 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]); + } else { + $this->validateParameterType($name, $this->values[$name]); + $this->validateParameterValue($name, $this->values[$name]); } } } @@ -356,76 +283,65 @@ protected function validateParameters() /** * 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) - { + if (null === $value) { return true; } - switch ($this->_params[$key]['type']) - { + 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 : ' + 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 : ' + } 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; + 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 : ' + 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; + 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 : ' + 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; + } + break; default: - if (isset($this->_params[$key]['subobject']) && $this->_params[$key]['subobject']) - { + 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 : ' + 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; + break; } return true; @@ -433,70 +349,61 @@ protected function validateParameterType($key, $value) /** * 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) - { + foreach ($this->_params[$key] as $type => $typeValue) { + switch ($type) { case 'enumeration': $acceptedValues = explode(',', $typeValue); - if (!in_array($value, $acceptedValues)) - { + if (!in_array($value, $acceptedValues)) { throw new \InvalidArgumentException('Field ' . $key . ' cannot be set to value : ' . $value . '. Accepted values are : ' . $typeValue); } - break; - + break; + case 'length': - if (strlen($value) != $typeValue) - { + if (strlen($value) != $typeValue) { throw new \InvalidArgumentException('Field ' . $key . ' has a size of ' . strlen($value) . ' and it should be that size : ' . $typeValue); } - break; + break; case 'maxLength': - if (strlen($value) > $typeValue) - { + if (strlen($value) > $typeValue) { throw new \InvalidArgumentException('Field ' . $key . ' has a size of ' . strlen($value) . ' and it cannot exceed this size : ' . $typeValue); } - break; + break; case 'minLength': - if (strlen($value) < $typeValue) - { + 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; - + break; + case 'minInclusive': - if ($value < $typeValue) - { + if ($value < $typeValue) { throw new \InvalidArgumentException('Field ' . $key . ' cannot be smaller than ' . $typeValue); } - break; - + break; + case 'maxInclusive': - if ($value > $typeValue) - { + if ($value > $typeValue) { throw new \InvalidArgumentException('Field ' . $key . ' cannot be higher than ' . $typeValue); } - break; + break; case 'pattern': - $matches = array(); + $matches = []; $typeValue = "/" . $typeValue . "/"; - if (1 !== preg_match($typeValue, $value, $matches) || (strlen($value) > 0 && !$matches[0])) - { + 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; + break; } } 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 71% rename from DHL/Datatype/AP/ShipmentDetails.php rename to src/Datatype/EA/ShipmentDetails.php index 8700109..f832298 100644 --- a/DHL/Datatype/AP/ShipmentDetails.php +++ b/src/Datatype/EA/ShipmentDetails.php @@ -1,57 +1,29 @@ 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,16 +31,16 @@ 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, @@ -82,8 +54,8 @@ class ShipmentDetails extends Base 'pattern' => '([A-Z0-9])*', 'minLength' => '1', 'maxLength' => '4', - ), - 'GlobalProductCode' => array( + ], + 'GlobalProductCode' => [ 'type' => 'ProductCode', 'required' => false, 'subobject' => false, @@ -97,82 +69,82 @@ 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)', '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/GB/AWBInfo.php b/src/Datatype/GB/AWBInfo.php new file mode 100644 index 0000000..532854e --- /dev/null +++ b/src/Datatype/GB/AWBInfo.php @@ -0,0 +1,41 @@ + [ + '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/GB/AdditionalProtection.php b/src/Datatype/GB/AdditionalProtection.php new file mode 100644 index 0000000..dd301b2 --- /dev/null +++ b/src/Datatype/GB/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/GB/BarCode.php b/src/Datatype/GB/BarCode.php new file mode 100644 index 0000000..63769d9 --- /dev/null +++ b/src/Datatype/GB/BarCode.php @@ -0,0 +1,32 @@ + [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => '', + ], + ]; +} diff --git a/src/Datatype/GB/BarCodes.php b/src/Datatype/GB/BarCodes.php new file mode 100644 index 0000000..84510b3 --- /dev/null +++ b/src/Datatype/GB/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/GB/Billing.php b/src/Datatype/GB/Billing.php new file mode 100644 index 0000000..bd56d0d --- /dev/null +++ b/src/Datatype/GB/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/GB/ChargeCard.php b/src/Datatype/GB/ChargeCard.php new file mode 100644 index 0000000..329d68c --- /dev/null +++ b/src/Datatype/GB/ChargeCard.php @@ -0,0 +1,48 @@ + [ + '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/DHL/Datatype/GB/Consignee.php b/src/Datatype/GB/Consignee.php similarity index 55% rename from DHL/Datatype/GB/Consignee.php rename to src/Datatype/GB/Consignee.php index 734d4ce..a6f4590 100644 --- a/DHL/Datatype/GB/Consignee.php +++ b/src/Datatype/GB/Consignee.php @@ -1,117 +1,90 @@ array( + protected $params = [ + 'CompanyName' => [ 'type' => 'CompanyNameValidator', 'required' => false, 'subobject' => false, 'comment' => 'Name of company / business', 'minLength' => '0', - ), - 'SuiteDepartmentName' => array( + ], + 'SuiteDepartmentName' => [ 'type' => 'SuiteDepartmentName', 'required' => false, 'subobject' => false, 'comment' => 'SuiteDepartmentName', - ), - 'AddressLine' => array( + ], + 'AddressLine' => [ 'type' => 'string', 'required' => true, 'subobject' => false, 'comment' => 'Address Line', 'multivalues' => true, - ), - 'City' => array( + ], + 'City' => [ 'type' => 'City', 'required' => false, 'subobject' => false, 'comment' => 'City name', - ), - 'Division' => array( + ], + 'Division' => [ 'type' => 'Division', 'required' => false, 'subobject' => false, 'comment' => 'Division (e.g. state, prefecture, etc.) name', - ), - 'DivisionCode' => array( + ], + 'DivisionCode' => [ 'type' => 'DivisionCode', 'required' => false, 'subobject' => false, 'comment' => 'Division (e.g. state, prefecture, etc.) code', - ), - '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', - ), - '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/src/Datatype/GB/Contact.php b/src/Datatype/GB/Contact.php new file mode 100644 index 0000000..649b222 --- /dev/null +++ b/src/Datatype/GB/Contact.php @@ -0,0 +1,60 @@ + [ + 'type' => 'PersonName', + 'required' => false, + 'subobject' => false, + 'comment' => 'Name', + 'maxLength' => '35', + ], + 'PhoneNumber' => [ + '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', + ], + ]; +} diff --git a/src/Datatype/GB/DestinationServiceArea.php b/src/Datatype/GB/DestinationServiceArea.php new file mode 100644 index 0000000..ef44b14 --- /dev/null +++ b/src/Datatype/GB/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/GB/Dutiable.php similarity index 55% rename from DHL/Datatype/GB/Dutiable.php rename to src/Datatype/GB/Dutiable.php index 216fdfe..410495d 100644 --- a/DHL/Datatype/GB/Dutiable.php +++ b/src/Datatype/GB/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/GB/ExportDeclaration.php similarity index 56% rename from DHL/Datatype/GB/ExportDeclaration.php rename to src/Datatype/GB/ExportDeclaration.php index ebe83f1..6bf202f 100644 --- a/DHL/Datatype/GB/ExportDeclaration.php +++ b/src/Datatype/GB/ExportDeclaration.php @@ -1,119 +1,92 @@ 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,ITN', - ), - 'SedNumberType' => array( + ], + 'SedNumberType' => [ 'type' => 'SEDNumberType', 'required' => false, 'subobject' => false, 'comment' => '', 'length' => '1', 'enumeration' => 'F,X,S,I', - ), - 'MxStateCode' => array( + ], + 'MxStateCode' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'ExportLineItems' => array( + ], + 'ExportLineItems' => [ 'type' => 'ExportLineItem', 'required' => false, 'subobject' => true, 'multivalues' => true, 'disableParentNode' => true, - ), - ); + ], + ]; } diff --git a/DHL/Datatype/GB/ExportLineItem.php b/src/Datatype/GB/ExportLineItem.php similarity index 56% rename from DHL/Datatype/GB/ExportLineItem.php rename to src/Datatype/GB/ExportLineItem.php index cf39ab5..9c276c9 100644 --- a/DHL/Datatype/GB/ExportLineItem.php +++ b/src/Datatype/GB/ExportLineItem.php @@ -1,122 +1,95 @@ 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' => 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/DHL/Datatype/GB/Filing.php b/src/Datatype/GB/Filing.php similarity index 81% rename from DHL/Datatype/GB/Filing.php rename to src/Datatype/GB/Filing.php index 5eacd53..568a006 100644 --- a/DHL/Datatype/GB/Filing.php +++ b/src/Datatype/GB/Filing.php @@ -22,8 +22,8 @@ * @version 0.1 */ -namespace DHL\Datatype\GB; -use DHL\Datatype\Base; +namespace Mtc\Dhl\Datatype\GB; +use Mtc\Dhl\Datatype\Base; /** * Filing Request model for DHL API @@ -40,8 +40,8 @@ class Filing extends Base * Parameters of the datatype * @var array */ - protected $_params = array( - 'FilingType' => array( + protected $params = [ + 'FilingType' => [ 'type' => 'FilingType', 'required' => false, 'subobject' => false, @@ -49,31 +49,31 @@ 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/DHL/Datatype/GB/Notification.php b/src/Datatype/GB/Notification.php similarity index 88% rename from DHL/Datatype/GB/Notification.php rename to src/Datatype/GB/Notification.php index c9f4e39..883f32f 100644 --- a/DHL/Datatype/GB/Notification.php +++ b/src/Datatype/GB/Notification.php @@ -22,8 +22,8 @@ * @version 0.1 */ -namespace DHL\Datatype\GB; -use DHL\Datatype\Base; +namespace Mtc\Dhl\Datatype\GB; +use Mtc\Dhl\Datatype\Base; /** * Notification Request model for DHL API @@ -40,20 +40,20 @@ class Notification extends Base * Parameters of the datatype * @var array */ - protected $_params = array( - 'EmailAddress' => 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/GB/OriginServiceArea.php b/src/Datatype/GB/OriginServiceArea.php new file mode 100644 index 0000000..4348399 --- /dev/null +++ b/src/Datatype/GB/OriginServiceArea.php @@ -0,0 +1,38 @@ + [ + '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/DHL/Datatype/GB/Piece.php b/src/Datatype/GB/Piece.php similarity index 57% rename from DHL/Datatype/GB/Piece.php rename to src/Datatype/GB/Piece.php index a2821bd..4ae9a8c 100644 --- a/DHL/Datatype/GB/Piece.php +++ b/src/Datatype/GB/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/DHL/Datatype/GB/PieceDetails.php b/src/Datatype/GB/PieceDetails.php similarity index 52% rename from DHL/Datatype/GB/PieceDetails.php rename to src/Datatype/GB/PieceDetails.php index 1646df4..a0654e5 100644 --- a/DHL/Datatype/GB/PieceDetails.php +++ b/src/Datatype/GB/PieceDetails.php @@ -1,55 +1,28 @@ array( + protected $params = [ + 'PieceID' => [ 'type' => 'TrackingPieceID', 'required' => false, 'subobject' => false, 'comment' => 'Piece ID', 'minLength' => '20', 'maxLength' => '35', - ), - 'PackageType' => array( + ], + 'PackageType' => [ 'type' => 'PackageType', 'required' => false, 'subobject' => false, @@ -58,8 +31,8 @@ class PieceDetails 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, @@ -68,26 +41,26 @@ class PieceDetails extends Base 'minInclusive' => '0.000', 'maxInclusive' => '999999.999', 'totalDigits' => '10', - ), - 'DimWeight' => array( + ], + 'DimWeight' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ), - '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, - ), - ); + ], + ]; } diff --git a/DHL/Datatype/AM/PieceEvent.php b/src/Datatype/GB/PieceEvent.php similarity index 81% rename from DHL/Datatype/AM/PieceEvent.php rename to src/Datatype/GB/PieceEvent.php index f43b32d..cbf40e1 100644 --- a/DHL/Datatype/AM/PieceEvent.php +++ b/src/Datatype/GB/PieceEvent.php @@ -22,13 +22,13 @@ * @version 0.1 */ -namespace DHL\Datatype\AM; -use DHL\Datatype\Base; +namespace Mtc\Dhl\Datatype\GB; +use Mtc\Dhl\Datatype\Base; /** * PieceEvent Request model for DHL API */ -class PieceEvent extends Base +class PieceEvent extends \Mtc\Dhl\Datatype\AM\PieceEvent { /** * Is this object a subobject @@ -40,31 +40,31 @@ class PieceEvent extends Base * Parameters of the datatype * @var array */ - protected $_params = array( - 'Date' => array( + protected $params = [ + 'Date' => [ 'type' => 'date', 'required' => false, 'subobject' => false, - ), - 'Time' => array( + ], + 'Time' => [ 'type' => 'time', 'required' => false, 'subobject' => false, - ), - 'ServiceEvent' => array( + ], + 'ServiceEvent' => [ 'type' => 'ServiceEvent', 'required' => false, 'subobject' => true, - ), - 'Signatory' => array( + ], + 'Signatory' => [ 'type' => '', 'required' => false, 'subobject' => false, - ), - 'ServiceArea' => array( + ], + 'ServiceArea' => [ 'type' => 'ServiceArea', 'required' => false, 'subobject' => true, - ), - ); + ], + ]; } diff --git a/src/Datatype/GB/PieceFault.php b/src/Datatype/GB/PieceFault.php new file mode 100644 index 0000000..5ac488e --- /dev/null +++ b/src/Datatype/GB/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/GB/Pieces.php b/src/Datatype/GB/Pieces.php new file mode 100644 index 0000000..845d4fd --- /dev/null +++ b/src/Datatype/GB/Pieces.php @@ -0,0 +1,24 @@ + [ + 'type' => 'Piece', + 'required' => false, + 'subobject' => true, + 'multivalues' => true, + ], + ]; +} diff --git a/DHL/Datatype/GB/Place.php b/src/Datatype/GB/Place.php similarity index 57% rename from DHL/Datatype/GB/Place.php rename to src/Datatype/GB/Place.php index 8dcc0f6..e17b56d 100644 --- a/DHL/Datatype/GB/Place.php +++ b/src/Datatype/GB/Place.php @@ -1,47 +1,20 @@ array( + protected $params = [ + 'ResidenceOrBusiness' => [ 'type' => 'ResidenceOrBusiness', 'required' => false, 'subobject' => false, @@ -49,63 +22,63 @@ class Place extends Base 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', 'minLength' => '0', 'maxLength' => '35', - ), - 'AddressLine' => array( + ], + 'AddressLine' => [ 'type' => 'AddressLine', 'required' => true, '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' => '35', - ), - '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', 'maxLength' => '12', - ), - 'PackageLocation' => array( + ], + 'PackageLocation' => [ 'type' => 'PackageLocation', 'required' => false, 'subobject' => false, 'comment' => 'PackageLocation', 'maxLength' => '40', - ), - ); + ], + ]; } diff --git a/src/Datatype/GB/QtdSInAdCur.php b/src/Datatype/GB/QtdSInAdCur.php new file mode 100644 index 0000000..6f1fe7b --- /dev/null +++ b/src/Datatype/GB/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/DHL/Datatype/GB/Requestor.php b/src/Datatype/GB/Requestor.php similarity index 85% rename from DHL/Datatype/GB/Requestor.php rename to src/Datatype/GB/Requestor.php index e034ce4..bebf7b0 100644 --- a/DHL/Datatype/GB/Requestor.php +++ b/src/Datatype/GB/Requestor.php @@ -22,8 +22,8 @@ * @version 0.1 */ -namespace DHL\Datatype\GB; -use DHL\Datatype\Base; +namespace Mtc\Dhl\Datatype\GB; +use Mtc\Dhl\Datatype\Base; /** * Requestor Request model for DHL API @@ -40,23 +40,23 @@ class Requestor extends Base * Parameters of the datatype * @var array */ - protected $_params = array( - 'AccountType' => array( + protected $params = [ + 'AccountType' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Account type', - ), - 'AccountNumber' => array( + ], + 'AccountNumber' => [ 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Account number', - ), + ], - 'PackageType' => array( + 'PackageType' => [ 'type' => 'PackageType', 'required' => false, 'subobject' => false, @@ -65,8 +65,8 @@ class Requestor 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, @@ -75,8 +75,8 @@ class Requestor extends Base 'minInclusive' => '0.000', 'maxInclusive' => '999999.999', 'totalDigits' => '10', - ), - 'DimWeight' => array( + ], + 'DimWeight' => [ 'type' => 'Weight', 'required' => false, 'subobject' => false, @@ -85,28 +85,28 @@ class Requestor 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, - ), - 'RequestorContents' => array( + ], + 'RequestorContents' => [ 'type' => 'RequestorContents', 'required' => false, 'subobject' => false, 'comment' => 'Requestor contents description', 'maxLength' => '35', - ), - ); + ], + ]; } diff --git a/src/Datatype/GB/Response.php b/src/Datatype/GB/Response.php new file mode 100644 index 0000000..9cd0f5b --- /dev/null +++ b/src/Datatype/GB/Response.php @@ -0,0 +1,23 @@ + [ + 'type' => 'ResponseServiceHeader', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/src/Datatype/GB/ResponseServiceHeader.php b/src/Datatype/GB/ResponseServiceHeader.php new file mode 100644 index 0000000..e408d1c --- /dev/null +++ b/src/Datatype/GB/ResponseServiceHeader.php @@ -0,0 +1,46 @@ + [ + '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/GB/ShipValResponsePiece.php similarity index 59% rename from DHL/Datatype/GB/ShipValResponsePiece.php rename to src/Datatype/GB/ShipValResponsePiece.php index 11520b8..55429d9 100644 --- a/DHL/Datatype/GB/ShipValResponsePiece.php +++ b/src/Datatype/GB/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/GB/Shipment.php similarity index 65% rename from DHL/Datatype/GB/Shipment.php rename to src/Datatype/GB/Shipment.php index 7200d04..fda7337 100644 --- a/DHL/Datatype/GB/Shipment.php +++ b/src/Datatype/GB/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,73 @@ 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( + ], + '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 +120,8 @@ class Shipment extends Base 'minLength' => '0', 'maxLength' => '1', 'enumeration' => 'K,L', - ), - 'DimensionalWeight' => array( + ], + 'DimensionalWeight' => [ 'type' => 'Weight', 'required' => false, 'subobject' => false, @@ -157,6 +130,6 @@ class Shipment extends Base 'minInclusive' => '0.000', 'maxInclusive' => '999999.999', 'totalDigits' => '10', - ), - ); + ], + ]; } diff --git a/src/Datatype/GB/ShipmentDate.php b/src/Datatype/GB/ShipmentDate.php new file mode 100644 index 0000000..9795a3a --- /dev/null +++ b/src/Datatype/GB/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/GB/ShipmentDetails.php similarity index 71% rename from DHL/Datatype/GB/ShipmentDetails.php rename to src/Datatype/GB/ShipmentDetails.php index 352b7ef..c564e67 100644 --- a/DHL/Datatype/GB/ShipmentDetails.php +++ b/src/Datatype/GB/ShipmentDetails.php @@ -1,32 +1,12 @@ 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 +41,8 @@ class ShipmentDetails extends Base 'minInclusive' => '0.000', 'maxInclusive' => '999999.999', 'totalDigits' => '10', - ), - 'WeightUnit' => array( + ], + 'WeightUnit' => [ 'type' => 'WeightUnit', 'required' => false, 'subobject' => false, @@ -70,8 +50,8 @@ class ShipmentDetails extends Base 'minLength' => '0', 'maxLength' => '1', 'enumeration' => 'K,L', - ), - 'GlobalProductCode' => array( + ], + 'GlobalProductCode' => [ 'type' => 'GlobalProductCode', 'required' => false, 'subobject' => false, @@ -79,8 +59,8 @@ class ShipmentDetails extends Base 'pattern' => '([A-Z0-9])*', 'minLength' => '1', 'maxLength' => '4', - ), - 'LocalProductCode' => array( + ], + 'LocalProductCode' => [ 'type' => 'LocalProductCode', 'required' => false, 'subobject' => false, @@ -88,22 +68,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,24 +91,24 @@ 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, @@ -137,42 +117,42 @@ class ShipmentDetails 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', - ), - '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/GB/ShipmentEvent.php b/src/Datatype/GB/ShipmentEvent.php new file mode 100644 index 0000000..0b61352 --- /dev/null +++ b/src/Datatype/GB/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/GB/ShipmentInfo.php b/src/Datatype/GB/ShipmentInfo.php new file mode 100644 index 0000000..3dd3157 --- /dev/null +++ b/src/Datatype/GB/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' => true, + ], + '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/GB/Shipper.php similarity index 64% rename from DHL/Datatype/GB/Shipper.php rename to src/Datatype/GB/Shipper.php index fff2966..023fd8f 100644 --- a/DHL/Datatype/GB/Shipper.php +++ b/src/Datatype/GB/Shipper.php @@ -1,34 +1,13 @@ 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', '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( + ], + 'AddressLine' => [ 'type' => 'string', 'required' => true, 'subobject' => false, 'comment' => 'Address Line', 'multivalues' => true, - ), - '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' => '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, '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/GB/SpecialService.php similarity index 54% rename from DHL/Datatype/GB/SpecialService.php rename to src/Datatype/GB/SpecialService.php index 4cb8079..d1af2b3 100644 --- a/DHL/Datatype/GB/SpecialService.php +++ b/src/Datatype/GB/SpecialService.php @@ -1,98 +1,71 @@ 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', '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/GB/WeightSeg.php b/src/Datatype/GB/WeightSeg.php new file mode 100644 index 0000000..fcc68e6 --- /dev/null +++ b/src/Datatype/GB/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..0fcc212 --- /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..c60739b --- /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..c39afee --- /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..da8bded --- /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..dde3e92 --- /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..e988187 --- /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..e1314bc 100644 --- a/DHL/Entity/AM/KnownTrackingRequest.php +++ b/src/Entity/AM/KnownTrackingRequest.php @@ -1,32 +1,13 @@ array( + protected $_bodyParams = [ + '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..d08be96 --- /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..e956293 --- /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..451688f 100644 --- a/DHL/Entity/EA/PickupResponse.php +++ b/src/Entity/AM/PickupResponse.php @@ -1,32 +1,13 @@ array( + protected $_bodyParams = [ + '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..ee9c0a5 --- /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..91483b5 100644 --- a/DHL/Entity/AM/RoutingRequest.php +++ b/src/Entity/AM/RoutingRequest.php @@ -1,32 +1,13 @@ array( + protected $_bodyParams = [ + '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..cafd9d0 --- /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..0913f84 --- /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..f190afc --- /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..5da629f --- /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..4603114 100644 --- a/DHL/Entity/AM/ShipmentRatingResponse.php +++ b/src/Entity/AM/ShipmentRatingResponse.php @@ -1,32 +1,13 @@ array( + protected $_bodyParams = [ + '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..acfa8a9 --- /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..eb29066 --- /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..ebf9428 100644 --- a/DHL/Entity/AM/ShipmentValidateRequest.php +++ b/src/Entity/AM/ShipmentValidateRequest.php @@ -1,32 +1,13 @@ array( + protected $_bodyParams = [ + '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..ea139fa 100644 --- a/DHL/Entity/AM/ShipmentValidateResponse.php +++ b/src/Entity/AM/ShipmentValidateResponse.php @@ -1,32 +1,13 @@ array( + protected $_bodyParams = [ + '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..5bac654 --- /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..a589d22 --- /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..ab7581c --- /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..2a98c8f --- /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..0b3fa15 --- /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..051ad8d 100644 --- a/DHL/Entity/AP/ShipmentValidateRequest.php +++ b/src/Entity/AP/ShipmentValidateRequest.php @@ -1,32 +1,13 @@ array( + protected $_bodyParams = [ + '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..0d4df8d 100644 --- a/DHL/Entity/AP/ShipmentValidateResponse.php +++ b/src/Entity/AP/ShipmentValidateResponse.php @@ -1,324 +1,285 @@ array( + protected $_bodyParams = [ + '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..44ac69b --- /dev/null +++ b/src/Entity/Base.php @@ -0,0 +1,303 @@ + [ + '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 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 + */ + 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->header_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 Request + $xml_writer->endElement(); // End of ServiceHeader + + 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)); + $className = 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); + $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(): 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..13b8b15 --- /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..2259992 --- /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..c060934 100644 --- a/DHL/Entity/EA/RoutingRequest.php +++ b/src/Entity/EA/RoutingRequest.php @@ -1,32 +1,13 @@ array( + protected $_bodyParams = [ + '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..f9328b9 100644 --- a/DHL/Entity/EA/ShipmentValidateRequest.php +++ b/src/Entity/EA/ShipmentValidateRequest.php @@ -1,32 +1,13 @@ array( + protected $_bodyParams = [ + '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..d848537 100644 --- a/DHL/Entity/EA/ShipmentValidateResponse.php +++ b/src/Entity/EA/ShipmentValidateResponse.php @@ -1,291 +1,252 @@ array( + protected $_bodyParams = [ + '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/GB/BookPURequest.php b/src/Entity/GB/BookPURequest.php new file mode 100644 index 0000000..acd57db --- /dev/null +++ b/src/Entity/GB/BookPURequest.php @@ -0,0 +1,72 @@ + [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'RegionCode', + 'minLength' => '2', + 'maxLength' => '2', + 'enumeration' => 'AP,EU,AM', + ], + '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, + ], + 'ShipmentDetails' => [ + 'type' => 'ShipmentDetails', + 'required' => false, + 'subobject' => true, + ], + ]; +} diff --git a/DHL/Entity/GB/BookPUResponse.php b/src/Entity/GB/BookPUResponse.php similarity index 56% rename from DHL/Entity/GB/BookPUResponse.php rename to src/Entity/GB/BookPUResponse.php index 06f4a30..ddab712 100644 --- a/DHL/Entity/GB/BookPUResponse.php +++ b/src/Entity/GB/BookPUResponse.php @@ -1,32 +1,13 @@ array( + protected $_bodyParams = [ + '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/GB/CancelPURequest.php similarity index 54% rename from DHL/Entity/GB/CancelPURequest.php rename to src/Entity/GB/CancelPURequest.php index 66e779e..59f32bc 100644 --- a/DHL/Entity/GB/CancelPURequest.php +++ b/src/Entity/GB/CancelPURequest.php @@ -1,32 +1,13 @@ array( + protected $_bodyParams = [ + 'RegionCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, @@ -61,51 +42,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/GB/CancelPUResponse.php similarity index 56% rename from DHL/Entity/GB/CancelPUResponse.php rename to src/Entity/GB/CancelPUResponse.php index 6024dbf..0347977 100644 --- a/DHL/Entity/GB/CancelPUResponse.php +++ b/src/Entity/GB/CancelPUResponse.php @@ -1,32 +1,13 @@ array( + protected $_bodyParams = [ + '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/GB/KnownTrackingRequest.php similarity index 51% rename from DHL/Entity/GB/KnownTrackingRequest.php rename to src/Entity/GB/KnownTrackingRequest.php index 36e2a01..ac6a424 100644 --- a/DHL/Entity/GB/KnownTrackingRequest.php +++ b/src/Entity/GB/KnownTrackingRequest.php @@ -1,32 +1,13 @@ array( + protected $_bodyParams = [ + '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/GB/ModifyPURequest.php b/src/Entity/GB/ModifyPURequest.php new file mode 100644 index 0000000..de98f57 --- /dev/null +++ b/src/Entity/GB/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/GB/ModifyPUResponse.php similarity index 56% rename from DHL/Entity/GB/ModifyPUResponse.php rename to src/Entity/GB/ModifyPUResponse.php index 00f29f7..c163f7d 100644 --- a/DHL/Entity/GB/ModifyPUResponse.php +++ b/src/Entity/GB/ModifyPUResponse.php @@ -1,32 +1,13 @@ array( + protected $_bodyParams = [ + '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/GB/RouteRequest.php similarity index 58% rename from DHL/Entity/GB/RouteRequest.php rename to src/Entity/GB/RouteRequest.php index b02d0c0..b72c39b 100644 --- a/DHL/Entity/GB/RouteRequest.php +++ b/src/Entity/GB/RouteRequest.php @@ -1,32 +1,13 @@ array( + protected $_bodyParams = [ + '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/GB/RouteResponse.php b/src/Entity/GB/RouteResponse.php new file mode 100644 index 0000000..ee02c14 --- /dev/null +++ b/src/Entity/GB/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/GB/ShipmentRequest.php similarity index 60% rename from DHL/Entity/GB/ShipmentRequest.php rename to src/Entity/GB/ShipmentRequest.php index c87d77c..937830a 100644 --- a/DHL/Entity/GB/ShipmentRequest.php +++ b/src/Entity/GB/ShipmentRequest.php @@ -1,32 +1,13 @@ array( + protected $_bodyParams = [ + 'RegionCode' => [ 'type' => 'string', 'required' => false, 'subobject' => false, @@ -73,105 +48,105 @@ 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( + ], + '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' => [ '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 +154,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/GB/ShipmentResponse.php similarity index 66% rename from DHL/Entity/GB/ShipmentResponse.php rename to src/Entity/GB/ShipmentResponse.php index 0772fa3..c6e6175 100644 --- a/DHL/Entity/GB/ShipmentResponse.php +++ b/src/Entity/GB/ShipmentResponse.php @@ -1,32 +1,13 @@ array( + protected $_bodyParams = [ + '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/GB/TrackingResponse.php b/src/Entity/GB/TrackingResponse.php new file mode 100644 index 0000000..b2b0388 --- /dev/null +++ b/src/Entity/GB/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/GB/UnknownTrackingRequest.php b/src/Entity/GB/UnknownTrackingRequest.php new file mode 100644 index 0000000..1c285a2 --- /dev/null +++ b/src/Entity/GB/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..7ecb6a6 --- /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')); - } -} - From ca68d7547937866255d11fac33c5dabeb8bf35c8 Mon Sep 17 00:00:00 2001 From: Martins Fridenbergs Date: Sat, 20 Apr 2019 10:46:49 +0300 Subject: [PATCH 02/42] Fix $body_params name --- src/Entity/AM/BookPickupRequest.php | 2 +- src/Entity/AM/CancelPickupRequest.php | 2 +- src/Entity/AM/DCTRequest.php | 2 +- src/Entity/AM/ErrorResponse.php | 2 +- src/Entity/AM/GetCapability.php | 2 +- src/Entity/AM/GetQuote.php | 2 +- src/Entity/AM/KnownTrackingRequest.php | 2 +- src/Entity/AM/ModifyPickupRequest.php | 2 +- src/Entity/AM/PickupErrorResponse.php | 2 +- src/Entity/AM/PickupResponse.php | 2 +- src/Entity/AM/RoutingErrorResponse.php | 2 +- src/Entity/AM/RoutingRequest.php | 2 +- src/Entity/AM/RoutingResponse.php | 2 +- src/Entity/AM/ShipmentBookRatingRequest.php | 2 +- src/Entity/AM/ShipmentCustRatingRequest.php | 2 +- src/Entity/AM/ShipmentRatingErrorResponse.php | 2 +- src/Entity/AM/ShipmentRatingResponse.php | 2 +- src/Entity/AM/ShipmentTrackingErrorResponse.php | 2 +- src/Entity/AM/ShipmentValidateErrorResponse.php | 2 +- src/Entity/AM/ShipmentValidateRequest.php | 2 +- src/Entity/AM/ShipmentValidateResponse.php | 2 +- src/Entity/AM/TrackingResponse.php | 2 +- src/Entity/AM/UnknownTrackingRequest.php | 2 +- src/Entity/AP/BookPickupRequest.php | 2 +- src/Entity/AP/CancelPickupRequest.php | 2 +- src/Entity/AP/ModifyPickupRequest.php | 2 +- src/Entity/AP/ShipmentValidateRequest.php | 2 +- src/Entity/AP/ShipmentValidateResponse.php | 2 +- src/Entity/Base.php | 7 ++++--- src/Entity/EA/BookPickupRequest.php | 2 +- src/Entity/EA/CancelPickupRequest.php | 2 +- src/Entity/EA/RoutingRequest.php | 2 +- src/Entity/EA/ShipmentValidateRequest.php | 2 +- src/Entity/EA/ShipmentValidateResponse.php | 2 +- src/Entity/GB/BookPURequest.php | 2 +- src/Entity/GB/BookPUResponse.php | 2 +- src/Entity/GB/CancelPURequest.php | 2 +- src/Entity/GB/CancelPUResponse.php | 2 +- src/Entity/GB/KnownTrackingRequest.php | 2 +- src/Entity/GB/ModifyPURequest.php | 2 +- src/Entity/GB/ModifyPUResponse.php | 2 +- src/Entity/GB/RouteRequest.php | 2 +- src/Entity/GB/RouteResponse.php | 2 +- src/Entity/GB/ShipmentRequest.php | 2 +- src/Entity/GB/ShipmentResponse.php | 2 +- src/Entity/GB/TrackingResponse.php | 2 +- src/Entity/GB/UnknownTrackingRequest.php | 2 +- 47 files changed, 50 insertions(+), 49 deletions(-) diff --git a/src/Entity/AM/BookPickupRequest.php b/src/Entity/AM/BookPickupRequest.php index 0fcc212..c84140f 100644 --- a/src/Entity/AM/BookPickupRequest.php +++ b/src/Entity/AM/BookPickupRequest.php @@ -33,7 +33,7 @@ class BookPickupRequest extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'Requestor' => [ 'type' => 'string', 'required' => false, diff --git a/src/Entity/AM/CancelPickupRequest.php b/src/Entity/AM/CancelPickupRequest.php index c60739b..86e868a 100644 --- a/src/Entity/AM/CancelPickupRequest.php +++ b/src/Entity/AM/CancelPickupRequest.php @@ -33,7 +33,7 @@ class CancelPickupRequest extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'ConfirmationNumber' => [ 'type' => 'string', 'required' => false, diff --git a/src/Entity/AM/DCTRequest.php b/src/Entity/AM/DCTRequest.php index c39afee..2f98ae6 100644 --- a/src/Entity/AM/DCTRequest.php +++ b/src/Entity/AM/DCTRequest.php @@ -33,7 +33,7 @@ class DCTRequest extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'GetCapability' => [ 'type' => 'GetCapability', 'required' => false, diff --git a/src/Entity/AM/ErrorResponse.php b/src/Entity/AM/ErrorResponse.php index da8bded..75d9c73 100644 --- a/src/Entity/AM/ErrorResponse.php +++ b/src/Entity/AM/ErrorResponse.php @@ -33,7 +33,7 @@ class ErrorResponse extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'Response' => [ 'type' => 'Response', 'required' => false, diff --git a/src/Entity/AM/GetCapability.php b/src/Entity/AM/GetCapability.php index dde3e92..9e99b4f 100644 --- a/src/Entity/AM/GetCapability.php +++ b/src/Entity/AM/GetCapability.php @@ -33,7 +33,7 @@ class GetCapability extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'From' => [ 'type' => 'DCTFrom', 'required' => false, diff --git a/src/Entity/AM/GetQuote.php b/src/Entity/AM/GetQuote.php index e988187..6337b40 100644 --- a/src/Entity/AM/GetQuote.php +++ b/src/Entity/AM/GetQuote.php @@ -33,7 +33,7 @@ class GetQuote extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'From' => [ 'type' => 'DCTFrom', 'required' => false, diff --git a/src/Entity/AM/KnownTrackingRequest.php b/src/Entity/AM/KnownTrackingRequest.php index e1314bc..fb06bd4 100644 --- a/src/Entity/AM/KnownTrackingRequest.php +++ b/src/Entity/AM/KnownTrackingRequest.php @@ -33,7 +33,7 @@ class KnownTrackingRequest extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'LanguageCode' => [ 'type' => 'string', 'required' => false, diff --git a/src/Entity/AM/ModifyPickupRequest.php b/src/Entity/AM/ModifyPickupRequest.php index d08be96..7f6281b 100644 --- a/src/Entity/AM/ModifyPickupRequest.php +++ b/src/Entity/AM/ModifyPickupRequest.php @@ -33,7 +33,7 @@ class ModifyPickupRequest extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'ConfirmationNumber' => [ 'type' => 'string', 'required' => false, diff --git a/src/Entity/AM/PickupErrorResponse.php b/src/Entity/AM/PickupErrorResponse.php index e956293..2744496 100644 --- a/src/Entity/AM/PickupErrorResponse.php +++ b/src/Entity/AM/PickupErrorResponse.php @@ -33,7 +33,7 @@ class PickupErrorResponse extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'Response' => [ 'type' => 'Response', 'required' => false, diff --git a/src/Entity/AM/PickupResponse.php b/src/Entity/AM/PickupResponse.php index 451688f..3925bb3 100644 --- a/src/Entity/AM/PickupResponse.php +++ b/src/Entity/AM/PickupResponse.php @@ -33,7 +33,7 @@ class PickupResponse extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'Response' => [ 'type' => 'Response', 'required' => false, diff --git a/src/Entity/AM/RoutingErrorResponse.php b/src/Entity/AM/RoutingErrorResponse.php index ee9c0a5..522cf49 100644 --- a/src/Entity/AM/RoutingErrorResponse.php +++ b/src/Entity/AM/RoutingErrorResponse.php @@ -33,7 +33,7 @@ class RoutingErrorResponse extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'Response' => [ 'type' => 'Response', 'required' => false, diff --git a/src/Entity/AM/RoutingRequest.php b/src/Entity/AM/RoutingRequest.php index 91483b5..18dd7c8 100644 --- a/src/Entity/AM/RoutingRequest.php +++ b/src/Entity/AM/RoutingRequest.php @@ -33,7 +33,7 @@ class RoutingRequest extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'RequestType' => [ 'type' => 'string', 'required' => false, diff --git a/src/Entity/AM/RoutingResponse.php b/src/Entity/AM/RoutingResponse.php index cafd9d0..f2feeef 100644 --- a/src/Entity/AM/RoutingResponse.php +++ b/src/Entity/AM/RoutingResponse.php @@ -33,7 +33,7 @@ class RoutingResponse extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'Response' => [ 'type' => 'Response', 'required' => false, diff --git a/src/Entity/AM/ShipmentBookRatingRequest.php b/src/Entity/AM/ShipmentBookRatingRequest.php index 0913f84..7948a74 100644 --- a/src/Entity/AM/ShipmentBookRatingRequest.php +++ b/src/Entity/AM/ShipmentBookRatingRequest.php @@ -33,7 +33,7 @@ class ShipmentBookRatingRequest extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'Shipper' => [ 'type' => 'Shipper', 'required' => false, diff --git a/src/Entity/AM/ShipmentCustRatingRequest.php b/src/Entity/AM/ShipmentCustRatingRequest.php index f190afc..857058c 100644 --- a/src/Entity/AM/ShipmentCustRatingRequest.php +++ b/src/Entity/AM/ShipmentCustRatingRequest.php @@ -33,7 +33,7 @@ class ShipmentCustRatingRequest extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'Billing' => [ 'type' => 'Billing', 'required' => false, diff --git a/src/Entity/AM/ShipmentRatingErrorResponse.php b/src/Entity/AM/ShipmentRatingErrorResponse.php index 5da629f..cd63dcf 100644 --- a/src/Entity/AM/ShipmentRatingErrorResponse.php +++ b/src/Entity/AM/ShipmentRatingErrorResponse.php @@ -33,7 +33,7 @@ class ShipmentRatingErrorResponse extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'Response' => [ 'type' => 'Response', 'required' => false, diff --git a/src/Entity/AM/ShipmentRatingResponse.php b/src/Entity/AM/ShipmentRatingResponse.php index 4603114..f8cbbe5 100644 --- a/src/Entity/AM/ShipmentRatingResponse.php +++ b/src/Entity/AM/ShipmentRatingResponse.php @@ -33,7 +33,7 @@ class ShipmentRatingResponse extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'Response' => [ 'type' => 'Response', 'required' => false, diff --git a/src/Entity/AM/ShipmentTrackingErrorResponse.php b/src/Entity/AM/ShipmentTrackingErrorResponse.php index acfa8a9..b0d12b6 100644 --- a/src/Entity/AM/ShipmentTrackingErrorResponse.php +++ b/src/Entity/AM/ShipmentTrackingErrorResponse.php @@ -33,7 +33,7 @@ class ShipmentTrackingErrorResponse extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'Response' => [ 'type' => 'Response', 'required' => false, diff --git a/src/Entity/AM/ShipmentValidateErrorResponse.php b/src/Entity/AM/ShipmentValidateErrorResponse.php index eb29066..263d937 100644 --- a/src/Entity/AM/ShipmentValidateErrorResponse.php +++ b/src/Entity/AM/ShipmentValidateErrorResponse.php @@ -33,7 +33,7 @@ class ShipmentValidateErrorResponse extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'Response' => [ 'type' => 'Response', 'required' => false, diff --git a/src/Entity/AM/ShipmentValidateRequest.php b/src/Entity/AM/ShipmentValidateRequest.php index ebf9428..4aaf365 100644 --- a/src/Entity/AM/ShipmentValidateRequest.php +++ b/src/Entity/AM/ShipmentValidateRequest.php @@ -33,7 +33,7 @@ class ShipmentValidateRequest extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'RequestedPickupTime' => [ 'type' => 'string', 'required' => false, diff --git a/src/Entity/AM/ShipmentValidateResponse.php b/src/Entity/AM/ShipmentValidateResponse.php index ea139fa..7b245a4 100644 --- a/src/Entity/AM/ShipmentValidateResponse.php +++ b/src/Entity/AM/ShipmentValidateResponse.php @@ -33,7 +33,7 @@ class ShipmentValidateResponse extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'Response' => [ 'type' => 'Response', 'required' => false, diff --git a/src/Entity/AM/TrackingResponse.php b/src/Entity/AM/TrackingResponse.php index 5bac654..7ae5c64 100644 --- a/src/Entity/AM/TrackingResponse.php +++ b/src/Entity/AM/TrackingResponse.php @@ -33,7 +33,7 @@ class TrackingResponse extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'Response' => [ 'type' => 'Response', 'required' => false, diff --git a/src/Entity/AM/UnknownTrackingRequest.php b/src/Entity/AM/UnknownTrackingRequest.php index a589d22..06aa4d6 100644 --- a/src/Entity/AM/UnknownTrackingRequest.php +++ b/src/Entity/AM/UnknownTrackingRequest.php @@ -33,7 +33,7 @@ class UnknownTrackingRequest extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'LanguageCode' => [ 'type' => 'string', 'required' => false, diff --git a/src/Entity/AP/BookPickupRequest.php b/src/Entity/AP/BookPickupRequest.php index ab7581c..42e5012 100644 --- a/src/Entity/AP/BookPickupRequest.php +++ b/src/Entity/AP/BookPickupRequest.php @@ -33,7 +33,7 @@ class BookPickupRequest extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'Requestor' => [ 'type' => 'string', 'required' => false, diff --git a/src/Entity/AP/CancelPickupRequest.php b/src/Entity/AP/CancelPickupRequest.php index 2a98c8f..7444b4f 100644 --- a/src/Entity/AP/CancelPickupRequest.php +++ b/src/Entity/AP/CancelPickupRequest.php @@ -33,7 +33,7 @@ class CancelPickupRequest extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'ConfirmationNumber' => [ 'type' => 'string', 'required' => false, diff --git a/src/Entity/AP/ModifyPickupRequest.php b/src/Entity/AP/ModifyPickupRequest.php index 0b3fa15..37e9c40 100644 --- a/src/Entity/AP/ModifyPickupRequest.php +++ b/src/Entity/AP/ModifyPickupRequest.php @@ -33,7 +33,7 @@ class ModifyPickupRequest extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'ConfirmationNumber' => [ 'type' => 'string', 'required' => false, diff --git a/src/Entity/AP/ShipmentValidateRequest.php b/src/Entity/AP/ShipmentValidateRequest.php index 051ad8d..ebe7f16 100644 --- a/src/Entity/AP/ShipmentValidateRequest.php +++ b/src/Entity/AP/ShipmentValidateRequest.php @@ -33,7 +33,7 @@ class ShipmentValidateRequest extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'LanguageCode' => [ 'type' => 'string', 'required' => false, diff --git a/src/Entity/AP/ShipmentValidateResponse.php b/src/Entity/AP/ShipmentValidateResponse.php index 0d4df8d..9fe4729 100644 --- a/src/Entity/AP/ShipmentValidateResponse.php +++ b/src/Entity/AP/ShipmentValidateResponse.php @@ -13,7 +13,7 @@ class ShipmentValidateResponse extends \Mtc\Dhl\Entity\AM\ShipmentValidateRespon * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'Response' => [ 'type' => 'Response', 'required' => false, diff --git a/src/Entity/Base.php b/src/Entity/Base.php index 44ac69b..c8d842a 100644 --- a/src/Entity/Base.php +++ b/src/Entity/Base.php @@ -1,4 +1,5 @@ [ 'type' => 'string', 'required' => false, diff --git a/src/Entity/EA/CancelPickupRequest.php b/src/Entity/EA/CancelPickupRequest.php index 2259992..3bc8d57 100644 --- a/src/Entity/EA/CancelPickupRequest.php +++ b/src/Entity/EA/CancelPickupRequest.php @@ -33,7 +33,7 @@ class CancelPickupRequest extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'ConfirmationNumber' => [ 'type' => 'string', 'required' => false, diff --git a/src/Entity/EA/RoutingRequest.php b/src/Entity/EA/RoutingRequest.php index c060934..632de2e 100644 --- a/src/Entity/EA/RoutingRequest.php +++ b/src/Entity/EA/RoutingRequest.php @@ -33,7 +33,7 @@ class RoutingRequest extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'RequestType' => [ 'type' => 'string', 'required' => false, diff --git a/src/Entity/EA/ShipmentValidateRequest.php b/src/Entity/EA/ShipmentValidateRequest.php index f9328b9..21af8a3 100644 --- a/src/Entity/EA/ShipmentValidateRequest.php +++ b/src/Entity/EA/ShipmentValidateRequest.php @@ -33,7 +33,7 @@ class ShipmentValidateRequest extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'NewShipper' => [ 'type' => 'string', 'required' => false, diff --git a/src/Entity/EA/ShipmentValidateResponse.php b/src/Entity/EA/ShipmentValidateResponse.php index d848537..2f947f6 100644 --- a/src/Entity/EA/ShipmentValidateResponse.php +++ b/src/Entity/EA/ShipmentValidateResponse.php @@ -13,7 +13,7 @@ class ShipmentValidateResponse extends \Mtc\Dhl\Entity\AM\ShipmentValidateRespon * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'Response' => [ 'type' => 'Response', 'required' => false, diff --git a/src/Entity/GB/BookPURequest.php b/src/Entity/GB/BookPURequest.php index acd57db..c752eda 100644 --- a/src/Entity/GB/BookPURequest.php +++ b/src/Entity/GB/BookPURequest.php @@ -33,7 +33,7 @@ class BookPURequest extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'RegionCode' => [ 'type' => 'string', 'required' => false, diff --git a/src/Entity/GB/BookPUResponse.php b/src/Entity/GB/BookPUResponse.php index ddab712..ab78ac8 100644 --- a/src/Entity/GB/BookPUResponse.php +++ b/src/Entity/GB/BookPUResponse.php @@ -33,7 +33,7 @@ class BookPUResponse extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'Response' => [ 'type' => 'Response', 'required' => false, diff --git a/src/Entity/GB/CancelPURequest.php b/src/Entity/GB/CancelPURequest.php index 59f32bc..dcb9bbb 100644 --- a/src/Entity/GB/CancelPURequest.php +++ b/src/Entity/GB/CancelPURequest.php @@ -33,7 +33,7 @@ class CancelPURequest extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'RegionCode' => [ 'type' => 'string', 'required' => false, diff --git a/src/Entity/GB/CancelPUResponse.php b/src/Entity/GB/CancelPUResponse.php index 0347977..c606d05 100644 --- a/src/Entity/GB/CancelPUResponse.php +++ b/src/Entity/GB/CancelPUResponse.php @@ -33,7 +33,7 @@ class CancelPUResponse extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'Response' => [ 'type' => 'Response', 'required' => false, diff --git a/src/Entity/GB/KnownTrackingRequest.php b/src/Entity/GB/KnownTrackingRequest.php index ac6a424..4181836 100644 --- a/src/Entity/GB/KnownTrackingRequest.php +++ b/src/Entity/GB/KnownTrackingRequest.php @@ -33,7 +33,7 @@ class KnownTrackingRequest extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'LanguageCode' => [ 'type' => 'string', 'required' => false, diff --git a/src/Entity/GB/ModifyPURequest.php b/src/Entity/GB/ModifyPURequest.php index de98f57..6aa401f 100644 --- a/src/Entity/GB/ModifyPURequest.php +++ b/src/Entity/GB/ModifyPURequest.php @@ -33,7 +33,7 @@ class ModifyPURequest extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'RegionCode' => [ 'type' => 'string', 'required' => false, diff --git a/src/Entity/GB/ModifyPUResponse.php b/src/Entity/GB/ModifyPUResponse.php index c163f7d..d98c9c4 100644 --- a/src/Entity/GB/ModifyPUResponse.php +++ b/src/Entity/GB/ModifyPUResponse.php @@ -33,7 +33,7 @@ class ModifyPUResponse extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'Response' => [ 'type' => 'Response', 'required' => false, diff --git a/src/Entity/GB/RouteRequest.php b/src/Entity/GB/RouteRequest.php index b72c39b..6c4b879 100644 --- a/src/Entity/GB/RouteRequest.php +++ b/src/Entity/GB/RouteRequest.php @@ -39,7 +39,7 @@ class RouteRequest extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'RegionCode' => [ 'type' => 'string', 'required' => false, diff --git a/src/Entity/GB/RouteResponse.php b/src/Entity/GB/RouteResponse.php index ee02c14..def1a1d 100644 --- a/src/Entity/GB/RouteResponse.php +++ b/src/Entity/GB/RouteResponse.php @@ -33,7 +33,7 @@ class RouteResponse extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'Response' => [ 'type' => 'Response', 'required' => false, diff --git a/src/Entity/GB/ShipmentRequest.php b/src/Entity/GB/ShipmentRequest.php index 937830a..bc6fdd3 100644 --- a/src/Entity/GB/ShipmentRequest.php +++ b/src/Entity/GB/ShipmentRequest.php @@ -39,7 +39,7 @@ class ShipmentRequest extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'RegionCode' => [ 'type' => 'string', 'required' => false, diff --git a/src/Entity/GB/ShipmentResponse.php b/src/Entity/GB/ShipmentResponse.php index c6e6175..b8fd304 100644 --- a/src/Entity/GB/ShipmentResponse.php +++ b/src/Entity/GB/ShipmentResponse.php @@ -33,7 +33,7 @@ class ShipmentResponse extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'Response' => [ 'type' => 'Response', 'required' => false, diff --git a/src/Entity/GB/TrackingResponse.php b/src/Entity/GB/TrackingResponse.php index b2b0388..adc21da 100644 --- a/src/Entity/GB/TrackingResponse.php +++ b/src/Entity/GB/TrackingResponse.php @@ -33,7 +33,7 @@ class TrackingResponse extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'Response' => [ 'type' => 'Response', 'required' => false, diff --git a/src/Entity/GB/UnknownTrackingRequest.php b/src/Entity/GB/UnknownTrackingRequest.php index 1c285a2..7c75dde 100644 --- a/src/Entity/GB/UnknownTrackingRequest.php +++ b/src/Entity/GB/UnknownTrackingRequest.php @@ -33,7 +33,7 @@ class UnknownTrackingRequest extends Base * Parameters to be send in the body * @var array */ - protected $_bodyParams = [ + protected $body_params = [ 'LanguageCode' => [ 'type' => 'string', 'required' => false, From e794657109c36229597773ecd1131f1f0354e02d Mon Sep 17 00:00:00 2001 From: Martins Fridenbergs Date: Sat, 20 Apr 2019 11:14:08 +0300 Subject: [PATCH 03/42] XSD amends to upgrade the API --- src/Datatype/AM/Label.php | 2 +- src/Datatype/AM/SpecialService.php | 2 +- src/Datatype/GB/Contact.php | 7 ++ src/Datatype/GB/Filing.php | 2 +- src/Datatype/GB/PUShipmentDetails.php | 143 ++++++++++++++++++++++++++ src/Datatype/GB/PieceEvent.php | 70 ------------- src/Datatype/GB/Place.php | 141 ++++++++++++++++--------- src/Datatype/GB/Requestor.php | 88 +++------------- src/Datatype/GB/RequestorContact.php | 68 ++++++++++++ src/Entity/Base.php | 2 +- src/Entity/GB/BookPURequest.php | 35 +++++-- src/Entity/GB/CancelPURequest.php | 8 +- src/Entity/GB/ShipmentRequest.php | 2 +- 13 files changed, 362 insertions(+), 208 deletions(-) create mode 100644 src/Datatype/GB/PUShipmentDetails.php delete mode 100644 src/Datatype/GB/PieceEvent.php create mode 100644 src/Datatype/GB/RequestorContact.php diff --git a/src/Datatype/AM/Label.php b/src/Datatype/AM/Label.php index f8f7ebf..22d3d70 100644 --- a/src/Datatype/AM/Label.php +++ b/src/Datatype/AM/Label.php @@ -25,7 +25,7 @@ class Label extends Base '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', + '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', diff --git a/src/Datatype/AM/SpecialService.php b/src/Datatype/AM/SpecialService.php index 6e24c1e..4322e0d 100644 --- a/src/Datatype/AM/SpecialService.php +++ b/src/Datatype/AM/SpecialService.php @@ -21,7 +21,7 @@ class SpecialService extends Base */ protected $params = [ 'SpecialServiceType' => [ - 'type' => 'SpecialServiceType', + 'type' => 'string', 'required' => false, 'subobject' => false, 'comment' => 'Special Service codes', diff --git a/src/Datatype/GB/Contact.php b/src/Datatype/GB/Contact.php index 649b222..82fa62e 100644 --- a/src/Datatype/GB/Contact.php +++ b/src/Datatype/GB/Contact.php @@ -28,6 +28,13 @@ class Contact extends \Mtc\Dhl\Datatype\AM\Contact 'comment' => 'Phone Number', 'maxLength' => '25', ], + 'Phone' => [ + 'type' => 'PhoneNumber', + 'required' => false, + 'subobject' => false, + 'comment' => 'Phone Number', + 'maxLength' => '25', + ], 'PhoneExtension' => [ 'type' => 'PhoneExtension', 'required' => false, diff --git a/src/Datatype/GB/Filing.php b/src/Datatype/GB/Filing.php index 568a006..200c290 100644 --- a/src/Datatype/GB/Filing.php +++ b/src/Datatype/GB/Filing.php @@ -57,7 +57,7 @@ class Filing extends Base '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)', + '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', diff --git a/src/Datatype/GB/PUShipmentDetails.php b/src/Datatype/GB/PUShipmentDetails.php new file mode 100644 index 0000000..8b871df --- /dev/null +++ b/src/Datatype/GB/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/GB/PieceEvent.php b/src/Datatype/GB/PieceEvent.php deleted file mode 100644 index cbf40e1..0000000 --- a/src/Datatype/GB/PieceEvent.php +++ /dev/null @@ -1,70 +0,0 @@ - [ - '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/GB/Place.php b/src/Datatype/GB/Place.php index e17b56d..59b026a 100644 --- a/src/Datatype/GB/Place.php +++ b/src/Datatype/GB/Place.php @@ -14,71 +14,114 @@ class Place extends \Mtc\Dhl\Datatype\AM\Place * @var array */ protected $params = [ - 'ResidenceOrBusiness' => [ - 'type' => 'ResidenceOrBusiness', - 'required' => false, + 'LocationType' => [ + 'type' => 'string', + 'required' => false, 'subobject' => false, - 'comment' => 'Identifies if a location is a business, residence, + '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', + 'length' => '1', 'enumeration' => 'B,R,C', - ], - 'CompanyName' => [ - 'type' => 'CompanyNameValidator', - 'required' => false, + ], + 'CompanyName' => [ + 'type' => 'CompanyNameValidator', + 'required' => false, 'subobject' => false, - 'comment' => 'Name of company / business', + 'comment' => 'Name of company / business', 'minLength' => '0', 'maxLength' => '35', - ], - 'AddressLine' => [ - 'type' => 'AddressLine', - 'required' => true, + ], + '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' => 'Address Line', + 'comment' => 'City name', 'maxLength' => '35', - ], - 'City' => [ - 'type' => 'City', - 'required' => false, + ], + 'StateCode' => [ + 'type' => 'StateCode', + 'required' => false, 'subobject' => false, - 'comment' => 'City name', + 'comment' => 'State Code', 'maxLength' => '35', - ], - 'CountryCode' => [ - 'type' => 'CountryCode', - 'required' => false, + ], + 'DivisionName' => [ + 'type' => 'string', + 'required' => false, 'subobject' => false, - 'comment' => 'ISO country codes', - 'length' => '2', - ], - 'DivisionCode' => [ - 'type' => 'StateCode', - 'required' => 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' => 'Division (state) code.', + 'comment' => 'RouteCode', 'maxLength' => '35', - ], - 'Division' => [ - 'type' => 'State', - 'required' => false, + ], + 'Suburb' => [ + 'type' => 'string', + 'required' => false, 'subobject' => false, - 'comment' => 'State', + 'comment' => 'Suburb', 'maxLength' => '35', - ], - 'PostalCode' => [ - 'type' => 'PostalCode', - 'required' => false, + ], + 'DivisionCode' => [ + 'type' => 'StateCode', + 'required' => false, 'subobject' => false, - 'comment' => 'Full postal/zip code for address', - 'maxLength' => '12', - ], - 'PackageLocation' => [ - 'type' => 'PackageLocation', - 'required' => false, + 'comment' => 'Division (state) code.', + 'maxLength' => '35', + ], + 'Division' => [ + 'type' => 'State', + 'required' => false, 'subobject' => false, - 'comment' => 'PackageLocation', - 'maxLength' => '40', - ], + 'comment' => 'State', + 'maxLength' => '35', + ], ]; } diff --git a/src/Datatype/GB/Requestor.php b/src/Datatype/GB/Requestor.php index bebf7b0..c15533c 100644 --- a/src/Datatype/GB/Requestor.php +++ b/src/Datatype/GB/Requestor.php @@ -1,32 +1,13 @@ false, 'comment' => 'Account number', ], - - - - 'PackageType' => [ - 'type' => 'PackageType', + 'RequestorContact' => [ + 'type' => 'RequestorContact', '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' => 'Weight', - 'required' => false, - 'subobject' => false, - 'comment' => 'Weight of piece or shipment', - 'fractionDigits' => '3', - 'minInclusive' => '0.000', - 'maxInclusive' => '999999.999', - 'totalDigits' => '10', - ], - 'Width' => [ - 'type' => 'positiveInteger', - 'required' => false, - 'subobject' => false, - ], - 'Height' => [ - 'type' => 'positiveInteger', - 'required' => false, - 'subobject' => false, - ], - 'Depth' => [ - 'type' => 'positiveInteger', - 'required' => false, - 'subobject' => false, - ], - 'RequestorContents' => [ - 'type' => 'RequestorContents', + 'subobject' => true, + 'comment' => 'RequestorContact', + ], + 'CompanyName' => [ + 'type' => 'string', 'required' => false, 'subobject' => false, - 'comment' => 'Requestor contents description', - 'maxLength' => '35', - ], + 'comment' => 'Company Name', + ], ]; } diff --git a/src/Datatype/GB/RequestorContact.php b/src/Datatype/GB/RequestorContact.php new file mode 100644 index 0000000..956e392 --- /dev/null +++ b/src/Datatype/GB/RequestorContact.php @@ -0,0 +1,68 @@ + [ + 'type' => 'PersonName', + 'required' => false, + 'subobject' => false, + 'comment' => 'Name', + 'maxLength' => '35', + ], + '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', + ], + ]; +} diff --git a/src/Entity/Base.php b/src/Entity/Base.php index c8d842a..62885e7 100644 --- a/src/Entity/Base.php +++ b/src/Entity/Base.php @@ -79,7 +79,7 @@ abstract class Base extends BaseDataType * @var string * The schema version */ - protected $schema_version = '6.2'; + protected $schema_version = '1.0'; /** * @var boolean diff --git a/src/Entity/GB/BookPURequest.php b/src/Entity/GB/BookPURequest.php index c752eda..ee54ce5 100644 --- a/src/Entity/GB/BookPURequest.php +++ b/src/Entity/GB/BookPURequest.php @@ -27,7 +27,19 @@ class BookPURequest extends Base * @var string * Service XSD */ - protected $service_xsd = 'BookPURequest.xsd'; + protected $service_xsd = 'book-pickup-global-req-3.0'; + + /** + * @var string + * The schema version + */ + protected $schema_version = '3.0'; + + /** + * Display Schema version or not + * @var boolean + */ + protected $display_schema_version = true; /** * Parameters to be send in the body @@ -44,9 +56,9 @@ class BookPURequest extends Base 'enumeration' => 'AP,EU,AM', ], 'Requestor' => [ - 'type' => 'string', + 'type' => 'Requestor', 'required' => false, - 'subobject' => false, + 'subobject' => true, ], 'Place' => [ 'type' => 'Place', @@ -54,19 +66,26 @@ class BookPURequest extends Base 'subobject' => true, ], 'Pickup' => [ - 'type' => 'string', + 'type' => 'Pickup', 'required' => false, - 'subobject' => false, + 'subobject' => true, ], 'PickupContact' => [ - 'type' => 'string', + 'type' => 'PickupContact', 'required' => false, - 'subobject' => false, + 'subobject' => true, ], 'ShipmentDetails' => [ - 'type' => 'ShipmentDetails', + 'type' => 'PUShipmentDetails', 'required' => false, 'subobject' => true, ], + 'SpecialService' => [ + 'disableParentNode' => true, + 'multivalues' => true, + 'type' => 'SpecialService', + 'required' => false, + 'subobject' => true, + ], ]; } diff --git a/src/Entity/GB/CancelPURequest.php b/src/Entity/GB/CancelPURequest.php index dcb9bbb..7f1e58e 100644 --- a/src/Entity/GB/CancelPURequest.php +++ b/src/Entity/GB/CancelPURequest.php @@ -27,8 +27,14 @@ class CancelPURequest extends Base * @var string * Service XSD */ - protected $service_xsd = 'CancelPURequest.xsd'; + protected $service_xsd = 'cancel-pickup-global-req-3.0'; + /** + * Display Schema version or not + * @var boolean + */ + protected $display_schema_version = true; + /** * Parameters to be send in the body * @var array diff --git a/src/Entity/GB/ShipmentRequest.php b/src/Entity/GB/ShipmentRequest.php index bc6fdd3..a41c301 100644 --- a/src/Entity/GB/ShipmentRequest.php +++ b/src/Entity/GB/ShipmentRequest.php @@ -27,7 +27,7 @@ class ShipmentRequest extends Base * @var string * Service XSD */ - protected $service_xsd = 'ShipmentRequest.xsd'; + protected $service_xsd = 'ship-val-global-req-6.2.xsd'; /** * Display the schema version From 94ed3059b9808d03730cdea0981cc0d6497cb71e Mon Sep 17 00:00:00 2001 From: Martins Fridenbergs Date: Sat, 20 Apr 2019 11:27:39 +0300 Subject: [PATCH 04/42] Documentation and remove old files --- README.md => README_old.md | 6 - composer.json | 2 +- config/dhl.php | 5 - contributing.md | 20 +++ docs/capability.md | 0 docs/shipment.md | 0 docs/shipment_validation.md | 0 docs/test_pack.md | 0 docs/tracking.md | 0 init.php | 52 -------- license.md | 5 + readme.md | 39 ++++++ samples/AM/GetQuote.php | 80 ------------ samples/EA/Tracking.php | 50 ------- samples/EU/RouteRequest.php | 56 -------- samples/GB/Benchmark-ShipmentRequest.php | 159 ----------------------- samples/GB/RouteRequest.php | 56 -------- samples/GB/ShipmentRequest.php | 151 --------------------- 18 files changed, 65 insertions(+), 616 deletions(-) rename README.md => README_old.md (99%) delete mode 100644 config/dhl.php create mode 100644 contributing.md create mode 100644 docs/capability.md create mode 100644 docs/shipment.md create mode 100644 docs/shipment_validation.md create mode 100644 docs/test_pack.md create mode 100644 docs/tracking.md delete mode 100644 init.php create mode 100644 license.md create mode 100644 readme.md delete mode 100644 samples/AM/GetQuote.php delete mode 100644 samples/EA/Tracking.php delete mode 100644 samples/EU/RouteRequest.php delete mode 100644 samples/GB/Benchmark-ShipmentRequest.php delete mode 100644 samples/GB/RouteRequest.php delete mode 100644 samples/GB/ShipmentRequest.php diff --git a/README.md b/README_old.md similarity index 99% rename from README.md rename to README_old.md index dde6120..ff6c085 100644 --- a/README.md +++ b/README_old.md @@ -1,9 +1,3 @@ - -## Authors & contact - - -Al-Fallouji Bashar - - bashar@alfallouji.com ## Documentation and download diff --git a/composer.json b/composer.json index c2537dc..db2f802 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "mtcmedia/dhl-api", "description": "PHP library to communicate with the DHL XML Services.", "require": { - "php": ">=7.1.3" + "php": ">=7.0" }, "license": "MIT", "autoload": { diff --git a/config/dhl.php b/config/dhl.php deleted file mode 100644 index 25058db..0000000 --- a/config/dhl.php +++ /dev/null @@ -1,5 +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..3728ef4 --- /dev/null +++ b/readme.md @@ -0,0 +1,39 @@ +# 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.0, however it has has been developed and tested on php 7.2.* + +## Usage + +[Shipment Validation](docs/shipment_validation.md) + +[Shipment Requests](docs/shipment.md) + +[Tracking Requests](docs/tracking.md) + +[Capability Requests](docs/capability.md) + +[DHL Test Pack](docs/test_pack.md) + + +## 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(); From 35aa4bc7a2be0d2bc08f09223b67f81cc33ca561 Mon Sep 17 00:00:00 2001 From: Martins Fridenbergs Date: Sat, 20 Apr 2019 12:41:48 +0300 Subject: [PATCH 05/42] Some additional cleanup --- src/Client/Web.php | 2 + src/Datatype/Base.php | 76 +++++++++++++++++----------------- src/Entity/Base.php | 11 +++-- src/Entity/GB/RouteRequest.php | 2 +- 4 files changed, 49 insertions(+), 42 deletions(-) diff --git a/src/Client/Web.php b/src/Client/Web.php index 9edb302..959550f 100644 --- a/src/Client/Web.php +++ b/src/Client/Web.php @@ -60,11 +60,13 @@ public function call(Request $request) curl_setopt($ch, CURLOPT_POSTFIELDS, $request->toXML()); $result = curl_exec($ch); + error_log($request->toXML(), null, './dhl_logs'); if (curl_error($ch)) { return false; } else { curl_close($ch); } + error_log($result, null, './dhl_logs'); return $result; } diff --git a/src/Datatype/Base.php b/src/Datatype/Base.php index 849f51a..cbd0365 100644 --- a/src/Datatype/Base.php +++ b/src/Datatype/Base.php @@ -80,25 +80,25 @@ public function toXML(\XMLWriter $xmlWriter = null) $xmlWriter->startElement($parentNode); - foreach ($this->_params as $name => $infos) { + 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); + 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']) { + if (!isset($this->params[$name]['disableParentNode']) || false == $this->params[$name]['disableParentNode']) { $xmlWriter->startElement($name); } - foreach ($this->$name as $subelement) { - $subelement->toXML($xmlWriter); + foreach ($this->$name as $sub_element) { + $sub_element->toXML($xmlWriter); } - if (!isset($this->_params[$name]['disableParentNode']) || false == $this->_params[$name]['disableParentNode']) { + if (!isset($this->params[$name]['disableParentNode']) || false == $this->params[$name]['disableParentNode']) { $xmlWriter->endElement(); } } @@ -123,23 +123,25 @@ public function initFromXML($xml) $xml = simplexml_load_string(str_replace('req:', '', $xml)); $parts = explode('\\', get_class($this)); $className = array_pop($parts); + dd($className); 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); + } 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); + dd($child_class_name); + if ('string' == $this->params[$sub_child_name]['type']) { + $childObj = trim((string)$sub_child); } else { - $childObj = new $childClassname(); - $childObj->initFromXml($subchild->asXML()); + $childObj = new $child_class_name(); + $childObj->initFromXml($sub_child->asXML()); } - $addMethodName = 'add' . ucfirst($subchildName); + $addMethodName = 'add' . ucfirst($sub_child_name); $this->$addMethodName($childObj); } } elseif (isset($this->$childName) && ((string)$child)) { @@ -161,10 +163,10 @@ 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']) { + 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'; } @@ -179,7 +181,7 @@ public function __call($name, $arguments) $this->validateParameterType($key, $arguments[0]); $this->validateParameterValue($key, $arguments[0]); - if (isset($this->_params[$key]['multivalues']) && $this->_params[$key]['multivalues']) { + 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); @@ -242,7 +244,7 @@ final public function __set($key, $value) */ protected function initializeValues() { - foreach ($this->_params as $name => $infos) { + foreach ($this->params as $name => $infos) { if (isset($infos['multivalues']) && $infos['multivalues']) { $this->values[$name] = []; } elseif (isset($infos['subobject']) && $infos['subobject']) { @@ -265,11 +267,11 @@ protected function initializeValues() */ protected function validateParameters() { - foreach ($this->_params as $name => $infos) { + 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(); + foreach ($this->values[$name] as $sub_element) { + $sub_element->validateParameters(); } } else { $this->validateParameterType($name, $this->values[$name]); @@ -296,18 +298,18 @@ protected function validateParameterType($key, $value) return true; } - switch ($this->_params[$key]['type']) { + switch ($this->params[$key]['type']) { case 'string': - if (is_array($value) && isset($this->_params[$key]['multivalues']) && true === $this->_params[$key]['multivalues']) { + 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); + . $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); + . $this->params[$key]['type'] . ' but it has a value of : ' . $value); } break; @@ -317,7 +319,7 @@ protected function validateParameterType($key, $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); + . $this->params[$key]['type'] . ' but it has a value of : ' . $value); } break; @@ -326,19 +328,19 @@ protected function validateParameterType($key, $value) 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); + . $this->params[$key]['type'] . ' but it has a value of : ' . $value); } break; default: - if (isset($this->_params[$key]['subobject']) && $this->_params[$key]['subobject']) { + 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']); + $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) . '"'); + . $this->params[$key]['type'] . ' but it has a value of : "' . print_r($value, true) . '"'); } } break; @@ -358,7 +360,7 @@ protected function validateParameterType($key, $value) */ protected function validateParameterValue($key, $value) { - foreach ($this->_params[$key] as $type => $typeValue) { + foreach ($this->params[$key] as $type => $typeValue) { switch ($type) { case 'enumeration': $acceptedValues = explode(',', $typeValue); diff --git a/src/Entity/Base.php b/src/Entity/Base.php index 62885e7..e3e4775 100644 --- a/src/Entity/Base.php +++ b/src/Entity/Base.php @@ -203,7 +203,7 @@ public function initFromXML($xml) } $parts = explode('\\', get_class($this)); - $className = array_pop($parts); + $class_name = array_pop($parts); foreach ($xml->children() as $child) { $child_name = $child->getName(); switch ($child_name) { @@ -260,9 +260,12 @@ protected function initializeValues(): void $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(); + $class_name = implode('\\', $parts) . '\\' . $infos['type']; + $class_name = str_replace('Entity', 'Datatype', $class_name); + if (!class_exists($class_name)) { + $class_name = str_replace(['\\GB\\', '\\AP\\', '\\EA\\'], '\\AM\\', $class_name); + } + $this->values[$name] = new $class_name(); } } else { $this->values[$name] = null; diff --git a/src/Entity/GB/RouteRequest.php b/src/Entity/GB/RouteRequest.php index 6c4b879..c944cae 100644 --- a/src/Entity/GB/RouteRequest.php +++ b/src/Entity/GB/RouteRequest.php @@ -33,7 +33,7 @@ class RouteRequest extends Base * Display Schema version or not * @var boolean */ - protected $_displaySchemaVersion = true; + protected $display_schema_version = true; /** * Parameters to be send in the body From 394593fb7083f034e655a12bc4996a3802ebc1c4 Mon Sep 17 00:00:00 2001 From: Martins Fridenbergs Date: Sat, 20 Apr 2019 16:16:17 +0300 Subject: [PATCH 06/42] Remove error_logs --- src/Client/Web.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Client/Web.php b/src/Client/Web.php index 959550f..9edb302 100644 --- a/src/Client/Web.php +++ b/src/Client/Web.php @@ -60,13 +60,11 @@ public function call(Request $request) curl_setopt($ch, CURLOPT_POSTFIELDS, $request->toXML()); $result = curl_exec($ch); - error_log($request->toXML(), null, './dhl_logs'); if (curl_error($ch)) { return false; } else { curl_close($ch); } - error_log($result, null, './dhl_logs'); return $result; } From b06e799b47c7ae9f104bd8faaa907a5aee404932 Mon Sep 17 00:00:00 2001 From: Martins Fridenbergs Date: Sun, 21 Apr 2019 14:48:47 +0300 Subject: [PATCH 07/42] Add Pickup Datatypes --- src/Datatype/GB/OriginServiceArea.php | 5 ++++ src/Datatype/GB/Pickup.php | 41 +++++++++++++++++++++++++++ src/Datatype/GB/PickupContact.php | 41 +++++++++++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 src/Datatype/GB/Pickup.php create mode 100644 src/Datatype/GB/PickupContact.php diff --git a/src/Datatype/GB/OriginServiceArea.php b/src/Datatype/GB/OriginServiceArea.php index 4348399..73b1b8b 100644 --- a/src/Datatype/GB/OriginServiceArea.php +++ b/src/Datatype/GB/OriginServiceArea.php @@ -9,6 +9,11 @@ */ class OriginServiceArea extends \Mtc\Dhl\Datatype\AM\OriginServiceArea { + /** + * Is this object a subobject + * @var boolean + */ + protected $_isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/GB/Pickup.php b/src/Datatype/GB/Pickup.php new file mode 100644 index 0000000..c8aaaae --- /dev/null +++ b/src/Datatype/GB/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/GB/PickupContact.php b/src/Datatype/GB/PickupContact.php new file mode 100644 index 0000000..6d00200 --- /dev/null +++ b/src/Datatype/GB/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', + ], + ]; +} From 4b4425f16bb00e36655b61afcdbc9fbc59f337b5 Mon Sep 17 00:00:00 2001 From: Martins Fridenbergs Date: Sun, 21 Apr 2019 16:26:22 +0300 Subject: [PATCH 08/42] DHL Pickup version 1.0 as 3.0 has errors --- src/Entity/GB/BookPURequest.php | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/Entity/GB/BookPURequest.php b/src/Entity/GB/BookPURequest.php index ee54ce5..a871169 100644 --- a/src/Entity/GB/BookPURequest.php +++ b/src/Entity/GB/BookPURequest.php @@ -27,13 +27,7 @@ class BookPURequest extends Base * @var string * Service XSD */ - protected $service_xsd = 'book-pickup-global-req-3.0'; - - /** - * @var string - * The schema version - */ - protected $schema_version = '3.0'; + protected $service_xsd = 'book-pickup-global-req_EA.xsd'; /** * Display Schema version or not @@ -80,12 +74,11 @@ class BookPURequest extends Base 'required' => false, 'subobject' => true, ], - 'SpecialService' => [ - 'disableParentNode' => true, - 'multivalues' => true, - 'type' => 'SpecialService', - 'required' => false, - 'subobject' => true, - ], + 'ConsigneeDetails' => [ + 'type' => 'Consignee', + 'required' => false, + 'subobject' => true, + + ] ]; } From 3f216fa9f7a50c6c793cd3f67177e1390b71014c Mon Sep 17 00:00:00 2001 From: Martins Fridenbergs Date: Sun, 21 Apr 2019 17:47:47 +0300 Subject: [PATCH 09/42] Documentation examples --- docs/capability.md | 0 docs/pickup.md | 53 +++++++++++++++++++ docs/quote.md | 20 +++++++ docs/route.md | 28 ++++++++++ docs/shipment.md | 103 ++++++++++++++++++++++++++++++++++++ docs/shipment_validation.md | 0 docs/test_pack.md | 0 docs/tracking.md | 48 +++++++++++++++++ readme.md | 19 +++++-- 9 files changed, 266 insertions(+), 5 deletions(-) delete mode 100644 docs/capability.md create mode 100644 docs/pickup.md create mode 100644 docs/quote.md create mode 100644 docs/route.md delete mode 100644 docs/shipment_validation.md delete mode 100644 docs/test_pack.md diff --git a/docs/capability.md b/docs/capability.md deleted file mode 100644 index e69de29..0000000 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..328fe0c --- /dev/null +++ b/docs/quote.md @@ -0,0 +1,20 @@ +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); +``` + +If you need XML request for the DHL certification you can obtain by calling the following code +```php +$request_xml = $tracking->toXml(); +``` \ No newline at end of file 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 index e69de29..f6ea080 100644 --- a/docs/shipment.md +++ b/docs/shipment.md @@ -0,0 +1,103 @@ +Example request: +```php +$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->PiecesEnabled = 'Y'; +$shipment->Reference->ReferenceID = $client->account . '-' . $order->id; + +$shipment->Billing->ShipperAccountNumber = $order->auth->shipper_account; +$shipment->Billing->ShippingPaymentType = 'S'; +$shipment->Billing->BillingAccountNumber = $order->auth->billing_account; + +// Outside EU changes Tax info +if (!Country::isEu($shipping_address->country)) { + $shipment->Billing->DutyPaymentType = 'R'; +} + +$contact_name = $shipping_address->first_name . ' ' . $shipping_address->last_name; +$shipment->Consignee->CompanyName = $shipping_address->organisation ?? '--'; +$shipment->Consignee->Contact->PersonName = $contact_name; +$shipment->Consignee->addAddressLine(substr($shipping_address->address1, 0, 35)); +$shipment->Consignee->addAddressLine(substr($shipping_address->address2, 0, 35)); +$shipment->Consignee->City = $shipping_address->city; +$shipment->Consignee->PostalCode = $shipping_address->postcode; +$shipment->Consignee->Division = $shipping_address->state ?? ''; +$shipment->Consignee->CountryCode = $shipping_address->country; +$shipment->Consignee->CountryName = Country::getNameFromCode($shipping_address->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->RegionCode = Country::getDHLRegionCode($shipping_address->country); + +$order_value = $order->order_cost - $order->delivery_cost > 0 ? $order->order_cost - $order->delivery_cost : 1.0; +$shipment->Dutiable->DeclaredValue = $order_value; +$shipment->Dutiable->DeclaredCurrency = 'GBP'; +$shipment->Dutiable->TermsOfTrade = 'DDP'; + +$shipment->Shipper->ShipperID = $order->auth->shipper_id; +$shipment->Shipper->RegisteredAccount = $order->auth->shipper_account_number; +$shipment->Shipper->CompanyName = $collection_address->organisation; +$shipment->Shipper->addAddressLine($collection_address->address1); +$shipment->Shipper->addAddressLine($collection_address->address2); +$shipment->Shipper->City = $collection_address->city; +$shipment->Shipper->PostalCode = $collection_address->postcode; +$shipment->Shipper->CountryCode = $collection_address->country; +$shipment->Shipper->CountryName = Country::getNameFromCode($collection_address->country); + +$shipment->Shipper->Contact->PersonName = $collection_address->contact_name; +$shipment->Shipper->Contact->PhoneNumber = $collection_address->contact_phone; +$shipment->Shipper->Contact->Email = $collection_address->contact_email; +$shipment->Shipper->Contact->PhoneExtension = ''; +$shipment->Shipper->Contact->FaxNumber = ''; +$shipment->Shipper->Contact->Telex = ''; + +// Delivery Service is obtained via Quote request which will find valid services for shipment +$shipment->ShipmentDetails->GlobalProductCode = $delivery_service->code; +$shipment->ShipmentDetails->LocalProductCode = $delivery_service->format; + +if (Country::isEu($shipping_address->country) === false) { + $shipment->ShipmentDetails->DoorTo = 'DD'; +} +$shipment->ShipmentDetails->Contents = 'Shipment Description'; +$shipment->ShipmentDetails->CurrencyCode = 'GBP'; +$shipment->ShipmentDetails->WeightUnit = 'K'; +$shipment->ShipmentDetails->Weight = collect($packages)->sum('weight'); +$shipment->ShipmentDetails->Date = Carbon::now()->format('Y-m-d'); +$shipment->ShipmentDetails->DimensionUnit = 'C'; +$shipment->ShipmentDetails->InsuredAmount = $order->insurance_total ?? 0; +$shipment->ShipmentDetails->PackageType = $order->package_type ?? 'PA'; +$shipment->ShipmentDetails->IsDutiable = Country::isEu($shipping_address->country) ? 'Y' : 'N'; + +$shipment->ShipmentDetails->AdditionalProtection = new AdditionalProtection(); +$shipment->ShipmentDetails->DOSFlag = 'N'; +$shipment->ShipmentDetails->CustData = $contact_name; + +// Information about Packages in shipment +$shipment->ShipmentDetails->NumberOfPieces = count($packages); +foreach ($packages as $package_id => $package) { + $piece = new Piece(); + $piece->PieceID = $client->account . $order->id . $package_id; + $piece->PackageType = $order->package_type ?? 'CP'; + $piece->Weight = $package['weight']; + $piece->DimWeight = $package['weight']; + $shipment->ShipmentDetails->addPiece($piece); +} + +$shipment->EProcShip = 'N'; +$shipment->LabelImageFormat = 'PDF'; +$shipment->Label->LabelTemplate = '8X4_PDF'; + +$client = new Web($this->getEnvironment()); +$xml_response = $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/shipment_validation.md b/docs/shipment_validation.md deleted file mode 100644 index e69de29..0000000 diff --git a/docs/test_pack.md b/docs/test_pack.md deleted file mode 100644 index e69de29..0000000 diff --git a/docs/tracking.md b/docs/tracking.md index e69de29..95761c3 100644 --- a/docs/tracking.md +++ b/docs/tracking.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(); +``` \ No newline at end of file diff --git a/readme.md b/readme.md index 3728ef4..dcd1c14 100644 --- a/readme.md +++ b/readme.md @@ -15,15 +15,24 @@ Package requires a php min version of 7.0, however it has has been developed and ## Usage -[Shipment Validation](docs/shipment_validation.md) +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 -[Shipment Requests](docs/shipment.md) +DHL Documentation: http://xmlpitest-ea.dhl.com/toolkit/Toolkit.zip -[Tracking Requests](docs/tracking.md) +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](docs/quote.md) -[Capability Requests](docs/capability.md) +[Route Requests](docs/route.md) -[DHL Test Pack](docs/test_pack.md) +[Shipment Requests](docs/shipment.md) + +[Pickup Request](docs/pickup.md) + +[Tracking Requests](docs/tracking.md) ## Contributing From 229816ac06b93f60e5fe8ab0d9b7f446c2c2a43d Mon Sep 17 00:00:00 2001 From: Martins Fridenbergs Date: Sun, 21 Apr 2019 17:50:34 +0300 Subject: [PATCH 10/42] DHL api versions for requests --- readme.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/readme.md b/readme.md index dcd1c14..03aa3a0 100644 --- a/readme.md +++ b/readme.md @@ -24,15 +24,15 @@ DHL XML Services Test Harness: https://xmlpi-validation.dhl.com/serviceval/jsps/ DHL XML Services Test server for customer certification: https://xmlpitest-ea.dhl.com/XMLShippingServlet -[Quote Requests](docs/quote.md) +[Quote Requests (v6.1)](docs/quote.md) -[Route Requests](docs/route.md) +[Route Requests (v1.0)](docs/route.md) -[Shipment Requests](docs/shipment.md) +[Shipment Requests (v6.2)](docs/shipment.md) -[Pickup Request](docs/pickup.md) +[Pickup Request (v1.0)](docs/pickup.md) -[Tracking Requests](docs/tracking.md) +[Tracking Requests (v1.0)](docs/tracking.md) ## Contributing From a66238368e9cc955affa70c488fa870e740c1b52 Mon Sep 17 00:00:00 2001 From: Martins Fridenbergs Date: Tue, 23 Apr 2019 09:21:06 +0300 Subject: [PATCH 11/42] Update Service xsd for DHL Route request --- src/Entity/GB/RouteRequest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Entity/GB/RouteRequest.php b/src/Entity/GB/RouteRequest.php index c944cae..2e2957b 100644 --- a/src/Entity/GB/RouteRequest.php +++ b/src/Entity/GB/RouteRequest.php @@ -27,7 +27,7 @@ class RouteRequest extends Base * @var string * Service XSD */ - protected $service_xsd = 'RouteRequest.xsd'; + protected $service_xsd = 'routing-global-req-2.0.xsd'; /** * Display Schema version or not From ec017178eb4a3269e89cd3d620f944a05d409de8 Mon Sep 17 00:00:00 2001 From: Martins Fridenbergs Date: Wed, 24 Apr 2019 14:56:14 +0300 Subject: [PATCH 12/42] Line endings to LF and shipment update based on DHL feedback --- README_old.md | 315 ------------------------------ src/Client/Web.php | 2 - src/Entity/Base.php | 18 +- src/Entity/GB/ShipmentRequest.php | 22 +++ 4 files changed, 38 insertions(+), 319 deletions(-) delete mode 100644 README_old.md diff --git a/README_old.md b/README_old.md deleted file mode 100644 index ff6c085..0000000 --- a/README_old.md +++ /dev/null @@ -1,315 +0,0 @@ - - -## 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/src/Client/Web.php b/src/Client/Web.php index 959550f..9edb302 100644 --- a/src/Client/Web.php +++ b/src/Client/Web.php @@ -60,13 +60,11 @@ public function call(Request $request) curl_setopt($ch, CURLOPT_POSTFIELDS, $request->toXML()); $result = curl_exec($ch); - error_log($request->toXML(), null, './dhl_logs'); if (curl_error($ch)) { return false; } else { curl_close($ch); } - error_log($result, null, './dhl_logs'); return $result; } diff --git a/src/Entity/Base.php b/src/Entity/Base.php index e3e4775..a2d4980 100644 --- a/src/Entity/Base.php +++ b/src/Entity/Base.php @@ -48,6 +48,12 @@ abstract class Base extends BaseDataType ], ]; + /** + * Parameters to be used in the header + * @var array + */ + protected $header_meta_params = []; + /** * Parameters to be used in the body * @@ -104,7 +110,7 @@ abstract class Base extends BaseDataType */ public function __construct() { - $this->params = array_merge($this->header_params, $this->body_params); + $this->params = array_merge($this->header_params, $this->header_meta_params, $this->body_params); $this->initializeValues(); } @@ -142,9 +148,17 @@ public function toXML(\XMLWriter $xml_writer = null) foreach ($this->header_params as $name => $infos) { $xml_writer->writeElement($name, $this->$name); } - $xml_writer->endElement(); // End of Request $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)) { diff --git a/src/Entity/GB/ShipmentRequest.php b/src/Entity/GB/ShipmentRequest.php index a41c301..26417ab 100644 --- a/src/Entity/GB/ShipmentRequest.php +++ b/src/Entity/GB/ShipmentRequest.php @@ -35,6 +35,28 @@ class ShipmentRequest extends Base */ protected $display_schema_version = true; + /** + * @var array + */ + protected $header_meta_params = [ + 'SoftwareName' => [ + 'type' => 'string', + 'required' => true, + 'subobject' => false, + ], + 'SoftwareVersion' => [ + 'type' => 'string', + 'required' => true, + 'subobject' => false, + ], + ]; + + /** + * @var string + * The schema version + */ + protected $schema_version = '6.2'; + /** * Parameters to be send in the body * @var array From 1501d58498e0201dc519ce8fa353f82699b067c4 Mon Sep 17 00:00:00 2001 From: Martins Fridenbergs Date: Wed, 9 Jun 2021 11:27:49 +0300 Subject: [PATCH 13/42] PSR12 implementation --- composer.json | 7 ++- src/Client/Web.php | 20 ++++----- src/Datatype/AM/AWBInfo.php | 2 +- src/Datatype/AM/BarCodes.php | 2 +- src/Datatype/AM/Billing.php | 2 +- src/Datatype/AM/BkgDetailsType.php | 2 +- src/Datatype/AM/ChargeCard.php | 2 +- src/Datatype/AM/Commodity.php | 2 +- src/Datatype/AM/Condition.php | 2 +- src/Datatype/AM/Consignee.php | 2 +- src/Datatype/AM/Contact.php | 2 +- src/Datatype/AM/Customer.php | 2 +- src/Datatype/AM/CustomerLogo.php | 2 +- src/Datatype/AM/DCTDutiable.php | 2 +- src/Datatype/AM/DCTFrom.php | 2 +- src/Datatype/AM/DCTTo.php | 2 +- src/Datatype/AM/DestinationServiceArea.php | 2 +- src/Datatype/AM/DocImage.php | 2 +- src/Datatype/AM/DocImages.php | 2 +- src/Datatype/AM/Dutiable.php | 2 +- src/Datatype/AM/Email.php | 2 +- src/Datatype/AM/ErrorResponse.php | 2 +- src/Datatype/AM/EventRemarks.php | 2 +- src/Datatype/AM/ExportDeclaration.php | 2 +- src/Datatype/AM/ExportLineItem.php | 2 +- src/Datatype/AM/Fault.php | 2 +- src/Datatype/AM/Label.php | 5 ++- src/Datatype/AM/LabelImage.php | 2 +- src/Datatype/AM/Note.php | 2 +- src/Datatype/AM/OriginServiceArea.php | 2 +- src/Datatype/AM/Piece.php | 7 ++- src/Datatype/AM/PieceDetails.php | 7 ++- src/Datatype/AM/PieceEvent.php | 2 +- src/Datatype/AM/PieceFault.php | 2 +- src/Datatype/AM/PieceInfo.php | 2 +- src/Datatype/AM/PieceType.php | 2 +- src/Datatype/AM/Pieces.php | 2 +- src/Datatype/AM/Place.php | 5 ++- src/Datatype/AM/QtdSInAdCur.php | 2 +- src/Datatype/AM/QtdShpExChrgType.php | 2 +- src/Datatype/AM/QtdShpType.php | 2 +- src/Datatype/AM/Reference.php | 2 +- src/Datatype/AM/Request.php | 2 +- src/Datatype/AM/Response.php | 2 +- src/Datatype/AM/ServiceArea.php | 2 +- src/Datatype/AM/ServiceEvent.php | 3 +- src/Datatype/AM/ServiceHeader.php | 2 +- src/Datatype/AM/ShipValResponsePiece.php | 7 ++- src/Datatype/AM/ShipValResponsePieces.php | 2 +- src/Datatype/AM/Shipment.php | 2 +- src/Datatype/AM/ShipmentDate.php | 2 +- src/Datatype/AM/ShipmentDetails.php | 11 +++-- src/Datatype/AM/ShipmentEvent.php | 2 +- src/Datatype/AM/ShipmentInfo.php | 2 +- src/Datatype/AM/Shipper.php | 2 +- src/Datatype/AM/SpecialService.php | 2 +- src/Datatype/AM/Status.php | 2 +- src/Datatype/AM/TrackingPieces.php | 2 +- src/Datatype/AM/WeightSeg.php | 2 +- src/Datatype/AP/ShipmentDetails.php | 10 +++-- src/Datatype/Base.php | 50 ++++++++++++++++------ src/Datatype/EA/ShipmentDetails.php | 10 +++-- src/Datatype/GB/AdditionalProtection.php | 2 +- src/Datatype/GB/BarCode.php | 2 +- src/Datatype/GB/ChargeCard.php | 1 + src/Datatype/GB/Dutiable.php | 24 +++++------ src/Datatype/GB/ExportDeclaration.php | 22 +++++----- src/Datatype/GB/ExportLineItem.php | 24 +++++------ src/Datatype/GB/Filing.php | 14 +++--- src/Datatype/GB/Notification.php | 7 +-- src/Datatype/GB/OriginServiceArea.php | 8 ++-- src/Datatype/GB/PUShipmentDetails.php | 2 +- src/Datatype/GB/Piece.php | 16 +++---- src/Datatype/GB/PieceDetails.php | 18 ++++---- src/Datatype/GB/PieceFault.php | 6 +-- src/Datatype/GB/Pieces.php | 2 +- src/Datatype/GB/QtdSInAdCur.php | 8 ++-- src/Datatype/GB/Requestor.php | 2 +- src/Datatype/GB/RequestorContact.php | 2 +- src/Datatype/GB/Response.php | 2 +- src/Datatype/GB/ResponseServiceHeader.php | 9 ++-- src/Datatype/GB/ShipValResponsePiece.php | 24 +++++------ src/Datatype/GB/Shipment.php | 32 +++++++------- src/Datatype/GB/ShipmentDate.php | 4 +- src/Datatype/GB/ShipmentDetails.php | 41 +++++++++--------- src/Datatype/GB/ShipmentEvent.php | 10 ++--- src/Datatype/GB/ShipmentInfo.php | 20 ++++----- src/Datatype/GB/Shipper.php | 34 +++++++-------- src/Datatype/GB/SpecialService.php | 14 +++--- src/Datatype/GB/WeightSeg.php | 4 +- src/Entity/Base.php | 27 +++++++++--- src/Entity/GB/CancelPURequest.php | 2 +- src/Service.php | 2 +- 93 files changed, 348 insertions(+), 279 deletions(-) diff --git a/composer.json b/composer.json index db2f802..76aa969 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,12 @@ "name": "mtcmedia/dhl-api", "description": "PHP library to communicate with the DHL XML Services.", "require": { - "php": ">=7.0" + "php": ">=7.1", + "ext-xmlwriter": "*", + "ext-curl": "*" + }, + "require-dev": { + "squizlabs/php_codesniffer": "^3.5" }, "license": "MIT", "autoload": { diff --git a/src/Client/Web.php b/src/Client/Web.php index 9edb302..409604b 100644 --- a/src/Client/Web.php +++ b/src/Client/Web.php @@ -13,19 +13,19 @@ class Web * Url to services * @var string */ - private $_stagingUrl = 'https://xmlpitest-ea.dhl.com/XMLShippingServlet?isUTF8Support=true'; + private $stagingUrl = 'https://xmlpitest-ea.dhl.com/XMLShippingServlet?isUTF8Support=true'; /** * Url to services * @var string */ - private $_productionUrl = 'https://xmlpi-ea.dhl.com/XMLShippingServlet?isUTF8Support=true'; + private $productionUrl = 'https://xmlpi-ea.dhl.com/XMLShippingServlet?isUTF8Support=true'; /** * Use production server or staging * @var string */ - protected $_mode = 'staging'; + protected $mode = 'staging'; /** * Class constructor @@ -35,9 +35,10 @@ class Web public function __construct($mode = 'staging') { if (!in_array($mode, array('staging', 'production'))) { - throw new \InvalidArgumentException('Invalid mode : ' . $mode . '. Accepted values are : staging or production.'); + $message = 'Invalid mode : ' . $mode . '. Accepted values are : staging or production.'; + throw new \InvalidArgumentException($message); } - $this->_mode = $mode; + $this->mode = $mode; } /** @@ -54,7 +55,7 @@ public function call(Request $request) } curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - curl_setopt($ch, CURLOPT_URL, $this->_getUrl()); + 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()); @@ -62,9 +63,8 @@ public function call(Request $request) if (curl_error($ch)) { return false; - } else { - curl_close($ch); } + curl_close($ch); return $result; } @@ -74,8 +74,8 @@ public function call(Request $request) * * @return string URL for the service */ - private function _getUrl() + private function getUrl() { - return ('staging' == $this->_mode) ? $this->_stagingUrl : $this->_productionUrl; + return ('staging' === $this->mode) ? $this->stagingUrl : $this->productionUrl; } } diff --git a/src/Datatype/AM/AWBInfo.php b/src/Datatype/AM/AWBInfo.php index b34716b..9f582b9 100644 --- a/src/Datatype/AM/AWBInfo.php +++ b/src/Datatype/AM/AWBInfo.php @@ -13,7 +13,7 @@ class AWBInfo extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/BarCodes.php b/src/Datatype/AM/BarCodes.php index dd844d4..4acc02b 100644 --- a/src/Datatype/AM/BarCodes.php +++ b/src/Datatype/AM/BarCodes.php @@ -13,7 +13,7 @@ class BarCodes extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/Billing.php b/src/Datatype/AM/Billing.php index 2a0ea8e..f78d32c 100644 --- a/src/Datatype/AM/Billing.php +++ b/src/Datatype/AM/Billing.php @@ -13,7 +13,7 @@ class Billing extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/BkgDetailsType.php b/src/Datatype/AM/BkgDetailsType.php index d8f614e..15044fc 100644 --- a/src/Datatype/AM/BkgDetailsType.php +++ b/src/Datatype/AM/BkgDetailsType.php @@ -13,7 +13,7 @@ class BkgDetailsType extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parent node name of the object diff --git a/src/Datatype/AM/ChargeCard.php b/src/Datatype/AM/ChargeCard.php index 1540589..e11f911 100644 --- a/src/Datatype/AM/ChargeCard.php +++ b/src/Datatype/AM/ChargeCard.php @@ -13,7 +13,7 @@ class ChargeCard extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/Commodity.php b/src/Datatype/AM/Commodity.php index 665c8a7..cae2810 100644 --- a/src/Datatype/AM/Commodity.php +++ b/src/Datatype/AM/Commodity.php @@ -13,7 +13,7 @@ class Commodity extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/Condition.php b/src/Datatype/AM/Condition.php index 8ebec51..18ed5a3 100644 --- a/src/Datatype/AM/Condition.php +++ b/src/Datatype/AM/Condition.php @@ -13,7 +13,7 @@ class Condition extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/Consignee.php b/src/Datatype/AM/Consignee.php index 72db432..0b457b2 100644 --- a/src/Datatype/AM/Consignee.php +++ b/src/Datatype/AM/Consignee.php @@ -13,7 +13,7 @@ class Consignee extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/Contact.php b/src/Datatype/AM/Contact.php index d1fea09..bae3bbc 100644 --- a/src/Datatype/AM/Contact.php +++ b/src/Datatype/AM/Contact.php @@ -13,7 +13,7 @@ class Contact extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/Customer.php b/src/Datatype/AM/Customer.php index 4e99425..4e96b9c 100644 --- a/src/Datatype/AM/Customer.php +++ b/src/Datatype/AM/Customer.php @@ -13,7 +13,7 @@ class Customer extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/CustomerLogo.php b/src/Datatype/AM/CustomerLogo.php index bfdbf4b..f5e1eb0 100644 --- a/src/Datatype/AM/CustomerLogo.php +++ b/src/Datatype/AM/CustomerLogo.php @@ -13,7 +13,7 @@ class CustomerLogo extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/DCTDutiable.php b/src/Datatype/AM/DCTDutiable.php index 2baaee0..d82f32f 100644 --- a/src/Datatype/AM/DCTDutiable.php +++ b/src/Datatype/AM/DCTDutiable.php @@ -13,7 +13,7 @@ class DCTDutiable extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parent node name of the object diff --git a/src/Datatype/AM/DCTFrom.php b/src/Datatype/AM/DCTFrom.php index ffaf9af..9afc022 100644 --- a/src/Datatype/AM/DCTFrom.php +++ b/src/Datatype/AM/DCTFrom.php @@ -13,7 +13,7 @@ class DCTFrom extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parent node name of the object diff --git a/src/Datatype/AM/DCTTo.php b/src/Datatype/AM/DCTTo.php index 322c24d..1a3d0dc 100644 --- a/src/Datatype/AM/DCTTo.php +++ b/src/Datatype/AM/DCTTo.php @@ -13,7 +13,7 @@ class DCTTo extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parent node name of the object diff --git a/src/Datatype/AM/DestinationServiceArea.php b/src/Datatype/AM/DestinationServiceArea.php index 0779433..2243e43 100644 --- a/src/Datatype/AM/DestinationServiceArea.php +++ b/src/Datatype/AM/DestinationServiceArea.php @@ -13,7 +13,7 @@ class DestinationServiceArea extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/DocImage.php b/src/Datatype/AM/DocImage.php index 52332ed..c7c7f82 100644 --- a/src/Datatype/AM/DocImage.php +++ b/src/Datatype/AM/DocImage.php @@ -13,7 +13,7 @@ class DocImage extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/DocImages.php b/src/Datatype/AM/DocImages.php index fa5dd9f..1140af0 100644 --- a/src/Datatype/AM/DocImages.php +++ b/src/Datatype/AM/DocImages.php @@ -13,7 +13,7 @@ class DocImages extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/Dutiable.php b/src/Datatype/AM/Dutiable.php index 2ef49aa..88f591d 100644 --- a/src/Datatype/AM/Dutiable.php +++ b/src/Datatype/AM/Dutiable.php @@ -13,7 +13,7 @@ class Dutiable extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/Email.php b/src/Datatype/AM/Email.php index a2de847..3da9639 100644 --- a/src/Datatype/AM/Email.php +++ b/src/Datatype/AM/Email.php @@ -13,7 +13,7 @@ class Email extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/ErrorResponse.php b/src/Datatype/AM/ErrorResponse.php index 3d8d052..a67aebe 100644 --- a/src/Datatype/AM/ErrorResponse.php +++ b/src/Datatype/AM/ErrorResponse.php @@ -13,7 +13,7 @@ class ErrorResponse extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/EventRemarks.php b/src/Datatype/AM/EventRemarks.php index f8a3f1b..d17491a 100644 --- a/src/Datatype/AM/EventRemarks.php +++ b/src/Datatype/AM/EventRemarks.php @@ -13,7 +13,7 @@ class EventRemarks extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/ExportDeclaration.php b/src/Datatype/AM/ExportDeclaration.php index 73121c0..4e2e9fb 100644 --- a/src/Datatype/AM/ExportDeclaration.php +++ b/src/Datatype/AM/ExportDeclaration.php @@ -13,7 +13,7 @@ class ExportDeclaration extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/ExportLineItem.php b/src/Datatype/AM/ExportLineItem.php index 26908d4..7b26feb 100644 --- a/src/Datatype/AM/ExportLineItem.php +++ b/src/Datatype/AM/ExportLineItem.php @@ -13,7 +13,7 @@ class ExportLineItem extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/Fault.php b/src/Datatype/AM/Fault.php index 9a2458b..74cc17a 100644 --- a/src/Datatype/AM/Fault.php +++ b/src/Datatype/AM/Fault.php @@ -13,7 +13,7 @@ class Fault extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/Label.php b/src/Datatype/AM/Label.php index 22d3d70..402334d 100644 --- a/src/Datatype/AM/Label.php +++ b/src/Datatype/AM/Label.php @@ -13,7 +13,7 @@ class Label extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype @@ -25,7 +25,8 @@ class Label extends Base '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', + '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', diff --git a/src/Datatype/AM/LabelImage.php b/src/Datatype/AM/LabelImage.php index fd88390..086754b 100644 --- a/src/Datatype/AM/LabelImage.php +++ b/src/Datatype/AM/LabelImage.php @@ -13,7 +13,7 @@ class LabelImage extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/Note.php b/src/Datatype/AM/Note.php index beed3e5..d96c6ab 100644 --- a/src/Datatype/AM/Note.php +++ b/src/Datatype/AM/Note.php @@ -13,7 +13,7 @@ class Note extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/OriginServiceArea.php b/src/Datatype/AM/OriginServiceArea.php index 52ecfa2..b9ce835 100644 --- a/src/Datatype/AM/OriginServiceArea.php +++ b/src/Datatype/AM/OriginServiceArea.php @@ -13,7 +13,7 @@ class OriginServiceArea extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/Piece.php b/src/Datatype/AM/Piece.php index 3be838a..2d21860 100644 --- a/src/Datatype/AM/Piece.php +++ b/src/Datatype/AM/Piece.php @@ -13,7 +13,7 @@ class Piece extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype @@ -31,7 +31,10 @@ class Piece extends Base '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', ], diff --git a/src/Datatype/AM/PieceDetails.php b/src/Datatype/AM/PieceDetails.php index 5a2bc06..21a7c5d 100644 --- a/src/Datatype/AM/PieceDetails.php +++ b/src/Datatype/AM/PieceDetails.php @@ -13,7 +13,7 @@ class PieceDetails extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype @@ -82,7 +82,10 @@ class PieceDetails extends Base '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', ], diff --git a/src/Datatype/AM/PieceEvent.php b/src/Datatype/AM/PieceEvent.php index 80b271c..7a47cec 100644 --- a/src/Datatype/AM/PieceEvent.php +++ b/src/Datatype/AM/PieceEvent.php @@ -13,7 +13,7 @@ class PieceEvent extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/PieceFault.php b/src/Datatype/AM/PieceFault.php index c4c8874..2bc701c 100644 --- a/src/Datatype/AM/PieceFault.php +++ b/src/Datatype/AM/PieceFault.php @@ -13,7 +13,7 @@ class PieceFault extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/PieceInfo.php b/src/Datatype/AM/PieceInfo.php index ee4244b..8ed0a9f 100644 --- a/src/Datatype/AM/PieceInfo.php +++ b/src/Datatype/AM/PieceInfo.php @@ -13,7 +13,7 @@ class PieceInfo extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/PieceType.php b/src/Datatype/AM/PieceType.php index e6e230c..7b337b3 100644 --- a/src/Datatype/AM/PieceType.php +++ b/src/Datatype/AM/PieceType.php @@ -13,7 +13,7 @@ class PieceType extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parent node name of the object diff --git a/src/Datatype/AM/Pieces.php b/src/Datatype/AM/Pieces.php index 2c4b50b..b86c074 100644 --- a/src/Datatype/AM/Pieces.php +++ b/src/Datatype/AM/Pieces.php @@ -13,7 +13,7 @@ class Pieces extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/Place.php b/src/Datatype/AM/Place.php index 982b392..2c2b691 100644 --- a/src/Datatype/AM/Place.php +++ b/src/Datatype/AM/Place.php @@ -13,7 +13,7 @@ class Place extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype @@ -24,7 +24,8 @@ class Place extends Base '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', ], diff --git a/src/Datatype/AM/QtdSInAdCur.php b/src/Datatype/AM/QtdSInAdCur.php index e7b5f06..b462649 100644 --- a/src/Datatype/AM/QtdSInAdCur.php +++ b/src/Datatype/AM/QtdSInAdCur.php @@ -13,7 +13,7 @@ class QtdSInAdCur extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/QtdShpExChrgType.php b/src/Datatype/AM/QtdShpExChrgType.php index bd0f5ba..eaecf39 100644 --- a/src/Datatype/AM/QtdShpExChrgType.php +++ b/src/Datatype/AM/QtdShpExChrgType.php @@ -13,7 +13,7 @@ class QtdShpExChrgType extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parent node name of the object diff --git a/src/Datatype/AM/QtdShpType.php b/src/Datatype/AM/QtdShpType.php index 030d1ef..049cc52 100644 --- a/src/Datatype/AM/QtdShpType.php +++ b/src/Datatype/AM/QtdShpType.php @@ -13,7 +13,7 @@ class QtdShpType extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parent node name of the object diff --git a/src/Datatype/AM/Reference.php b/src/Datatype/AM/Reference.php index 1b4c32d..5dfa770 100644 --- a/src/Datatype/AM/Reference.php +++ b/src/Datatype/AM/Reference.php @@ -13,7 +13,7 @@ class Reference extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/Request.php b/src/Datatype/AM/Request.php index 08bdb69..2e5012a 100644 --- a/src/Datatype/AM/Request.php +++ b/src/Datatype/AM/Request.php @@ -13,7 +13,7 @@ class Request extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/Response.php b/src/Datatype/AM/Response.php index d822a1e..60fbe97 100644 --- a/src/Datatype/AM/Response.php +++ b/src/Datatype/AM/Response.php @@ -13,7 +13,7 @@ class Response extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/ServiceArea.php b/src/Datatype/AM/ServiceArea.php index e41d2e3..47e1175 100644 --- a/src/Datatype/AM/ServiceArea.php +++ b/src/Datatype/AM/ServiceArea.php @@ -13,7 +13,7 @@ class ServiceArea extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/ServiceEvent.php b/src/Datatype/AM/ServiceEvent.php index d461537..b9807d8 100644 --- a/src/Datatype/AM/ServiceEvent.php +++ b/src/Datatype/AM/ServiceEvent.php @@ -1,4 +1,5 @@ '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', ], diff --git a/src/Datatype/AM/ShipValResponsePieces.php b/src/Datatype/AM/ShipValResponsePieces.php index d1eddbc..42de66e 100644 --- a/src/Datatype/AM/ShipValResponsePieces.php +++ b/src/Datatype/AM/ShipValResponsePieces.php @@ -13,7 +13,7 @@ class ShipValResponsePieces extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/Shipment.php b/src/Datatype/AM/Shipment.php index 391233e..26347c4 100644 --- a/src/Datatype/AM/Shipment.php +++ b/src/Datatype/AM/Shipment.php @@ -13,7 +13,7 @@ class Shipment extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/ShipmentDate.php b/src/Datatype/AM/ShipmentDate.php index cfdfd96..9cfafe9 100644 --- a/src/Datatype/AM/ShipmentDate.php +++ b/src/Datatype/AM/ShipmentDate.php @@ -13,7 +13,7 @@ class ShipmentDate extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/ShipmentDetails.php b/src/Datatype/AM/ShipmentDetails.php index 913d07f..ad1f59d 100644 --- a/src/Datatype/AM/ShipmentDetails.php +++ b/src/Datatype/AM/ShipmentDetails.php @@ -15,7 +15,7 @@ class ShipmentDetails extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype @@ -56,7 +56,7 @@ class ShipmentDetails extends Base '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 @@ -71,7 +71,7 @@ class ShipmentDetails extends Base '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 @@ -129,7 +129,10 @@ class ShipmentDetails extends Base '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', ], diff --git a/src/Datatype/AM/ShipmentEvent.php b/src/Datatype/AM/ShipmentEvent.php index d3b4efd..637ca03 100644 --- a/src/Datatype/AM/ShipmentEvent.php +++ b/src/Datatype/AM/ShipmentEvent.php @@ -13,7 +13,7 @@ class ShipmentEvent extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/ShipmentInfo.php b/src/Datatype/AM/ShipmentInfo.php index 39c75c7..55db2c4 100644 --- a/src/Datatype/AM/ShipmentInfo.php +++ b/src/Datatype/AM/ShipmentInfo.php @@ -13,7 +13,7 @@ class ShipmentInfo extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/Shipper.php b/src/Datatype/AM/Shipper.php index 982e932..8808be8 100644 --- a/src/Datatype/AM/Shipper.php +++ b/src/Datatype/AM/Shipper.php @@ -13,7 +13,7 @@ class Shipper extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/SpecialService.php b/src/Datatype/AM/SpecialService.php index 4322e0d..1193e26 100644 --- a/src/Datatype/AM/SpecialService.php +++ b/src/Datatype/AM/SpecialService.php @@ -13,7 +13,7 @@ class SpecialService extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/Status.php b/src/Datatype/AM/Status.php index 8a7abfc..b5e66ac 100644 --- a/src/Datatype/AM/Status.php +++ b/src/Datatype/AM/Status.php @@ -13,7 +13,7 @@ class Status extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/TrackingPieces.php b/src/Datatype/AM/TrackingPieces.php index b2d136d..752b58c 100644 --- a/src/Datatype/AM/TrackingPieces.php +++ b/src/Datatype/AM/TrackingPieces.php @@ -13,7 +13,7 @@ class TrackingPieces extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AM/WeightSeg.php b/src/Datatype/AM/WeightSeg.php index 448f4d7..6aaec47 100644 --- a/src/Datatype/AM/WeightSeg.php +++ b/src/Datatype/AM/WeightSeg.php @@ -13,7 +13,7 @@ class WeightSeg extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/AP/ShipmentDetails.php b/src/Datatype/AP/ShipmentDetails.php index a7bce02..3c568b5 100644 --- a/src/Datatype/AP/ShipmentDetails.php +++ b/src/Datatype/AP/ShipmentDetails.php @@ -1,6 +1,5 @@ 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 @@ -63,7 +62,7 @@ class ShipmentDetails extends \Mtc\Dhl\Datatype\AM\ShipmentDetails '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 @@ -121,7 +120,10 @@ class ShipmentDetails extends \Mtc\Dhl\Datatype\AM\ShipmentDetails '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', ], diff --git a/src/Datatype/Base.php b/src/Datatype/Base.php index cbd0365..a0004f5 100644 --- a/src/Datatype/Base.php +++ b/src/Datatype/Base.php @@ -90,7 +90,10 @@ public function toXML(\XMLWriter $xmlWriter = null) $xmlWriter->writeElement($name, $sub_element); } } else { - if (!isset($this->params[$name]['disableParentNode']) || false == $this->params[$name]['disableParentNode']) { + if ( + !isset($this->params[$name]['disableParentNode']) + || false == $this->params[$name]['disableParentNode'] + ) { $xmlWriter->startElement($name); } @@ -98,7 +101,10 @@ public function toXML(\XMLWriter $xmlWriter = null) $sub_element->toXML($xmlWriter); } - if (!isset($this->params[$name]['disableParentNode']) || false == $this->params[$name]['disableParentNode']) { + if ( + !isset($this->params[$name]['disableParentNode']) + || false == $this->params[$name]['disableParentNode'] + ) { $xmlWriter->endElement(); } } @@ -163,10 +169,12 @@ public function __call($name, $arguments) { $key = str_replace('add', '', $name); - if (isset($this->params[$key . 's']) + if ( + isset($this->params[$key . 's']) && $this->params[$key . 's']['type'] !== 'string' && isset($this->params[$key . 's']['multivalues']) - && true === $this->params[$key . 's']['multivalues']) { + && true === $this->params[$key . 's']['multivalues'] + ) { $key .= 's'; } @@ -184,7 +192,8 @@ public function __call($name, $arguments) 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); + $message = 'This is not a multivalues field : ' . $key . ' called via method ' . $name; + throw new \InvalidArgumentException($message); } } @@ -193,7 +202,7 @@ public function __call($name, $arguments) * * @param string $key Key to check * - * @return bolean True if it exsits, false otherwise + * @return bool True if it exsits, false otherwise */ final public function __isset($key) { @@ -300,7 +309,11 @@ protected function validateParameterType($key, $value) switch ($this->params[$key]['type']) { case 'string': - if (is_array($value) && isset($this->params[$key]['multivalues']) && true === $this->params[$key]['multivalues']) { + 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 : ' @@ -337,7 +350,8 @@ protected function validateParameterType($key, $value) $currentClass = get_class($value); $parts = explode('\\', $currentClass); array_pop($parts); - $className = str_replace('Entity', 'DataType', implode('\\', $parts) . '\\' . $this->params[$key]['type']); + $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) . '"'); @@ -365,25 +379,33 @@ protected function validateParameterValue($key, $value) 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); + $message = 'Field ' . $key . ' cannot be set to value : ' . $value + . '. Accepted values are : ' . $typeValue; + throw new \InvalidArgumentException($message); } 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); + $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) { - throw new \InvalidArgumentException('Field ' . $key . ' has a size of ' . strlen($value) . ' and it cannot exceed this size : ' . $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) { - throw new \InvalidArgumentException('Field ' . $key . ' has a size of ' . strlen($value) . ' and it cannot be less than this size : ' . $typeValue); + $message = 'Field ' . $key . ' has a size of ' . strlen($value) + . ' and it cannot be less than this size : ' . $typeValue; + throw new \InvalidArgumentException($message); } break; @@ -403,7 +425,9 @@ protected function validateParameterValue($key, $value) $matches = []; $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); + $message = 'Field ' . $key . ' should match regex pattern : ' . $typeValue + . ' and it has a value of ' . $value; + throw new \InvalidArgumentException($message); } break; } diff --git a/src/Datatype/EA/ShipmentDetails.php b/src/Datatype/EA/ShipmentDetails.php index f832298..de57f77 100644 --- a/src/Datatype/EA/ShipmentDetails.php +++ b/src/Datatype/EA/ShipmentDetails.php @@ -1,4 +1,5 @@ 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 @@ -61,7 +62,7 @@ class ShipmentDetails extends \Mtc\Dhl\Datatype\AM\ShipmentDetails '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 @@ -119,7 +120,10 @@ class ShipmentDetails extends \Mtc\Dhl\Datatype\AM\ShipmentDetails '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', ], diff --git a/src/Datatype/GB/AdditionalProtection.php b/src/Datatype/GB/AdditionalProtection.php index dd301b2..ef8a67b 100644 --- a/src/Datatype/GB/AdditionalProtection.php +++ b/src/Datatype/GB/AdditionalProtection.php @@ -15,7 +15,7 @@ class AdditionalProtection extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/GB/BarCode.php b/src/Datatype/GB/BarCode.php index 63769d9..6e882e3 100644 --- a/src/Datatype/GB/BarCode.php +++ b/src/Datatype/GB/BarCode.php @@ -15,7 +15,7 @@ class BarCode extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/GB/ChargeCard.php b/src/Datatype/GB/ChargeCard.php index 329d68c..07ad892 100644 --- a/src/Datatype/GB/ChargeCard.php +++ b/src/Datatype/GB/ChargeCard.php @@ -1,6 +1,7 @@ 'DeclaredValue', 'minInclusive' => '0.00', 'maxInclusive' => '9999999999.99', - ], + ], 'DeclaredCurrency' => [ 'type' => 'CurrencyCode', 'required' => false, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ], + ], 'ScheduleB' => [ 'type' => 'ScheduleB', 'required' => false, 'subobject' => false, 'comment' => 'Schedule B numner', 'maxLength' => '15', - ], + ], 'ExportLicense' => [ 'type' => 'ExportLicense', 'required' => false, 'subobject' => false, 'comment' => 'ExportLicense', 'maxLength' => '16', - ], + ], 'ShipperEIN' => [ 'type' => '', 'required' => false, 'subobject' => false, - ], + ], 'ShipperIDType' => [ 'type' => '', 'required' => false, 'subobject' => false, - ], + ], 'ConsigneeIDType' => [ 'type' => '', 'required' => false, 'subobject' => false, - ], + ], 'ImportLicense' => [ 'type' => 'ImportLicense', 'required' => false, 'subobject' => false, 'comment' => '\"ImportLicense\"', 'maxLength' => '16', - ], + ], 'ConsigneeEIN' => [ 'type' => '', 'required' => false, 'subobject' => false, - ], + ], 'TermsOfTrade' => [ 'type' => 'TermsOfTrade', 'required' => false, 'subobject' => false, 'comment' => '\"TermsOfTrade\"', 'maxLength' => '3', - ], + ], 'CommerceLicensed' => [ 'type' => 'YesNo', 'required' => false, @@ -85,11 +85,11 @@ class Dutiable extends \Mtc\Dhl\Datatype\AM\Dutiable 'comment' => 'Boolean flag', 'length' => '1', 'enumeration' => 'Y,N', - ], + ], 'Filing' => [ 'type' => 'Filing', 'required' => false, 'subobject' => true, - ], + ], ]; } diff --git a/src/Datatype/GB/ExportDeclaration.php b/src/Datatype/GB/ExportDeclaration.php index 6bf202f..4ec1b98 100644 --- a/src/Datatype/GB/ExportDeclaration.php +++ b/src/Datatype/GB/ExportDeclaration.php @@ -18,7 +18,7 @@ class ExportDeclaration extends \Mtc\Dhl\Datatype\AM\ExportDeclaration 'type' => '', 'required' => false, 'subobject' => false, - ], + ], 'IsPartiesRelation' => [ 'type' => 'YesNo', 'required' => false, @@ -26,33 +26,33 @@ class ExportDeclaration extends \Mtc\Dhl\Datatype\AM\ExportDeclaration 'comment' => 'Boolean flag', 'length' => '1', 'enumeration' => 'Y,N', - ], + ], 'ECCN' => [ 'type' => '', 'required' => false, 'subobject' => false, - ], + ], 'SignatureName' => [ 'type' => 'SignatureName', 'required' => false, 'subobject' => false, 'comment' => 'Signature name', 'maxLength' => '35', - ], + ], 'SignatureTitle' => [ 'type' => 'SignatureTitle', 'required' => false, 'subobject' => false, 'comment' => 'Signature title', 'maxLength' => '35', - ], + ], 'ExportReason' => [ 'type' => 'ExportReason', 'required' => false, 'subobject' => false, 'comment' => 'Export reason', 'length' => '1', - ], + ], 'ExportReasonCode' => [ 'type' => 'ExportReasonCode', 'required' => false, @@ -60,14 +60,14 @@ class ExportDeclaration extends \Mtc\Dhl\Datatype\AM\ExportDeclaration 'comment' => 'Export reason code (P:Permanent, T:Temporary, R:Re-Export)', 'length' => '1', 'enumeration' => 'P,T,R', - ], + ], 'SedNumber' => [ 'type' => 'SEDNumber', 'required' => false, 'subobject' => false, 'comment' => '', 'enumeration' => 'FTSR,XTN,SAS,ITN', - ], + ], 'SedNumberType' => [ 'type' => 'SEDNumberType', 'required' => false, @@ -75,18 +75,18 @@ class ExportDeclaration extends \Mtc\Dhl\Datatype\AM\ExportDeclaration 'comment' => '', 'length' => '1', 'enumeration' => 'F,X,S,I', - ], + ], 'MxStateCode' => [ 'type' => '', 'required' => false, 'subobject' => false, - ], + ], 'ExportLineItems' => [ 'type' => 'ExportLineItem', 'required' => false, 'subobject' => true, 'multivalues' => true, 'disableParentNode' => true, - ], + ], ]; } diff --git a/src/Datatype/GB/ExportLineItem.php b/src/Datatype/GB/ExportLineItem.php index 9c276c9..92b68f8 100644 --- a/src/Datatype/GB/ExportLineItem.php +++ b/src/Datatype/GB/ExportLineItem.php @@ -21,31 +21,31 @@ class ExportLineItem extends \Mtc\Dhl\Datatype\AM\ExportLineItem 'comment' => '', 'minInclusive' => '1', 'maxInclusive' => '200', - ], + ], 'Quantity' => [ 'type' => 'Quantity', 'required' => false, 'subobject' => false, 'comment' => 'Quantity', 'maxInclusive' => '32000', - ], + ], 'QuantityUnit' => [ 'type' => 'QuantityUnit', 'required' => false, 'subobject' => false, 'comment' => 'Quantity unit of measure (tens, hundreds, thousands, etc.)', 'maxLength' => '8', - ], + ], 'Description' => [ 'type' => '', 'required' => false, 'subobject' => false, - ], + ], 'Value' => [ 'type' => '', 'required' => false, 'subobject' => false, - ], + ], 'IsDomestic' => [ 'type' => 'YesNo', 'required' => false, @@ -53,7 +53,7 @@ class ExportLineItem extends \Mtc\Dhl\Datatype\AM\ExportLineItem 'comment' => 'Boolean flag', 'length' => '1', 'enumeration' => 'Y,N', - ], + ], 'CommodityCode' => [ 'type' => 'CommodityCode', 'required' => false, @@ -61,35 +61,35 @@ class ExportLineItem extends \Mtc\Dhl\Datatype\AM\ExportLineItem 'comment' => 'Commodity codes for shipment type', 'minLength' => '1', 'maxLength' => '20', - ], + ], 'ScheduleB' => [ 'type' => 'ScheduleB', 'required' => false, 'subobject' => false, 'comment' => 'Schedule B numner', 'maxLength' => '15', - ], + ], 'ECCN' => [ 'type' => '', 'required' => false, 'subobject' => false, - ], + ], 'Weight' => [ 'type' => '', 'required' => false, 'subobject' => false, - ], + ], 'License' => [ 'type' => '', 'required' => false, 'subobject' => false, - ], + ], 'LicenseSymbol' => [ 'type' => 'LicenseNumber', 'required' => false, 'subobject' => false, 'comment' => 'Export license number', 'maxLength' => '16', - ], + ], ]; } diff --git a/src/Datatype/GB/Filing.php b/src/Datatype/GB/Filing.php index 200c290..d657806 100644 --- a/src/Datatype/GB/Filing.php +++ b/src/Datatype/GB/Filing.php @@ -1,4 +1,5 @@ '3', 'maxLength' => '4', 'enumeration' => 'FTR,ITN,AES4', - ], + ], 'FTSR' => [ 'type' => 'FTSR', 'required' => false, @@ -57,8 +58,9 @@ class Filing extends Base '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)', - ], + '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, @@ -66,7 +68,7 @@ class Filing extends Base 'comment' => 'ITN', 'length' => '15', 'pattern' => 'X[0-9]{14}', - ], + ], 'AES4EIN' => [ 'type' => 'AES4EIN', 'required' => false, @@ -74,6 +76,6 @@ class Filing extends Base 'comment' => 'AES4', 'minLength' => '1', 'maxLength' => '11', - ], + ], ]; } diff --git a/src/Datatype/GB/Notification.php b/src/Datatype/GB/Notification.php index 883f32f..a5b9688 100644 --- a/src/Datatype/GB/Notification.php +++ b/src/Datatype/GB/Notification.php @@ -1,4 +1,5 @@ false, 'comment' => 'Message', 'maxLength' => '250', - ], + ], 'Message' => [ 'type' => 'Message', 'required' => false, 'subobject' => false, 'comment' => 'Message', 'maxLength' => '250', - ], + ], ]; } diff --git a/src/Datatype/GB/OriginServiceArea.php b/src/Datatype/GB/OriginServiceArea.php index 73b1b8b..8e3d685 100644 --- a/src/Datatype/GB/OriginServiceArea.php +++ b/src/Datatype/GB/OriginServiceArea.php @@ -13,7 +13,7 @@ class OriginServiceArea extends \Mtc\Dhl\Datatype\AM\OriginServiceArea * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype @@ -26,18 +26,18 @@ class OriginServiceArea extends \Mtc\Dhl\Datatype\AM\OriginServiceArea '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/GB/PUShipmentDetails.php b/src/Datatype/GB/PUShipmentDetails.php index 8b871df..f364ada 100644 --- a/src/Datatype/GB/PUShipmentDetails.php +++ b/src/Datatype/GB/PUShipmentDetails.php @@ -15,7 +15,7 @@ class PUShipmentDetails extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parent node name of the object diff --git a/src/Datatype/GB/Piece.php b/src/Datatype/GB/Piece.php index 4ae9a8c..da930f2 100644 --- a/src/Datatype/GB/Piece.php +++ b/src/Datatype/GB/Piece.php @@ -21,7 +21,7 @@ class Piece extends \Mtc\Dhl\Datatype\AM\Piece 'subobject' => false, 'comment' => 'Piece ID', 'maxLength' => '35', - ], + ], 'PackageType' => [ 'type' => 'PackageType', 'required' => false, @@ -31,7 +31,7 @@ class Piece extends \Mtc\Dhl\Datatype\AM\Piece 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, @@ -41,7 +41,7 @@ class Piece extends \Mtc\Dhl\Datatype\AM\Piece 'minInclusive' => '0.000', 'maxInclusive' => '999999.999', 'totalDigits' => '10', - ], + ], 'DimWeight' => [ 'type' => 'Weight', 'required' => false, @@ -51,28 +51,28 @@ class Piece extends \Mtc\Dhl\Datatype\AM\Piece 'minInclusive' => '0.000', 'maxInclusive' => '999999.999', 'totalDigits' => '10', - ], + ], 'Width' => [ 'type' => 'positiveInteger', 'required' => false, 'subobject' => false, - ], + ], 'Height' => [ 'type' => 'positiveInteger', 'required' => false, 'subobject' => false, - ], + ], 'Depth' => [ 'type' => 'positiveInteger', 'required' => false, 'subobject' => false, - ], + ], 'PieceContents' => [ 'type' => 'PieceContents', 'required' => false, 'subobject' => false, 'comment' => 'Piece contents description', 'maxLength' => '35', - ], + ], ]; } diff --git a/src/Datatype/GB/PieceDetails.php b/src/Datatype/GB/PieceDetails.php index a0654e5..127113a 100644 --- a/src/Datatype/GB/PieceDetails.php +++ b/src/Datatype/GB/PieceDetails.php @@ -21,17 +21,17 @@ class PieceDetails extends \Mtc\Dhl\Datatype\AM\PieceDetails '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)', + 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, @@ -41,26 +41,26 @@ class PieceDetails extends \Mtc\Dhl\Datatype\AM\PieceDetails '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/GB/PieceFault.php b/src/Datatype/GB/PieceFault.php index 5ac488e..9ccb72f 100644 --- a/src/Datatype/GB/PieceFault.php +++ b/src/Datatype/GB/PieceFault.php @@ -22,16 +22,16 @@ class PieceFault extends \Mtc\Dhl\Datatype\AM\PieceFault '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/GB/Pieces.php b/src/Datatype/GB/Pieces.php index 845d4fd..f0afbb9 100644 --- a/src/Datatype/GB/Pieces.php +++ b/src/Datatype/GB/Pieces.php @@ -19,6 +19,6 @@ class Pieces extends \Mtc\Dhl\Datatype\AM\Pieces 'required' => false, 'subobject' => true, 'multivalues' => true, - ], + ], ]; } diff --git a/src/Datatype/GB/QtdSInAdCur.php b/src/Datatype/GB/QtdSInAdCur.php index 6f1fe7b..742b563 100644 --- a/src/Datatype/GB/QtdSInAdCur.php +++ b/src/Datatype/GB/QtdSInAdCur.php @@ -21,7 +21,7 @@ class QtdSInAdCur extends \Mtc\Dhl\Datatype\AM\QtdSInAdCur 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ], + ], 'CurrencyRoleTypeCode' => [ 'type' => 'CurrencyRoleTypeCode', 'required' => true, @@ -29,7 +29,7 @@ class QtdSInAdCur extends \Mtc\Dhl\Datatype\AM\QtdSInAdCur 'comment' => 'CurrencyRoleTypeCode', 'maxLength' => '6', 'enumeration' => 'BILLC,BILLCU,PULCL,INVCU,BASEC', - ], + ], 'PackageCharge' => [ 'type' => 'PackageCharge', 'required' => true, @@ -37,7 +37,7 @@ class QtdSInAdCur extends \Mtc\Dhl\Datatype\AM\QtdSInAdCur 'comment' => 'PackageCharge', 'fractionDigits' => '3', 'totalDigits' => '18', - ], + ], 'ShippingCharge' => [ 'type' => 'ShippingCharge', 'required' => true, @@ -45,6 +45,6 @@ class QtdSInAdCur extends \Mtc\Dhl\Datatype\AM\QtdSInAdCur 'comment' => 'ShippingCharge', 'fractionDigits' => '3', 'totalDigits' => '18', - ], + ], ]; } diff --git a/src/Datatype/GB/Requestor.php b/src/Datatype/GB/Requestor.php index c15533c..3e77f47 100644 --- a/src/Datatype/GB/Requestor.php +++ b/src/Datatype/GB/Requestor.php @@ -15,7 +15,7 @@ class Requestor extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/GB/RequestorContact.php b/src/Datatype/GB/RequestorContact.php index 956e392..0f72fa3 100644 --- a/src/Datatype/GB/RequestorContact.php +++ b/src/Datatype/GB/RequestorContact.php @@ -15,7 +15,7 @@ class RequestorContact extends Base * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype diff --git a/src/Datatype/GB/Response.php b/src/Datatype/GB/Response.php index 9cd0f5b..7fbe9a1 100644 --- a/src/Datatype/GB/Response.php +++ b/src/Datatype/GB/Response.php @@ -18,6 +18,6 @@ class Response extends \Mtc\Dhl\Datatype\AM\Response 'type' => 'ResponseServiceHeader', 'required' => false, 'subobject' => true, - ], + ], ]; } diff --git a/src/Datatype/GB/ResponseServiceHeader.php b/src/Datatype/GB/ResponseServiceHeader.php index e408d1c..c5082dc 100644 --- a/src/Datatype/GB/ResponseServiceHeader.php +++ b/src/Datatype/GB/ResponseServiceHeader.php @@ -1,6 +1,7 @@ 'dateTime', 'required' => false, 'subobject' => false, - ], + ], 'MessageReference' => [ 'type' => 'MessageReference', 'required' => false, @@ -33,7 +34,7 @@ class ResponseServiceHeader extends Base 'comment' => 'Reference to the requested Message', 'minLength' => '28', 'maxLength' => '32', - ], + ], 'SiteID' => [ 'type' => 'SiteID', 'required' => false, @@ -41,6 +42,6 @@ class ResponseServiceHeader extends Base 'comment' => 'Site ID used for verifying the sender', 'minLength' => '6', 'maxLength' => '20', - ], + ], ]; } diff --git a/src/Datatype/GB/ShipValResponsePiece.php b/src/Datatype/GB/ShipValResponsePiece.php index 55429d9..2226059 100644 --- a/src/Datatype/GB/ShipValResponsePiece.php +++ b/src/Datatype/GB/ShipValResponsePiece.php @@ -10,7 +10,7 @@ class ShipValResponsePiece extends \Mtc\Dhl\Datatype\AM\ShipValResponsePiece { /** - * Parent node name of the object + * Parent node name of the object * @var string */ protected $xml_node_name = 'Piece'; @@ -25,22 +25,22 @@ class ShipValResponsePiece extends \Mtc\Dhl\Datatype\AM\ShipValResponsePiece 'required' => true, 'subobject' => false, 'comment' => 'Piece Number', - ], + ], 'Depth' => [ 'type' => 'positiveInteger', 'required' => false, 'subobject' => false, - ], + ], 'Width' => [ 'type' => 'positiveInteger', 'required' => false, 'subobject' => false, - ], + ], 'Height' => [ 'type' => 'positiveInteger', 'required' => false, 'subobject' => false, - ], + ], 'Weight' => [ 'type' => 'Weight', 'required' => false, @@ -50,7 +50,7 @@ class ShipValResponsePiece extends \Mtc\Dhl\Datatype\AM\ShipValResponsePiece 'minInclusive' => '0.000', 'maxInclusive' => '999999.999', 'totalDigits' => '10', - ], + ], 'PackageType' => [ 'type' => 'PackageType', 'required' => false, @@ -60,7 +60,7 @@ class ShipValResponsePiece extends \Mtc\Dhl\Datatype\AM\ShipValResponsePiece 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' => [ 'type' => 'Weight', 'required' => false, @@ -70,31 +70,31 @@ class ShipValResponsePiece extends \Mtc\Dhl\Datatype\AM\ShipValResponsePiece 'minInclusive' => '0.000', 'maxInclusive' => '999999.999', 'totalDigits' => '10', - ], + ], 'PieceContents' => [ 'type' => 'PieceContents', 'required' => false, 'subobject' => false, 'comment' => 'Piece contents description', 'maxLength' => '35', - ], + ], 'DataIdentifier' => [ 'type' => 'string', 'required' => true, 'subobject' => false, - ], + ], 'LicensePlate' => [ 'type' => 'PieceID', 'required' => true, 'subobject' => false, 'comment' => 'Piece ID', 'maxLength' => '35', - ], + ], 'LicensePlateBarCode' => [ 'type' => 'BarCode', 'required' => true, 'subobject' => false, 'comment' => '', - ], + ], ]; } diff --git a/src/Datatype/GB/Shipment.php b/src/Datatype/GB/Shipment.php index fda7337..a548a57 100644 --- a/src/Datatype/GB/Shipment.php +++ b/src/Datatype/GB/Shipment.php @@ -23,7 +23,7 @@ class Shipment extends \Mtc\Dhl\Datatype\AM\Shipment 'minInclusive' => '0.000', 'maxInclusive' => '999999.999', 'totalDigits' => '10', - ], + ], 'WeightUnit' => [ 'type' => 'WeightUnit', 'required' => false, @@ -32,12 +32,12 @@ class Shipment extends \Mtc\Dhl\Datatype\AM\Shipment 'minLength' => '0', 'maxLength' => '1', 'enumeration' => 'K,L', - ], + ], 'Pieces' => [ 'type' => 'Pieces', 'required' => false, 'subobject' => true, - ], + ], 'DoorTo' => [ 'type' => 'DoorTo', 'required' => false, @@ -46,14 +46,14 @@ class Shipment extends \Mtc\Dhl\Datatype\AM\Shipment to the shipment', 'length' => '2', 'enumeration' => 'DD,DA,AA,DC', - ], + ], 'AirwarBillNumber' => [ 'type' => 'AWBNumber', 'required' => false, 'subobject' => false, 'comment' => 'Airway bill number', 'maxLength' => '10', - ], + ], 'AccountType' => [ 'type' => 'AccountType', 'required' => false, @@ -61,27 +61,27 @@ class Shipment extends \Mtc\Dhl\Datatype\AM\Shipment 'comment' => 'Account Type by method of payment ( DHL account vs. Credit card)', 'enumeration' => 'D', - ], + ], 'ProductType' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ], + ], 'GlobalProductType' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ], + ], 'LocalProductType' => [ 'type' => 'string', 'required' => false, 'subobject' => false, - ], + ], 'Commodity' => [ 'type' => 'Commodity', 'required' => false, 'subobject' => true, - ], + ], 'DeclaredValue' => [ 'type' => 'Money', 'required' => false, @@ -89,14 +89,14 @@ class Shipment extends \Mtc\Dhl\Datatype\AM\Shipment 'comment' => 'Monetary amount (with 2 decimal precision)', 'minInclusive' => '0.00', 'maxInclusive' => '9999999999.99', - ], + ], 'DeclaredCurrency' => [ 'type' => 'CurrencyCode', 'required' => false, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ], + ], 'InsuredValue' => [ 'type' => 'Money', 'required' => false, @@ -104,14 +104,14 @@ class Shipment extends \Mtc\Dhl\Datatype\AM\Shipment 'comment' => 'Monetary amount (with 2 decimal precision)', 'minInclusive' => '0.00', 'maxInclusive' => '9999999999.99', - ], + ], 'InsuredCurrency' => [ 'type' => 'CurrencyCode', 'required' => false, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ], + ], 'DimensionalUnit' => [ 'type' => 'WeightUnit', 'required' => false, @@ -120,7 +120,7 @@ class Shipment extends \Mtc\Dhl\Datatype\AM\Shipment 'minLength' => '0', 'maxLength' => '1', 'enumeration' => 'K,L', - ], + ], 'DimensionalWeight' => [ 'type' => 'Weight', 'required' => false, @@ -130,6 +130,6 @@ class Shipment extends \Mtc\Dhl\Datatype\AM\Shipment 'minInclusive' => '0.000', 'maxInclusive' => '999999.999', 'totalDigits' => '10', - ], + ], ]; } diff --git a/src/Datatype/GB/ShipmentDate.php b/src/Datatype/GB/ShipmentDate.php index 9795a3a..31fa1e4 100644 --- a/src/Datatype/GB/ShipmentDate.php +++ b/src/Datatype/GB/ShipmentDate.php @@ -20,13 +20,13 @@ class ShipmentDate extends \Mtc\Dhl\Datatype\AM\ShipmentDate '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/src/Datatype/GB/ShipmentDetails.php b/src/Datatype/GB/ShipmentDetails.php index c564e67..f1640e4 100644 --- a/src/Datatype/GB/ShipmentDetails.php +++ b/src/Datatype/GB/ShipmentDetails.php @@ -1,6 +1,7 @@ 'integer', 'required' => false, 'subobject' => false, - ], + ], 'Pieces' => [ 'type' => 'Piece', 'required' => false, 'subobject' => true, 'multivalues' => true, - ], + ], 'Weight' => [ 'type' => 'Weight', 'required' => false, @@ -41,7 +42,7 @@ class ShipmentDetails extends Base 'minInclusive' => '0.000', 'maxInclusive' => '999999.999', 'totalDigits' => '10', - ], + ], 'WeightUnit' => [ 'type' => 'WeightUnit', 'required' => false, @@ -50,7 +51,7 @@ class ShipmentDetails extends Base 'minLength' => '0', 'maxLength' => '1', 'enumeration' => 'K,L', - ], + ], 'GlobalProductCode' => [ 'type' => 'GlobalProductCode', 'required' => false, @@ -59,7 +60,7 @@ class ShipmentDetails extends Base 'pattern' => '([A-Z0-9])*', 'minLength' => '1', 'maxLength' => '4', - ], + ], 'LocalProductCode' => [ 'type' => 'LocalProductCode', 'required' => false, @@ -68,21 +69,21 @@ class ShipmentDetails extends Base 'minLength' => '1', 'maxLength' => '4', 'pattern' => '([A-Z0-9])*', - ], + ], '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' => [ 'type' => 'ShipmentContents', 'required' => false, 'subobject' => false, 'comment' => 'Shipment contents description', 'maxLength' => '90', - ], + ], 'DoorTo' => [ 'type' => 'DoorTo', 'required' => false, @@ -91,7 +92,7 @@ class ShipmentDetails extends Base to the shipment', 'length' => '2', 'enumeration' => 'DD,DA,AA,DC', - ], + ], 'DimensionUnit' => [ 'type' => 'DimensionUnit', 'required' => false, @@ -99,7 +100,7 @@ class ShipmentDetails extends Base 'comment' => 'Dimension Unit C (centimeter)', 'length' => '1', 'enumeration' => 'C,I', - ], + ], 'InsuredAmount' => [ 'type' => 'Money', 'required' => false, @@ -107,17 +108,17 @@ class ShipmentDetails extends Base 'comment' => 'Monetary amount (with 2 decimal precision)', 'minInclusive' => '0.00', 'maxInclusive' => '9999999999.99', - ], + ], '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' => [ 'type' => 'YesNo', 'required' => false, @@ -125,19 +126,19 @@ class ShipmentDetails extends Base 'comment' => 'Boolean flag', 'length' => '1', 'enumeration' => 'Y,N', - ], + ], 'CurrencyCode' => [ 'type' => 'CurrencyCode', 'required' => false, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ], + ], 'AdditionalProtection' => [ 'type' => 'AdditionalProtection', 'required' => false, 'subobject' => true, - ], + ], 'DOSFlag' => [ 'type' => 'YesNo', 'required' => false, @@ -145,7 +146,7 @@ class ShipmentDetails extends Base 'comment' => 'Boolean flag', 'length' => '1', 'enumeration' => 'Y,N', - ], + ], 'CustData' => [ 'type' => 'CustData', 'required' => false, @@ -153,6 +154,6 @@ class ShipmentDetails extends Base 'comment' => 'CustData', 'minLength' => '1', 'maxLength' => '100', - ], + ], ]; } diff --git a/src/Datatype/GB/ShipmentEvent.php b/src/Datatype/GB/ShipmentEvent.php index 0b61352..8b3119d 100644 --- a/src/Datatype/GB/ShipmentEvent.php +++ b/src/Datatype/GB/ShipmentEvent.php @@ -19,26 +19,26 @@ class ShipmentEvent extends \Mtc\Dhl\Datatype\AM\ShipmentEvent '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/GB/ShipmentInfo.php b/src/Datatype/GB/ShipmentInfo.php index 3dd3157..5728626 100644 --- a/src/Datatype/GB/ShipmentInfo.php +++ b/src/Datatype/GB/ShipmentInfo.php @@ -19,58 +19,58 @@ class ShipmentInfo extends \Mtc\Dhl\Datatype\AM\ShipmentInfo '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' => true, - ], + ], '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/src/Datatype/GB/Shipper.php b/src/Datatype/GB/Shipper.php index 023fd8f..51d14c5 100644 --- a/src/Datatype/GB/Shipper.php +++ b/src/Datatype/GB/Shipper.php @@ -13,7 +13,7 @@ class Shipper extends \Mtc\Dhl\Datatype\AM\Shipper * Is this object a subobject * @var boolean */ - protected $_isSubobject = true; + protected $isSubobject = true; /** * Parameters of the datatype @@ -26,7 +26,7 @@ class Shipper extends \Mtc\Dhl\Datatype\AM\Shipper 'subobject' => false, 'comment' => 'Shipper\'s ID', 'maxLength' => '30', - ], + ], 'CompanyName' => [ 'type' => 'CompanyNameValidator', 'required' => false, @@ -34,98 +34,98 @@ class Shipper extends \Mtc\Dhl\Datatype\AM\Shipper 'comment' => 'Name of company / business', 'minLength' => '0', 'maxLength' => '35', - ], + ], 'SuiteDepartmentName' => [ 'type' => 'SuiteDepartmentName', 'required' => false, 'subobject' => false, 'comment' => 'SuiteDepartmentName', 'maxLength' => '35', - ], + ], 'RegisteredAccount' => [ 'type' => 'AccountNumber', 'required' => false, 'subobject' => false, 'comment' => 'DHL Account Number', 'maxLength' => '12', - ], + ], 'AddressLine' => [ 'type' => 'string', 'required' => true, 'subobject' => false, 'comment' => 'Address Line', 'multivalues' => true, - ], + ], 'City' => [ 'type' => 'City', 'required' => false, 'subobject' => false, 'comment' => 'City name', 'maxLength' => '35', - ], + ], 'Division' => [ 'type' => 'Division', 'required' => false, 'subobject' => false, 'comment' => 'Division (e.g. state, prefecture, etc.) name', 'maxLength' => '35', - ], + ], 'DivisionCode' => [ 'type' => 'DivisionCode', 'required' => false, 'subobject' => false, 'comment' => 'Division (e.g. state, prefecture, etc.) code', 'maxLength' => '35', - ], + ], 'PostalCode' => [ 'type' => 'PostalCode', 'required' => false, 'subobject' => false, 'comment' => 'Full postal/zip code for address', 'maxLength' => '12', - ], + ], 'OriginServiceAreaCode' => [ 'type' => 'OriginServiceAreaCode', 'required' => false, 'subobject' => false, 'comment' => 'OriginServiceAreaCode', 'maxLength' => '3', - ], + ], 'OriginFacilityCode' => [ 'type' => 'OriginFacilityCode', 'required' => false, 'subobject' => false, 'comment' => 'OriginFacilityCode', 'maxLength' => '3', - ], + ], 'CountryCode' => [ 'type' => 'CountryCode', 'required' => false, 'subobject' => false, 'comment' => 'ISO country codes', 'length' => '2', - ], + ], 'CountryName' => [ 'type' => 'CountryName', 'required' => false, 'subobject' => false, 'comment' => 'ISO country name', 'maxLength' => '35', - ], + ], 'FederalTaxId' => [ 'type' => '', 'required' => false, 'subobject' => false, - ], + ], 'StateTaxId' => [ 'type' => '', 'required' => false, 'subobject' => false, - ], + ], 'Contact' => [ 'type' => 'Contact', 'required' => false, 'subobject' => true, - ], + ], ]; } diff --git a/src/Datatype/GB/SpecialService.php b/src/Datatype/GB/SpecialService.php index d1af2b3..8b5d46e 100644 --- a/src/Datatype/GB/SpecialService.php +++ b/src/Datatype/GB/SpecialService.php @@ -20,7 +20,7 @@ class SpecialService extends \Mtc\Dhl\Datatype\AM\SpecialService 'subobject' => false, 'comment' => 'Special Service codes', 'maxLength' => '3', - ], + ], 'CommunicationAddress' => [ 'type' => 'CommunicationAddress', 'required' => false, @@ -28,7 +28,7 @@ class SpecialService extends \Mtc\Dhl\Datatype\AM\SpecialService 'comment' => 'Communications line number: phone number, fax number', 'maxLength' => '50', - ], + ], 'CommunicationType' => [ 'type' => 'CommunicationType', 'required' => false, @@ -36,14 +36,14 @@ class SpecialService extends \Mtc\Dhl\Datatype\AM\SpecialService 'comment' => 'Communications line type (P: phone, F: fax)', 'length' => '1', 'enumeration' => 'P,F', - ], + ], 'SpecialServiceDesc' => [ 'type' => 'SpecialServiceDesc', 'required' => false, 'subobject' => false, 'comment' => 'Special Service Description', 'maxLength' => '45', - ], + ], 'ChargeValue' => [ 'type' => 'Money', 'required' => false, @@ -51,14 +51,14 @@ class SpecialService extends \Mtc\Dhl\Datatype\AM\SpecialService 'comment' => 'Monetary amount (with 2 decimal precision)', 'minInclusive' => '0.00', 'maxInclusive' => '9999999999.99', - ], + ], 'CurrencyCode' => [ 'type' => 'CurrencyCode', 'required' => false, 'subobject' => false, 'comment' => 'ISO currency code', 'length' => '3', - ], + ], 'IsWaived' => [ 'type' => 'YesNo', 'required' => false, @@ -66,6 +66,6 @@ class SpecialService extends \Mtc\Dhl\Datatype\AM\SpecialService 'comment' => 'Boolean flag', 'length' => '1', 'enumeration' => 'Y,N', - ], + ], ]; } diff --git a/src/Datatype/GB/WeightSeg.php b/src/Datatype/GB/WeightSeg.php index fcc68e6..d2796a8 100644 --- a/src/Datatype/GB/WeightSeg.php +++ b/src/Datatype/GB/WeightSeg.php @@ -23,7 +23,7 @@ class WeightSeg extends \Mtc\Dhl\Datatype\AM\WeightSeg 'minInclusive' => '0.000', 'maxInclusive' => '999999.999', 'totalDigits' => '10', - ], + ], 'WeightUnit' => [ 'type' => 'WeightUnit', 'required' => false, @@ -32,6 +32,6 @@ class WeightSeg extends \Mtc\Dhl\Datatype\AM\WeightSeg 'minLength' => '0', 'maxLength' => '1', 'enumeration' => 'K,L', - ], + ], ]; } diff --git a/src/Entity/Base.php b/src/Entity/Base.php index a2d4980..9f33bd7 100644 --- a/src/Entity/Base.php +++ b/src/Entity/Base.php @@ -102,8 +102,8 @@ abstract class Base extends BaseDataType /** * Class constants */ - const DHL_REQ = 'http://www.dhl.com'; - const DHL_XSI = 'http://www.w3.org/2001/XMLSchema-instance'; + public const DHL_REQ = 'http://www.dhl.com'; + public const DHL_XSI = 'http://www.w3.org/2001/XMLSchema-instance'; /** * Class constructor @@ -169,7 +169,10 @@ public function toXML(\XMLWriter $xml_writer = null) $xml_writer->writeElement($name, $sub_element); } } else { - if (!isset($this->params[$name]['disableParentNode']) || false == $this->params[$name]['disableParentNode']) { + if ( + !isset($this->params[$name]['disableParentNode']) + || false == $this->params[$name]['disableParentNode'] + ) { $xml_writer->startElement($name); } @@ -177,7 +180,10 @@ public function toXML(\XMLWriter $xml_writer = null) $sub_element->toXML($xml_writer); } - if (!isset($this->params[$name]['disableParentNode']) || false == $this->params[$name]['disableParentNode']) { + if ( + !isset($this->params[$name]['disableParentNode']) + || false == $this->params[$name]['disableParentNode'] + ) { $xml_writer->endElement(); } } @@ -212,7 +218,8 @@ 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); + $errorMsg = ((string)$xml->Response->Status->Condition->ConditionCode) . ' : ' + . ((string)$xml->Response->Status->Condition->ConditionData); throw new \Exception('Error returned from DHL webservice : ' . $errorMsg); } @@ -231,7 +238,10 @@ public function initFromXML($xml) 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']) { + } 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) { @@ -313,7 +323,10 @@ protected function validateParameters(): bool } if (null === $this->service_name) { - throw new InvalidArgumentException('Class ' . get_class($this) . ' must have a valid serviceName property defined'); + throw new InvalidArgumentException( + 'Class ' . get_class($this) + . ' must have a valid serviceName property defined' + ); } return true; diff --git a/src/Entity/GB/CancelPURequest.php b/src/Entity/GB/CancelPURequest.php index 7f1e58e..a98af8d 100644 --- a/src/Entity/GB/CancelPURequest.php +++ b/src/Entity/GB/CancelPURequest.php @@ -34,7 +34,7 @@ class CancelPURequest extends Base * @var boolean */ protected $display_schema_version = true; - + /** * Parameters to be send in the body * @var array diff --git a/src/Service.php b/src/Service.php index 7ecb6a6..ede7b52 100644 --- a/src/Service.php +++ b/src/Service.php @@ -27,7 +27,7 @@ class Service /** * Service constructor. - * + * * @param WebserviceClient $client */ public function __construct(WebserviceClient $client) From 8f1540ffc1ba23fc71b9b29b047cb8cf4d40d594 Mon Sep 17 00:00:00 2001 From: Martins Fridenbergs Date: Wed, 9 Jun 2021 16:16:02 +0300 Subject: [PATCH 14/42] Restructure for shipment api v10 and GB namespace change to EU to match docs --- src/Datatype/{GB => EU}/AWBInfo.php | 7 +-- .../{GB => EU}/AdditionalProtection.php | 2 +- src/Datatype/{GB => EU}/BarCode.php | 2 +- src/Datatype/{GB => EU}/BarCodes.php | 2 +- src/Datatype/{GB => EU}/Billing.php | 2 +- src/Datatype/{GB => EU}/ChargeCard.php | 2 +- src/Datatype/{GB => EU}/Consignee.php | 58 +++++++++++++++--- src/Datatype/{GB => EU}/Contact.php | 9 ++- .../{GB => EU}/DestinationServiceArea.php | 2 +- src/Datatype/{GB => EU}/Dutiable.php | 2 +- src/Datatype/{GB => EU}/ExportDeclaration.php | 29 ++++++++- src/Datatype/{GB => EU}/ExportLineItem.php | 16 ++++- src/Datatype/{GB => EU}/Filing.php | 2 +- src/Datatype/{GB => EU}/Notification.php | 2 +- src/Datatype/{GB => EU}/OriginServiceArea.php | 2 +- src/Datatype/{GB => EU}/PUShipmentDetails.php | 2 +- src/Datatype/{GB => EU}/Pickup.php | 2 +- src/Datatype/{GB => EU}/PickupContact.php | 2 +- src/Datatype/{GB => EU}/Piece.php | 2 +- src/Datatype/{GB => EU}/PieceDetails.php | 2 +- src/Datatype/{GB => EU}/PieceFault.php | 2 +- src/Datatype/{GB => EU}/Pieces.php | 2 +- src/Datatype/{GB => EU}/Place.php | 2 +- src/Datatype/{GB => EU}/QtdSInAdCur.php | 2 +- src/Datatype/EU/RegistrationNumber.php | 33 ++++++++++ src/Datatype/EU/RegistrationNumbers.php | 21 +++++++ src/Datatype/{GB => EU}/Requestor.php | 2 +- src/Datatype/{GB => EU}/RequestorContact.php | 2 +- src/Datatype/{GB => EU}/Response.php | 2 +- .../{GB => EU}/ResponseServiceHeader.php | 2 +- .../{GB => EU}/ShipValResponsePiece.php | 2 +- src/Datatype/{GB => EU}/Shipment.php | 7 ++- src/Datatype/{GB => EU}/ShipmentDate.php | 2 +- src/Datatype/{GB => EU}/ShipmentDetails.php | 2 +- src/Datatype/{GB => EU}/ShipmentEvent.php | 2 +- src/Datatype/{GB => EU}/ShipmentInfo.php | 2 +- src/Datatype/{GB => EU}/Shipper.php | 60 ++++++++++++++++++- src/Datatype/{GB => EU}/SpecialService.php | 2 +- src/Datatype/{GB => EU}/WeightSeg.php | 2 +- src/Entity/Base.php | 2 +- src/Entity/{GB => EU}/BookPURequest.php | 2 +- src/Entity/{GB => EU}/BookPUResponse.php | 2 +- src/Entity/{GB => EU}/CancelPURequest.php | 2 +- src/Entity/{GB => EU}/CancelPUResponse.php | 2 +- .../{GB => EU}/KnownTrackingRequest.php | 2 +- src/Entity/{GB => EU}/ModifyPURequest.php | 2 +- src/Entity/{GB => EU}/ModifyPUResponse.php | 2 +- src/Entity/{GB => EU}/RouteRequest.php | 2 +- src/Entity/{GB => EU}/RouteResponse.php | 2 +- src/Entity/{GB => EU}/ShipmentRequest.php | 6 +- src/Entity/{GB => EU}/ShipmentResponse.php | 2 +- src/Entity/{GB => EU}/TrackingResponse.php | 2 +- .../{GB => EU}/UnknownTrackingRequest.php | 2 +- src/Service.php | 4 +- 54 files changed, 267 insertions(+), 69 deletions(-) rename src/Datatype/{GB => EU}/AWBInfo.php (89%) rename src/Datatype/{GB => EU}/AdditionalProtection.php (96%) rename src/Datatype/{GB => EU}/BarCode.php (93%) rename src/Datatype/{GB => EU}/BarCodes.php (96%) rename src/Datatype/{GB => EU}/Billing.php (97%) rename src/Datatype/{GB => EU}/ChargeCard.php (97%) rename src/Datatype/{GB => EU}/Consignee.php (60%) rename src/Datatype/{GB => EU}/Contact.php (86%) rename src/Datatype/{GB => EU}/DestinationServiceArea.php (97%) rename src/Datatype/{GB => EU}/Dutiable.php (98%) rename src/Datatype/{GB => EU}/ExportDeclaration.php (74%) rename src/Datatype/{GB => EU}/ExportLineItem.php (82%) rename src/Datatype/{GB => EU}/Filing.php (98%) rename src/Datatype/{GB => EU}/Notification.php (97%) rename src/Datatype/{GB => EU}/OriginServiceArea.php (96%) rename src/Datatype/{GB => EU}/PUShipmentDetails.php (99%) rename src/Datatype/{GB => EU}/Pickup.php (96%) rename src/Datatype/{GB => EU}/PickupContact.php (96%) rename src/Datatype/{GB => EU}/Piece.php (98%) rename src/Datatype/{GB => EU}/PieceDetails.php (98%) rename src/Datatype/{GB => EU}/PieceFault.php (95%) rename src/Datatype/{GB => EU}/Pieces.php (92%) rename src/Datatype/{GB => EU}/Place.php (99%) rename src/Datatype/{GB => EU}/QtdSInAdCur.php (97%) create mode 100644 src/Datatype/EU/RegistrationNumber.php create mode 100644 src/Datatype/EU/RegistrationNumbers.php rename src/Datatype/{GB => EU}/Requestor.php (97%) rename src/Datatype/{GB => EU}/RequestorContact.php (98%) rename src/Datatype/{GB => EU}/Response.php (92%) rename src/Datatype/{GB => EU}/ResponseServiceHeader.php (97%) rename src/Datatype/{GB => EU}/ShipValResponsePiece.php (98%) rename src/Datatype/{GB => EU}/Shipment.php (95%) rename src/Datatype/{GB => EU}/ShipmentDate.php (95%) rename src/Datatype/{GB => EU}/ShipmentDetails.php (99%) rename src/Datatype/{GB => EU}/ShipmentEvent.php (96%) rename src/Datatype/{GB => EU}/ShipmentInfo.php (98%) rename src/Datatype/{GB => EU}/Shipper.php (66%) rename src/Datatype/{GB => EU}/SpecialService.php (98%) rename src/Datatype/{GB => EU}/WeightSeg.php (96%) rename src/Entity/{GB => EU}/BookPURequest.php (98%) rename src/Entity/{GB => EU}/BookPUResponse.php (98%) rename src/Entity/{GB => EU}/CancelPURequest.php (98%) rename src/Entity/{GB => EU}/CancelPUResponse.php (98%) rename src/Entity/{GB => EU}/KnownTrackingRequest.php (98%) rename src/Entity/{GB => EU}/ModifyPURequest.php (98%) rename src/Entity/{GB => EU}/ModifyPUResponse.php (98%) rename src/Entity/{GB => EU}/RouteRequest.php (98%) rename src/Entity/{GB => EU}/RouteResponse.php (97%) rename src/Entity/{GB => EU}/ShipmentRequest.php (97%) rename src/Entity/{GB => EU}/ShipmentResponse.php (99%) rename src/Entity/{GB => EU}/TrackingResponse.php (97%) rename src/Entity/{GB => EU}/UnknownTrackingRequest.php (98%) diff --git a/src/Datatype/GB/AWBInfo.php b/src/Datatype/EU/AWBInfo.php similarity index 89% rename from src/Datatype/GB/AWBInfo.php rename to src/Datatype/EU/AWBInfo.php index 532854e..526c9e7 100644 --- a/src/Datatype/GB/AWBInfo.php +++ b/src/Datatype/EU/AWBInfo.php @@ -1,12 +1,7 @@ 'Name of company / business', 'minLength' => '0', ], + 'BusinessPartyTypeCode' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'Possible Values: + - BU (business) + - DC (direct consumer) + - GV (government) + - OT (other) + - PR (private) + - RE (reseller)', + ], 'SuiteDepartmentName' => [ 'type' => 'SuiteDepartmentName', 'required' => false, 'subobject' => false, 'comment' => 'SuiteDepartmentName', ], - 'AddressLine' => [ + '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' => 'Address Line', + 'comment' => 'Street Number', 'multivalues' => true, ], 'City' => [ diff --git a/src/Datatype/GB/Contact.php b/src/Datatype/EU/Contact.php similarity index 86% rename from src/Datatype/GB/Contact.php rename to src/Datatype/EU/Contact.php index 82fa62e..9534ded 100644 --- a/src/Datatype/GB/Contact.php +++ b/src/Datatype/EU/Contact.php @@ -1,6 +1,6 @@ 'Phone Number', 'maxLength' => '25', ], + 'MobilePhoneNumber' => [ + 'type' => 'PhoneNumber', + 'required' => false, + 'subobject' => false, + 'comment' => 'Mobile Phone Number', + 'maxLength' => '25', + ], 'PhoneExtension' => [ 'type' => 'PhoneExtension', 'required' => false, diff --git a/src/Datatype/GB/DestinationServiceArea.php b/src/Datatype/EU/DestinationServiceArea.php similarity index 97% rename from src/Datatype/GB/DestinationServiceArea.php rename to src/Datatype/EU/DestinationServiceArea.php index ef44b14..ca50a9e 100644 --- a/src/Datatype/GB/DestinationServiceArea.php +++ b/src/Datatype/EU/DestinationServiceArea.php @@ -1,6 +1,6 @@ '1', 'enumeration' => 'P,T,R', ], + 'ShipmentPurpose' => [ + 'type' => 'ShipmentPurpose', + 'required' => false, + 'subobject' => false, + 'comment' => 'COMMERCIAL or PERSONAL (B2B / B2C)', + ], 'SedNumber' => [ 'type' => 'SEDNumber', 'required' => false, @@ -76,6 +82,12 @@ class ExportDeclaration extends \Mtc\Dhl\Datatype\AM\ExportDeclaration 'length' => '1', 'enumeration' => 'F,X,S,I', ], + 'PlaceOfIncoterm' => [ + 'type' => 'PlaceOfIncoterm', + 'required' => false, + 'subobject' => false, + 'comment' => '', + ], 'MxStateCode' => [ 'type' => '', 'required' => false, @@ -88,5 +100,20 @@ class ExportDeclaration extends \Mtc\Dhl\Datatype\AM\ExportDeclaration 'multivalues' => true, 'disableParentNode' => true, ], + 'InvoiceTotalGrossWeight' => [ + 'type' => 'InvoiceTotalGrossWeight', + 'required' => false, + 'subobject' => true, + ], + 'InvoiceNumber' => [ + 'type' => 'InvoiceNumber', + 'required' => false, + 'subobject' => true, + ], + 'InvoiceDate' => [ + 'type' => 'InvoiceDate', + 'required' => false, + 'subobject' => true, + ], ]; } diff --git a/src/Datatype/GB/ExportLineItem.php b/src/Datatype/EU/ExportLineItem.php similarity index 82% rename from src/Datatype/GB/ExportLineItem.php rename to src/Datatype/EU/ExportLineItem.php index 92b68f8..61c62e9 100644 --- a/src/Datatype/GB/ExportLineItem.php +++ b/src/Datatype/EU/ExportLineItem.php @@ -1,6 +1,6 @@ '1', 'maxLength' => '20', ], + 'ImportCommodityCode' => [ + 'type' => 'ImportCommodityCode', + 'required' => false, + 'subobject' => false, + 'comment' => 'Commodity codes for shipment type', + 'minLength' => '1', + 'maxLength' => '20', + ], + 'ManufactureCountryCode' => [ + 'type' => 'ManufactureCountryCode', + 'required' => false, + 'subobject' => false, + 'comment' => 'Country Code for manufacturing', + ], 'ScheduleB' => [ 'type' => 'ScheduleB', 'required' => false, diff --git a/src/Datatype/GB/Filing.php b/src/Datatype/EU/Filing.php similarity index 98% rename from src/Datatype/GB/Filing.php rename to src/Datatype/EU/Filing.php index d657806..663fe7e 100644 --- a/src/Datatype/GB/Filing.php +++ b/src/Datatype/EU/Filing.php @@ -23,7 +23,7 @@ * @version 0.1 */ -namespace Mtc\Dhl\Datatype\GB; +namespace Mtc\Dhl\Datatype\EU; use Mtc\Dhl\Datatype\Base; /** diff --git a/src/Datatype/GB/Notification.php b/src/Datatype/EU/Notification.php similarity index 97% rename from src/Datatype/GB/Notification.php rename to src/Datatype/EU/Notification.php index a5b9688..a92615c 100644 --- a/src/Datatype/GB/Notification.php +++ b/src/Datatype/EU/Notification.php @@ -23,7 +23,7 @@ * @version 0.1 */ -namespace Mtc\Dhl\Datatype\GB; +namespace Mtc\Dhl\Datatype\EU; use Mtc\Dhl\Datatype\Base; /** diff --git a/src/Datatype/GB/OriginServiceArea.php b/src/Datatype/EU/OriginServiceArea.php similarity index 96% rename from src/Datatype/GB/OriginServiceArea.php rename to src/Datatype/EU/OriginServiceArea.php index 8e3d685..3c07aaf 100644 --- a/src/Datatype/GB/OriginServiceArea.php +++ b/src/Datatype/EU/OriginServiceArea.php @@ -1,6 +1,6 @@ [ + '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..29cf9e5 --- /dev/null +++ b/src/Datatype/EU/RegistrationNumbers.php @@ -0,0 +1,21 @@ + [ + 'type' => 'RegistrationNumber', + 'required' => false, + 'subobject' => false, + 'comment' => '', + ], + ]; +} diff --git a/src/Datatype/GB/Requestor.php b/src/Datatype/EU/Requestor.php similarity index 97% rename from src/Datatype/GB/Requestor.php rename to src/Datatype/EU/Requestor.php index 3e77f47..d4fd9df 100644 --- a/src/Datatype/GB/Requestor.php +++ b/src/Datatype/EU/Requestor.php @@ -1,6 +1,6 @@ false, 'subobject' => false, ], + 'DHLInvoiceType' => [ + 'type' => 'DHLInvoiceType', + 'required' => false, + 'subobject' => false, + ], 'Commodity' => [ 'type' => 'Commodity', 'required' => false, diff --git a/src/Datatype/GB/ShipmentDate.php b/src/Datatype/EU/ShipmentDate.php similarity index 95% rename from src/Datatype/GB/ShipmentDate.php rename to src/Datatype/EU/ShipmentDate.php index 31fa1e4..7bf6d33 100644 --- a/src/Datatype/GB/ShipmentDate.php +++ b/src/Datatype/EU/ShipmentDate.php @@ -1,6 +1,6 @@ '0', 'maxLength' => '35', ], + 'BusinessPartyTypeCode' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'comment' => 'Possible Values: + - BU (business) + - DC (direct consumer) + - GV (government) + - OT (other) + - PR (private) + - RE (reseller)', + ], 'SuiteDepartmentName' => [ 'type' => 'SuiteDepartmentName', 'required' => false, @@ -49,11 +61,53 @@ class Shipper extends \Mtc\Dhl\Datatype\AM\Shipper 'comment' => 'DHL Account Number', 'maxLength' => '12', ], - 'AddressLine' => [ + 'RegistrationNumbers' => [ + 'type' => 'RegistrationNumbers', + 'required' => false, + 'subobject' => false, + 'comment' => 'VAT Registration numbers', + 'maxLength' => '12', + ], + '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' => 'Address Line', + 'comment' => 'Street Number', 'multivalues' => true, ], 'City' => [ diff --git a/src/Datatype/GB/SpecialService.php b/src/Datatype/EU/SpecialService.php similarity index 98% rename from src/Datatype/GB/SpecialService.php rename to src/Datatype/EU/SpecialService.php index 8b5d46e..08a0d74 100644 --- a/src/Datatype/GB/SpecialService.php +++ b/src/Datatype/EU/SpecialService.php @@ -1,6 +1,6 @@ values[$name] = new $class_name(); } diff --git a/src/Entity/GB/BookPURequest.php b/src/Entity/EU/BookPURequest.php similarity index 98% rename from src/Entity/GB/BookPURequest.php rename to src/Entity/EU/BookPURequest.php index a871169..0b79bea 100644 --- a/src/Entity/GB/BookPURequest.php +++ b/src/Entity/EU/BookPURequest.php @@ -1,6 +1,6 @@ Date: Wed, 9 Jun 2021 16:58:06 +0300 Subject: [PATCH 15/42] Update field types --- src/Datatype/EU/ExportDeclaration.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Datatype/EU/ExportDeclaration.php b/src/Datatype/EU/ExportDeclaration.php index 71bd40a..a88919c 100644 --- a/src/Datatype/EU/ExportDeclaration.php +++ b/src/Datatype/EU/ExportDeclaration.php @@ -101,19 +101,19 @@ class ExportDeclaration extends \Mtc\Dhl\Datatype\AM\ExportDeclaration 'disableParentNode' => true, ], 'InvoiceTotalGrossWeight' => [ - 'type' => 'InvoiceTotalGrossWeight', + 'type' => 'string', 'required' => false, - 'subobject' => true, + 'subobject' => false, ], 'InvoiceNumber' => [ - 'type' => 'InvoiceNumber', + 'type' => 'string', 'required' => false, - 'subobject' => true, + 'subobject' => false, ], 'InvoiceDate' => [ - 'type' => 'InvoiceDate', + 'type' => 'dateTime', 'required' => false, - 'subobject' => true, + 'subobject' => false, ], ]; } From ee40bc339563e09748bb77e74a3062492fe4fbe3 Mon Sep 17 00:00:00 2001 From: Martins Fridenbergs Date: Wed, 16 Jun 2021 13:40:49 +0300 Subject: [PATCH 16/42] Tweak schema for shipments --- src/Datatype/EU/RegistrationNumbers.php | 1 + src/Datatype/EU/Shipper.php | 4 ++-- src/Entity/EU/ShipmentRequest.php | 7 +++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Datatype/EU/RegistrationNumbers.php b/src/Datatype/EU/RegistrationNumbers.php index 29cf9e5..c4c38f1 100644 --- a/src/Datatype/EU/RegistrationNumbers.php +++ b/src/Datatype/EU/RegistrationNumbers.php @@ -16,6 +16,7 @@ class RegistrationNumbers extends Base 'required' => false, 'subobject' => false, 'comment' => '', + 'multivalues' => true, ], ]; } diff --git a/src/Datatype/EU/Shipper.php b/src/Datatype/EU/Shipper.php index d5eb41f..e04c7a4 100644 --- a/src/Datatype/EU/Shipper.php +++ b/src/Datatype/EU/Shipper.php @@ -62,11 +62,11 @@ class Shipper extends \Mtc\Dhl\Datatype\AM\Shipper 'maxLength' => '12', ], 'RegistrationNumbers' => [ - 'type' => 'RegistrationNumbers', + 'type' => 'RegistrationNumber', 'required' => false, 'subobject' => false, 'comment' => 'VAT Registration numbers', - 'maxLength' => '12', + 'multivalues' => true, ], 'AddressLine1' => [ 'type' => 'string', diff --git a/src/Entity/EU/ShipmentRequest.php b/src/Entity/EU/ShipmentRequest.php index 1069f0b..350d03a 100644 --- a/src/Entity/EU/ShipmentRequest.php +++ b/src/Entity/EU/ShipmentRequest.php @@ -157,6 +157,13 @@ class ShipmentRequest extends Base 'required' => false, 'subobject' => false, ], + 'DHLInvoiceType' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'maxLength' => '3', + 'comment' => 'CMI (commercial invoice) / PFI (Proforma Invoice)' + ], 'Airwaybill' => [ 'type' => 'string', 'required' => false, From 203d93e1b2eda0008d2a88dee53f4642928a0793 Mon Sep 17 00:00:00 2001 From: Martins Fridenbergs Date: Wed, 16 Jun 2021 13:44:09 +0300 Subject: [PATCH 17/42] Export reason tweaks --- src/Datatype/EU/ExportDeclaration.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Datatype/EU/ExportDeclaration.php b/src/Datatype/EU/ExportDeclaration.php index a88919c..8076bcd 100644 --- a/src/Datatype/EU/ExportDeclaration.php +++ b/src/Datatype/EU/ExportDeclaration.php @@ -51,7 +51,6 @@ class ExportDeclaration extends \Mtc\Dhl\Datatype\AM\ExportDeclaration 'required' => false, 'subobject' => false, 'comment' => 'Export reason', - 'length' => '1', ], 'ExportReasonCode' => [ 'type' => 'ExportReasonCode', @@ -59,7 +58,7 @@ class ExportDeclaration extends \Mtc\Dhl\Datatype\AM\ExportDeclaration 'subobject' => false, 'comment' => 'Export reason code (P:Permanent, T:Temporary, R:Re-Export)', 'length' => '1', - 'enumeration' => 'P,T,R', + 'enumeration' => 'P,T,R,M,I,C,E,S,G,U,W,D,F', ], 'ShipmentPurpose' => [ 'type' => 'ShipmentPurpose', From e2bc4c07e541e6acb1335b061977f27e6e148fb7 Mon Sep 17 00:00:00 2001 From: Martins Fridenbergs Date: Wed, 16 Jun 2021 13:49:20 +0300 Subject: [PATCH 18/42] Decimal type --- src/Datatype/Base.php | 9 +++++++++ src/Datatype/EU/ExportDeclaration.php | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Datatype/Base.php b/src/Datatype/Base.php index a0004f5..e667d28 100644 --- a/src/Datatype/Base.php +++ b/src/Datatype/Base.php @@ -345,6 +345,15 @@ protected function validateParameterType($key, $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); diff --git a/src/Datatype/EU/ExportDeclaration.php b/src/Datatype/EU/ExportDeclaration.php index 8076bcd..78a349f 100644 --- a/src/Datatype/EU/ExportDeclaration.php +++ b/src/Datatype/EU/ExportDeclaration.php @@ -100,7 +100,7 @@ class ExportDeclaration extends \Mtc\Dhl\Datatype\AM\ExportDeclaration 'disableParentNode' => true, ], 'InvoiceTotalGrossWeight' => [ - 'type' => 'string', + 'type' => 'decimal', 'required' => false, 'subobject' => false, ], From a27a110e98765c34bc377a13037266a8ba720993 Mon Sep 17 00:00:00 2001 From: Martins Fridenbergs Date: Wed, 16 Jun 2021 15:25:11 +0300 Subject: [PATCH 19/42] Updates to request structure --- src/Datatype/EU/ExportDeclaration.php | 34 ++++++++++++------------ src/Datatype/EU/GrossWeight.php | 32 +++++++++++++++++++++++ src/Datatype/EU/Shipper.php | 37 +++++++++++++-------------- src/Datatype/EU/Weight.php | 32 +++++++++++++++++++++++ src/Entity/EU/ShipmentRequest.php | 14 +++++----- 5 files changed, 106 insertions(+), 43 deletions(-) create mode 100644 src/Datatype/EU/GrossWeight.php create mode 100644 src/Datatype/EU/Weight.php diff --git a/src/Datatype/EU/ExportDeclaration.php b/src/Datatype/EU/ExportDeclaration.php index 78a349f..9de2c25 100644 --- a/src/Datatype/EU/ExportDeclaration.php +++ b/src/Datatype/EU/ExportDeclaration.php @@ -60,12 +60,6 @@ class ExportDeclaration extends \Mtc\Dhl\Datatype\AM\ExportDeclaration 'length' => '1', 'enumeration' => 'P,T,R,M,I,C,E,S,G,U,W,D,F', ], - 'ShipmentPurpose' => [ - 'type' => 'ShipmentPurpose', - 'required' => false, - 'subobject' => false, - 'comment' => 'COMMERCIAL or PERSONAL (B2B / B2C)', - ], 'SedNumber' => [ 'type' => 'SEDNumber', 'required' => false, @@ -81,14 +75,13 @@ class ExportDeclaration extends \Mtc\Dhl\Datatype\AM\ExportDeclaration 'length' => '1', 'enumeration' => 'F,X,S,I', ], - 'PlaceOfIncoterm' => [ - 'type' => 'PlaceOfIncoterm', + 'InvoiceNumber' => [ + 'type' => 'string', 'required' => false, 'subobject' => false, - 'comment' => '', ], - 'MxStateCode' => [ - 'type' => '', + 'InvoiceDate' => [ + 'type' => 'dateTime', 'required' => false, 'subobject' => false, ], @@ -99,18 +92,25 @@ class ExportDeclaration extends \Mtc\Dhl\Datatype\AM\ExportDeclaration 'multivalues' => true, 'disableParentNode' => true, ], - 'InvoiceTotalGrossWeight' => [ - 'type' => 'decimal', + 'PlaceOfIncoterm' => [ + 'type' => 'PlaceOfIncoterm', + 'required' => true, + 'subobject' => false, + 'comment' => '', + ], + 'ShipmentPurpose' => [ + 'type' => 'ShipmentPurpose', 'required' => false, 'subobject' => false, + 'comment' => 'COMMERCIAL or PERSONAL (B2B / B2C)', ], - 'InvoiceNumber' => [ - 'type' => 'string', + 'MxStateCode' => [ + 'type' => '', 'required' => false, 'subobject' => false, ], - 'InvoiceDate' => [ - 'type' => 'dateTime', + 'InvoiceTotalGrossWeight' => [ + 'type' => 'decimal', 'required' => false, 'subobject' => false, ], 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/src/Datatype/EU/Shipper.php b/src/Datatype/EU/Shipper.php index e04c7a4..1ff3764 100644 --- a/src/Datatype/EU/Shipper.php +++ b/src/Datatype/EU/Shipper.php @@ -35,18 +35,6 @@ class Shipper extends \Mtc\Dhl\Datatype\AM\Shipper 'minLength' => '0', 'maxLength' => '35', ], - 'BusinessPartyTypeCode' => [ - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'Possible Values: - - BU (business) - - DC (direct consumer) - - GV (government) - - OT (other) - - PR (private) - - RE (reseller)', - ], 'SuiteDepartmentName' => [ 'type' => 'SuiteDepartmentName', 'required' => false, @@ -61,13 +49,6 @@ class Shipper extends \Mtc\Dhl\Datatype\AM\Shipper 'comment' => 'DHL Account Number', 'maxLength' => '12', ], - 'RegistrationNumbers' => [ - 'type' => 'RegistrationNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'VAT Registration numbers', - 'multivalues' => true, - ], 'AddressLine1' => [ 'type' => 'string', 'required' => true, @@ -181,5 +162,23 @@ class Shipper extends \Mtc\Dhl\Datatype\AM\Shipper '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/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/Entity/EU/ShipmentRequest.php b/src/Entity/EU/ShipmentRequest.php index 350d03a..7e9d314 100644 --- a/src/Entity/EU/ShipmentRequest.php +++ b/src/Entity/EU/ShipmentRequest.php @@ -115,6 +115,13 @@ class ShipmentRequest extends Base 'required' => false, 'subobject' => true, ], + 'DHLInvoiceType' => [ + 'type' => 'string', + 'required' => false, + 'subobject' => false, + 'maxLength' => '3', + 'comment' => 'CMI (commercial invoice) / PFI (Proforma Invoice)' + ], 'ExportDeclaration' => [ 'type' => 'ExportDeclaration', 'required' => false, @@ -157,13 +164,6 @@ class ShipmentRequest extends Base 'required' => false, 'subobject' => false, ], - 'DHLInvoiceType' => [ - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'maxLength' => '3', - 'comment' => 'CMI (commercial invoice) / PFI (Proforma Invoice)' - ], 'Airwaybill' => [ 'type' => 'string', 'required' => false, From f41a3ee71f0a9e198b503c8a86c0192a64329d59 Mon Sep 17 00:00:00 2001 From: Martins Fridenbergs Date: Wed, 16 Jun 2021 15:27:41 +0300 Subject: [PATCH 20/42] Updates to request structure --- src/Datatype/EU/Contact.php | 14 +++++++------- src/Datatype/EU/ExportLineItem.php | 5 +++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/Datatype/EU/Contact.php b/src/Datatype/EU/Contact.php index 9534ded..8593643 100644 --- a/src/Datatype/EU/Contact.php +++ b/src/Datatype/EU/Contact.php @@ -35,13 +35,6 @@ class Contact extends \Mtc\Dhl\Datatype\AM\Contact 'comment' => 'Phone Number', 'maxLength' => '25', ], - 'MobilePhoneNumber' => [ - 'type' => 'PhoneNumber', - 'required' => false, - 'subobject' => false, - 'comment' => 'Mobile Phone Number', - 'maxLength' => '25', - ], 'PhoneExtension' => [ 'type' => 'PhoneExtension', 'required' => false, @@ -70,5 +63,12 @@ class Contact extends \Mtc\Dhl\Datatype\AM\Contact '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/ExportLineItem.php b/src/Datatype/EU/ExportLineItem.php index 61c62e9..37afe10 100644 --- a/src/Datatype/EU/ExportLineItem.php +++ b/src/Datatype/EU/ExportLineItem.php @@ -93,6 +93,11 @@ class ExportLineItem extends \Mtc\Dhl\Datatype\AM\ExportLineItem 'required' => false, 'subobject' => false, ], + 'GrossWeight' => [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], 'License' => [ 'type' => '', 'required' => false, From dc255487e8df5273a8a7cfff6b3dac4f0512c7ff Mon Sep 17 00:00:00 2001 From: Martins Fridenbergs Date: Wed, 16 Jun 2021 15:31:33 +0300 Subject: [PATCH 21/42] Updates to request structure --- src/Datatype/EU/ExportLineItem.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Datatype/EU/ExportLineItem.php b/src/Datatype/EU/ExportLineItem.php index 37afe10..792296c 100644 --- a/src/Datatype/EU/ExportLineItem.php +++ b/src/Datatype/EU/ExportLineItem.php @@ -62,14 +62,6 @@ class ExportLineItem extends \Mtc\Dhl\Datatype\AM\ExportLineItem 'minLength' => '1', 'maxLength' => '20', ], - 'ImportCommodityCode' => [ - 'type' => 'ImportCommodityCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'Commodity codes for shipment type', - 'minLength' => '1', - 'maxLength' => '20', - ], 'ManufactureCountryCode' => [ 'type' => 'ManufactureCountryCode', 'required' => false, @@ -110,5 +102,13 @@ class ExportLineItem extends \Mtc\Dhl\Datatype\AM\ExportLineItem 'comment' => 'Export license number', 'maxLength' => '16', ], + 'ImportCommodityCode' => [ + 'type' => 'ImportCommodityCode', + 'required' => false, + 'subobject' => false, + 'comment' => 'Commodity codes for shipment type', + 'minLength' => '1', + 'maxLength' => '20', + ], ]; } From 4aaeb1a94d14ee7981890f2fa24804e03047de22 Mon Sep 17 00:00:00 2001 From: Martins Fridenbergs Date: Wed, 16 Jun 2021 15:33:55 +0300 Subject: [PATCH 22/42] Updates to request structure --- src/Datatype/EU/ExportLineItem.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Datatype/EU/ExportLineItem.php b/src/Datatype/EU/ExportLineItem.php index 792296c..dd7a705 100644 --- a/src/Datatype/EU/ExportLineItem.php +++ b/src/Datatype/EU/ExportLineItem.php @@ -62,12 +62,6 @@ class ExportLineItem extends \Mtc\Dhl\Datatype\AM\ExportLineItem 'minLength' => '1', 'maxLength' => '20', ], - 'ManufactureCountryCode' => [ - 'type' => 'ManufactureCountryCode', - 'required' => false, - 'subobject' => false, - 'comment' => 'Country Code for manufacturing', - ], 'ScheduleB' => [ 'type' => 'ScheduleB', 'required' => false, @@ -102,6 +96,12 @@ class ExportLineItem extends \Mtc\Dhl\Datatype\AM\ExportLineItem 'comment' => 'Export license number', 'maxLength' => '16', ], + 'ManufactureCountryCode' => [ + 'type' => 'ManufactureCountryCode', + 'required' => false, + 'subobject' => false, + 'comment' => 'Country Code for manufacturing', + ], 'ImportCommodityCode' => [ 'type' => 'ImportCommodityCode', 'required' => false, From 71420fce81e6c1a16a4fae8cea8edd2df1583b64 Mon Sep 17 00:00:00 2001 From: Martins Fridenbergs Date: Thu, 17 Jun 2021 15:02:49 +0300 Subject: [PATCH 23/42] docs update --- changelog.md | 7 ++ docs/shipment.md | 197 ++++++++++++++++++++++++++++++++++++----------- readme.md | 10 ++- 3 files changed, 165 insertions(+), 49 deletions(-) create mode 100644 changelog.md diff --git a/changelog.md b/changelog.md new file mode 100644 index 0000000..833d6a9 --- /dev/null +++ b/changelog.md @@ -0,0 +1,7 @@ +# 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 \ No newline at end of file diff --git a/docs/shipment.md b/docs/shipment.md index f6ea080..dad7bee 100644 --- a/docs/shipment.md +++ b/docs/shipment.md @@ -1,100 +1,203 @@ 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->PiecesEnabled = 'Y'; -$shipment->Reference->ReferenceID = $client->account . '-' . $order->id; +$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; -// Outside EU changes Tax info -if (!Country::isEu($shipping_address->country)) { - $shipment->Billing->DutyPaymentType = 'R'; +$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 ?? ''; } -$contact_name = $shipping_address->first_name . ' ' . $shipping_address->last_name; -$shipment->Consignee->CompanyName = $shipping_address->organisation ?? '--'; -$shipment->Consignee->Contact->PersonName = $contact_name; -$shipment->Consignee->addAddressLine(substr($shipping_address->address1, 0, 35)); -$shipment->Consignee->addAddressLine(substr($shipping_address->address2, 0, 35)); -$shipment->Consignee->City = $shipping_address->city; -$shipment->Consignee->PostalCode = $shipping_address->postcode; -$shipment->Consignee->Division = $shipping_address->state ?? ''; -$shipment->Consignee->CountryCode = $shipping_address->country; -$shipment->Consignee->CountryName = Country::getNameFromCode($shipping_address->country); +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->RegionCode = Country::getDHLRegionCode($shipping_address->country); +$shipment->Consignee->Contact->MobilePhoneNumber = $order->info->contact_no; +$shipment->RegionCode = Country::getDHLRegionCode($order->address->shipping->country); +$shipment->Shipper->BusinessPartyTypeCode = 'DC'; -$order_value = $order->order_cost - $order->delivery_cost > 0 ? $order->order_cost - $order->delivery_cost : 1.0; -$shipment->Dutiable->DeclaredValue = $order_value; +$order_value = $this->getOrderValue($order); +$shipment->Dutiable->DeclaredValue = number_format($order_value, 2, '.', ''); $shipment->Dutiable->DeclaredCurrency = 'GBP'; -$shipment->Dutiable->TermsOfTrade = 'DDP'; +$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 = $collection_address->organisation; -$shipment->Shipper->addAddressLine($collection_address->address1); -$shipment->Shipper->addAddressLine($collection_address->address2); -$shipment->Shipper->City = $collection_address->city; -$shipment->Shipper->PostalCode = $collection_address->postcode; -$shipment->Shipper->CountryCode = $collection_address->country; -$shipment->Shipper->CountryName = Country::getNameFromCode($collection_address->country); - -$shipment->Shipper->Contact->PersonName = $collection_address->contact_name; -$shipment->Shipper->Contact->PhoneNumber = $collection_address->contact_phone; -$shipment->Shipper->Contact->Email = $collection_address->contact_email; +$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; -// Delivery Service is obtained via Quote request which will find valid services for shipment +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; -if (Country::isEu($shipping_address->country) === false) { - $shipment->ShipmentDetails->DoorTo = 'DD'; -} -$shipment->ShipmentDetails->Contents = 'Shipment Description'; +$shipment->ShipmentDetails->Contents = $order->description ?? ''; $shipment->ShipmentDetails->CurrencyCode = 'GBP'; $shipment->ShipmentDetails->WeightUnit = 'K'; -$shipment->ShipmentDetails->Weight = collect($packages)->sum('weight'); $shipment->ShipmentDetails->Date = Carbon::now()->format('Y-m-d'); $shipment->ShipmentDetails->DimensionUnit = 'C'; -$shipment->ShipmentDetails->InsuredAmount = $order->insurance_total ?? 0; +$shipment->ShipmentDetails->InsuredAmount = !empty($order->insurance_total) ? $order->insurance_total : 0; $shipment->ShipmentDetails->PackageType = $order->package_type ?? 'PA'; -$shipment->ShipmentDetails->IsDutiable = Country::isEu($shipping_address->country) ? 'Y' : 'N'; - +$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->DOSFlag = 'N'; $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 -$shipment->ShipmentDetails->NumberOfPieces = count($packages); foreach ($packages as $package_id => $package) { $piece = new Piece(); $piece->PieceID = $client->account . $order->id . $package_id; - $piece->PackageType = $order->package_type ?? 'CP'; + $piece->PackageType = $order->package_type ?? 'PA'; $piece->Weight = $package['weight']; - $piece->DimWeight = $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'; -$shipment->LabelImageFormat = 'PDF'; -$shipment->Label->LabelTemplate = '8X4_PDF'; -$client = new Web($this->getEnvironment()); -$xml_response = $client->call($shipment); +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 diff --git a/readme.md b/readme.md index 03aa3a0..03d31e8 100644 --- a/readme.md +++ b/readme.md @@ -11,7 +11,7 @@ Package should be installed through composer: composer require mtcmedia/dhl-api ``` -Package requires a php min version of 7.0, however it has has been developed and tested on php 7.2.* +Package requires a php min version of 7.1, however it has has been developed and tested on php 7.2.* ## Usage @@ -28,12 +28,18 @@ DHL XML Services Test server for customer certification: https://xmlpitest-ea.dh [Route Requests (v1.0)](docs/route.md) -[Shipment Requests (v6.2)](docs/shipment.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 From f4b891c2a0364c38608069c09ce6b344009862fc Mon Sep 17 00:00:00 2001 From: mIRU Date: Wed, 8 Jun 2022 09:35:36 +0200 Subject: [PATCH 24/42] Removed debugging from Datatype/Base.php --- changelog.md | 4 +++- src/Datatype/Base.php | 2 -- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index 833d6a9..d0f7e22 100644 --- a/changelog.md +++ b/changelog.md @@ -4,4 +4,6 @@ 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 \ No newline at end of file +v2.0.0 - Updated Shipment Validation to DHL v10 + +v2.0.1 - Removed debugging from Datatype/Base.php diff --git a/src/Datatype/Base.php b/src/Datatype/Base.php index e667d28..ff4dd4a 100644 --- a/src/Datatype/Base.php +++ b/src/Datatype/Base.php @@ -129,7 +129,6 @@ public function initFromXML($xml) $xml = simplexml_load_string(str_replace('req:', '', $xml)); $parts = explode('\\', get_class($this)); $className = array_pop($parts); - dd($className); foreach ($xml->children() as $child) { $childName = $child->getName(); @@ -140,7 +139,6 @@ public function initFromXML($xml) $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); - dd($child_class_name); if ('string' == $this->params[$sub_child_name]['type']) { $childObj = trim((string)$sub_child); } else { From e708582f5795540e4486c8082513e35851d912b3 Mon Sep 17 00:00:00 2001 From: mIRU Date: Wed, 8 Jun 2022 10:08:23 +0200 Subject: [PATCH 25/42] modified package name --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 76aa969..b51a8d0 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "mtcmedia/dhl-api", + "name": "bambinifashion-com/dhl-api", "description": "PHP library to communicate with the DHL XML Services.", "require": { "php": ">=7.1", From 57468a7c7227d87117cbad6318df8deab946e0b9 Mon Sep 17 00:00:00 2001 From: mIRU Date: Thu, 9 Jun 2022 08:20:46 +0200 Subject: [PATCH 26/42] reverted package name --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b51a8d0..76aa969 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "bambinifashion-com/dhl-api", + "name": "mtcmedia/dhl-api", "description": "PHP library to communicate with the DHL XML Services.", "require": { "php": ">=7.1", From 12ab794856669b09907be1f8ddf1fb7ce3aab751 Mon Sep 17 00:00:00 2001 From: Arpit Patidar <44097148+iamarpitpatidar@users.noreply.github.com> Date: Wed, 20 Jul 2022 15:50:51 +0530 Subject: [PATCH 27/42] Updated Quote example --- docs/quote.md | 52 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 40 insertions(+), 12 deletions(-) diff --git a/docs/quote.md b/docs/quote.md index 328fe0c..2c0ee56 100644 --- a/docs/quote.md +++ b/docs/quote.md @@ -1,20 +1,48 @@ 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'; +$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($tracking); +$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 = $tracking->toXml(); -``` \ No newline at end of file +$request_xml = $sample->toXml(); +``` From 799c7c247f3bab519c0f857eb00aa0c516c60de3 Mon Sep 17 00:00:00 2001 From: Arpit Patidar <44097148+iamarpitpatidar@users.noreply.github.com> Date: Wed, 20 Jul 2022 15:54:39 +0530 Subject: [PATCH 28/42] Update tracking.md --- docs/tracking.md | 52 +++++++++++------------------------------------- 1 file changed, 12 insertions(+), 40 deletions(-) diff --git a/docs/tracking.md b/docs/tracking.md index 95761c3..b6fd2ae 100644 --- a/docs/tracking.md +++ b/docs/tracking.md @@ -1,48 +1,20 @@ 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'; -} +$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($sample); +$xml_response = $client->call($tracking); ``` If you need XML request for the DHL certification you can obtain by calling the following code ```php -$request_xml = $sample->toXml(); -``` \ No newline at end of file +$request_xml = $tracking->toXml(); +``` From cba2a5ee35f1050d73cd8a705c28b1a21e547786 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=92=8C=E5=AD=90=E7=94=B0=E4=B8=AD?= Date: Tue, 26 Jul 2022 08:15:08 +0200 Subject: [PATCH 29/42] introduced OtherCharges parameter --- src/Datatype/EU/ExportDeclaration.php | 6 +++++ src/Datatype/EU/OtherCharge.php | 35 +++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 src/Datatype/EU/OtherCharge.php diff --git a/src/Datatype/EU/ExportDeclaration.php b/src/Datatype/EU/ExportDeclaration.php index 9de2c25..0f8cee5 100644 --- a/src/Datatype/EU/ExportDeclaration.php +++ b/src/Datatype/EU/ExportDeclaration.php @@ -14,6 +14,12 @@ class ExportDeclaration extends \Mtc\Dhl\Datatype\AM\ExportDeclaration * @var array */ protected $params = [ + 'OtherCharges' => [ + 'type' => 'OtherCharge', + 'required' => false, + 'subobject' => true, + 'multivalues' => true, + ], 'InterConsignee' => [ 'type' => '', 'required' => false, diff --git a/src/Datatype/EU/OtherCharge.php b/src/Datatype/EU/OtherCharge.php new file mode 100644 index 0000000..5679c3f --- /dev/null +++ b/src/Datatype/EU/OtherCharge.php @@ -0,0 +1,35 @@ + [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + 'OtherChargeValue' => [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ], + 'OtherChargeType' => [ + 'type' => '', + 'required' => false, + 'subobject' => false, + ] + ]; +} From d89062367087d4bb8809962bf2226f3f770a559a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=92=8C=E5=AD=90=E7=94=B0=E4=B8=AD?= Date: Tue, 26 Jul 2022 09:46:33 +0200 Subject: [PATCH 30/42] Changed package name --- changelog.md | 2 ++ composer.json | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index d0f7e22..8b4ada3 100644 --- a/changelog.md +++ b/changelog.md @@ -7,3 +7,5 @@ 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 - introduced OtherCharges parameter diff --git a/composer.json b/composer.json index 76aa969..b51a8d0 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "mtcmedia/dhl-api", + "name": "bambinifashion-com/dhl-api", "description": "PHP library to communicate with the DHL XML Services.", "require": { "php": ">=7.1", From 57c4799a83cb2e9379fb14367e05e98eec942d06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=92=8C=E5=AD=90=E7=94=B0=E4=B8=AD?= Date: Wed, 27 Jul 2022 10:10:09 +0200 Subject: [PATCH 31/42] Position matters --- src/Datatype/EU/ExportDeclaration.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Datatype/EU/ExportDeclaration.php b/src/Datatype/EU/ExportDeclaration.php index 0f8cee5..278de2c 100644 --- a/src/Datatype/EU/ExportDeclaration.php +++ b/src/Datatype/EU/ExportDeclaration.php @@ -14,12 +14,6 @@ class ExportDeclaration extends \Mtc\Dhl\Datatype\AM\ExportDeclaration * @var array */ protected $params = [ - 'OtherCharges' => [ - 'type' => 'OtherCharge', - 'required' => false, - 'subobject' => true, - 'multivalues' => true, - ], 'InterConsignee' => [ 'type' => '', 'required' => false, @@ -91,6 +85,12 @@ class ExportDeclaration extends \Mtc\Dhl\Datatype\AM\ExportDeclaration 'required' => false, 'subobject' => false, ], + 'OtherCharges' => [ + 'type' => 'OtherCharge', + 'required' => false, + 'subobject' => true, + 'multivalues' => true, + ], 'ExportLineItems' => [ 'type' => 'ExportLineItem', 'required' => false, From 16994ca913dff12405b3a86002b1a9f83fd82e00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=92=8C=E5=AD=90=E7=94=B0=E4=B8=AD?= Date: Wed, 27 Jul 2022 14:32:54 +0200 Subject: [PATCH 32/42] Better types --- src/Datatype/EU/OtherCharge.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Datatype/EU/OtherCharge.php b/src/Datatype/EU/OtherCharge.php index 5679c3f..9769def 100644 --- a/src/Datatype/EU/OtherCharge.php +++ b/src/Datatype/EU/OtherCharge.php @@ -17,19 +17,21 @@ class OtherCharge extends Base */ protected $params = [ 'OtherChargeCaption' => [ - 'type' => '', + 'type' => 'string', 'required' => false, 'subobject' => false, ], 'OtherChargeValue' => [ - 'type' => '', - 'required' => false, + 'type' => 'decimal', + 'required' => true, 'subobject' => false, ], 'OtherChargeType' => [ - 'type' => '', - 'required' => false, + 'type' => 'string', + 'required' => true, 'subobject' => false, + 'length' => '5', + 'enumeration' => 'ADMIN,DELIV,DOCUM,EXPED,EXCHA,FRCST,SSRGE,LOGST,SOTHR,SPKGN,PICUP,HRCRG,VATCR,INSCH,REVCH', ] ]; } From 3973d3098e6cbdc79d88cd006d1574a6005a74b1 Mon Sep 17 00:00:00 2001 From: Arpit Patidar <44097148+iamarpitpatidar@users.noreply.github.com> Date: Sat, 30 Jul 2022 16:52:14 +0530 Subject: [PATCH 33/42] updated required details --- src/Datatype/EU/Shipper.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Datatype/EU/Shipper.php b/src/Datatype/EU/Shipper.php index 1ff3764..5f281c8 100644 --- a/src/Datatype/EU/Shipper.php +++ b/src/Datatype/EU/Shipper.php @@ -22,7 +22,7 @@ class Shipper extends \Mtc\Dhl\Datatype\AM\Shipper protected $params = [ 'ShipperID' => [ 'type' => 'ShipperID', - 'required' => false, + 'required' => true, 'subobject' => false, 'comment' => 'Shipper\'s ID', 'maxLength' => '30', @@ -93,7 +93,7 @@ class Shipper extends \Mtc\Dhl\Datatype\AM\Shipper ], 'City' => [ 'type' => 'City', - 'required' => false, + 'required' => true, 'subobject' => false, 'comment' => 'City name', 'maxLength' => '35', @@ -135,14 +135,14 @@ class Shipper extends \Mtc\Dhl\Datatype\AM\Shipper ], 'CountryCode' => [ 'type' => 'CountryCode', - 'required' => false, + 'required' => true, 'subobject' => false, 'comment' => 'ISO country codes', 'length' => '2', ], 'CountryName' => [ 'type' => 'CountryName', - 'required' => false, + 'required' => true, 'subobject' => false, 'comment' => 'ISO country name', 'maxLength' => '35', @@ -159,7 +159,7 @@ class Shipper extends \Mtc\Dhl\Datatype\AM\Shipper ], 'Contact' => [ 'type' => 'Contact', - 'required' => false, + 'required' => true, 'subobject' => true, ], 'RegistrationNumbers' => [ From 2ec586dfbc4de0889b75ca8c8c569ab0c162ce68 Mon Sep 17 00:00:00 2001 From: Arpit Patidar <44097148+iamarpitpatidar@users.noreply.github.com> Date: Sat, 30 Jul 2022 17:42:45 +0530 Subject: [PATCH 34/42] Update Consignee.php RegistrationNumbers and BusinessPartyTypeCode exists in consignee element --- src/Datatype/AM/Consignee.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/Datatype/AM/Consignee.php b/src/Datatype/AM/Consignee.php index 0b457b2..c82dd03 100644 --- a/src/Datatype/AM/Consignee.php +++ b/src/Datatype/AM/Consignee.php @@ -88,5 +88,23 @@ class Consignee extends Base '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)', + ], ]; } From 36c844a2073182d2577d1cf1a61d87f4ea742c5c Mon Sep 17 00:00:00 2001 From: bambinifashion-com <107098675+bambinifashion-com@users.noreply.github.com> Date: Tue, 27 Sep 2022 10:27:18 +0200 Subject: [PATCH 35/42] Reverted to the package name --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b51a8d0..76aa969 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "bambinifashion-com/dhl-api", + "name": "mtcmedia/dhl-api", "description": "PHP library to communicate with the DHL XML Services.", "require": { "php": ">=7.1", From cb9d6147eb2a246b1d88713ce85f7bf0dbe4ad73 Mon Sep 17 00:00:00 2001 From: Martins Fridenbergs Date: Tue, 27 Sep 2022 11:38:43 +0300 Subject: [PATCH 36/42] changelog udpate --- changelog.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 8b4ada3..eff3bd7 100644 --- a/changelog.md +++ b/changelog.md @@ -8,4 +8,8 @@ v2.0.0 - Updated Shipment Validation to DHL v10 v2.0.1 - Removed debugging from Datatype/Base.php -v2.0.2 - introduced OtherCharges parameter +v2.0.2 - Examples updated + +v2.0.3 - Updates to Shipper & Consignee objects + +v2.0.4 - introduced OtherCharges parameter From c2598e606b61f4b1ec25ca69ec39ffb1ae34e20d Mon Sep 17 00:00:00 2001 From: Dmitry Vorobyev Date: Sat, 4 Mar 2023 18:59:45 -0500 Subject: [PATCH 37/42] fixed empty Pieces structure --- src/Datatype/AM/ShipmentInfo.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Datatype/AM/ShipmentInfo.php b/src/Datatype/AM/ShipmentInfo.php index 55db2c4..8824f1c 100644 --- a/src/Datatype/AM/ShipmentInfo.php +++ b/src/Datatype/AM/ShipmentInfo.php @@ -58,9 +58,10 @@ class ShipmentInfo extends Base 'subobject' => true, ], 'Pieces' => [ - 'type' => '', + 'type' => 'Piece', 'required' => false, 'subobject' => true, + 'multivalues' => true, ], 'Weight' => [ 'type' => 'string', From c3bd6fd0137267a7388c6d4cc86a72aa63348291 Mon Sep 17 00:00:00 2001 From: Dmitry Vorobyev Date: Sat, 4 Mar 2023 19:07:27 -0500 Subject: [PATCH 38/42] fixed datetime issue --- src/Datatype/AM/ShipmentInfo.php | 2 +- src/Datatype/EU/ShipmentInfo.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Datatype/AM/ShipmentInfo.php b/src/Datatype/AM/ShipmentInfo.php index 8824f1c..65d5d67 100644 --- a/src/Datatype/AM/ShipmentInfo.php +++ b/src/Datatype/AM/ShipmentInfo.php @@ -55,7 +55,7 @@ class ShipmentInfo extends Base 'ShipmentDate' => [ 'type' => 'dateTime', 'required' => false, - 'subobject' => true, + 'subobject' => false, ], 'Pieces' => [ 'type' => 'Piece', diff --git a/src/Datatype/EU/ShipmentInfo.php b/src/Datatype/EU/ShipmentInfo.php index 412a3f8..65196f9 100644 --- a/src/Datatype/EU/ShipmentInfo.php +++ b/src/Datatype/EU/ShipmentInfo.php @@ -49,7 +49,7 @@ class ShipmentInfo extends \Mtc\Dhl\Datatype\AM\ShipmentInfo 'ShipmentDate' => [ 'type' => 'dateTime', 'required' => false, - 'subobject' => true, + 'subobject' => false, ], 'Pieces' => [ 'type' => 'Piece', From 818bba6cbccc6d1e3c2013a7ebba5c4ee9444ed1 Mon Sep 17 00:00:00 2001 From: Dmitry Vorobyev Date: Sat, 4 Mar 2023 19:12:39 -0500 Subject: [PATCH 39/42] tracking response example --- docs/tracking.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/tracking.md b/docs/tracking.md index b6fd2ae..1888e8b 100644 --- a/docs/tracking.md +++ b/docs/tracking.md @@ -12,6 +12,10 @@ $tracking->PiecesEnabled = 'S'; $client = new Web($this->getEnvironment()); $xml_response = $client->call($tracking); + +$result = new TrackingResponse(); +$result->initFromXML($xml_response); +echo $result->AWBInfo->Status->ActionStatus; ``` If you need XML request for the DHL certification you can obtain by calling the following code From cd2a6d7276010eb8c9c820def84782060e87f1d9 Mon Sep 17 00:00:00 2001 From: Eduard Lleshi Date: Wed, 29 Mar 2023 15:18:34 +0200 Subject: [PATCH 40/42] add UseDHLInvoice & DHLInvoiceLanguageCode params --- src/Entity/EU/ShipmentRequest.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Entity/EU/ShipmentRequest.php b/src/Entity/EU/ShipmentRequest.php index 7e9d314..8c2ec46 100644 --- a/src/Entity/EU/ShipmentRequest.php +++ b/src/Entity/EU/ShipmentRequest.php @@ -115,6 +115,19 @@ class ShipmentRequest extends Base 'required' => false, 'subobject' => true, ], + '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, From 0bf56d474ca0fc5f5860dbf9bbd980623087e6dc Mon Sep 17 00:00:00 2001 From: Jack Donaldson Date: Wed, 23 Oct 2024 11:31:58 +0100 Subject: [PATCH 41/42] Adding ValueAddedServices datatype to allow for DHL Paperless --- src/Datatype/AM/ValueAddedServices.php | 28 ++++++++++++++++++++++++++ src/Datatype/EU/ValueAddedServices.php | 19 +++++++++++++++++ src/Entity/EU/ShipmentRequest.php | 5 +++++ 3 files changed, 52 insertions(+) create mode 100644 src/Datatype/AM/ValueAddedServices.php create mode 100644 src/Datatype/EU/ValueAddedServices.php 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/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/Entity/EU/ShipmentRequest.php b/src/Entity/EU/ShipmentRequest.php index 8c2ec46..28c6786 100644 --- a/src/Entity/EU/ShipmentRequest.php +++ b/src/Entity/EU/ShipmentRequest.php @@ -100,6 +100,11 @@ class ShipmentRequest extends Base 'required' => false, 'subobject' => true, ], + 'ValueAddedServices' => [ + 'type' => 'ValueAddedServices', + 'required' => false, + 'subobject' => true, + ], 'Consignee' => [ 'type' => 'Consignee', 'required' => false, From 9718bde2b5383f46f63c81783953d2e16fc6838b Mon Sep 17 00:00:00 2001 From: "Jordan Evans | mtc." Date: Tue, 14 Oct 2025 06:46:05 -0700 Subject: [PATCH 42/42] Fixed error with BusinessPartyTypeCode in wrong order --- src/Datatype/EU/Consignee.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Datatype/EU/Consignee.php b/src/Datatype/EU/Consignee.php index 49f9596..c129145 100644 --- a/src/Datatype/EU/Consignee.php +++ b/src/Datatype/EU/Consignee.php @@ -16,18 +16,6 @@ class Consignee extends \Mtc\Dhl\Datatype\AM\Consignee 'comment' => 'Name of company / business', 'minLength' => '0', ], - 'BusinessPartyTypeCode' => [ - 'type' => 'string', - 'required' => false, - 'subobject' => false, - 'comment' => 'Possible Values: - - BU (business) - - DC (direct consumer) - - GV (government) - - OT (other) - - PR (private) - - RE (reseller)', - ], 'SuiteDepartmentName' => [ 'type' => 'SuiteDepartmentName', 'required' => false, @@ -128,5 +116,17 @@ class Consignee extends \Mtc\Dhl\Datatype\AM\Consignee '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)', + ], ]; }