Comments (3)
Hello Marko,
Thanks for your feedback.
I added multivalues handling for entities and datatypes.
Therefore, you should be able now to do the following :
use DHL\Datatype\GB\Piece;
// Test a ShipmentRequestRequest using DHL XML API
$sample = new ShipmentRequest();
// Set values of the request
$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';
from dhl-api.
Hello,
Congratulations on DHL-APi, very nice work.
I did as you said but I
Fatal error: Call to undefined method DHL\Datatype\GB\ShipmentDetails::addPiece()
I can not find the code for the function addPiece in source code
from dhl-api.
Hello Ominet,
The addPiece method is handled by the magic method __call in the base entity and datatype classes.
It is based on the definition of the property. If a property has multivalues set to true (that means that it is an array of elements), then the add{Propertyname} method will work.
Thanks,
from dhl-api.
Related Issues (20)
- where to find the configuration parameters for use DHL-API? HOT 1
- How to retrieve 6x4 labels
- Trying to get property of non-object HOT 1
- Barcodes is not defined for DHL\Entity\GB\ShipmentResponse HOT 5
- Cannot determine destination service HOT 2
- Issue in geeting Cost for DHL shipping services HOT 1
- How to print COD(Collect on delivery) in Shipment
- PickUp example HOT 5
- Lack of type "6X4_PDF,8X4_PDF" in Datatype/*/Label HOT 4
- How to get the credential HOT 2
- AWBnumber field size
- DHL Invoice Is not generate in label for non doc courier.
- /rest/v2/Label
- Getting the actual shipping price the XML response HOT 2
- Add DocImages node HOT 1
- Proper response for getCapability or getQuote
- getting error while hit ShipmentRequest from sample HOT 2
- Not working GB/BookPURequest function HOT 2
- Error in writing data to XML file
- Plugin Woocommerce
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dhl-api.