You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 21, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: examples/getting-started.md
+49-26Lines changed: 49 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -97,11 +97,11 @@ You need to setup the Shipment-Details for your Shipment (like Size/Weight etc).
97
97
98
98
```php
99
99
// Create the Object with the first 10 Digits of your Account-Number (EKP).
100
-
// You can use the \Petschko\DHL\Credentials function "->getEko((int) amount)" to get just the first 10 digits if longer
101
-
$shipmentDetails = new \Petschko\DHL\ShipmentDetails((string) $credentials->getEkp(10) . '0101'); // Ensure the 0101 at the end
100
+
// You can use the \Petschko\DHL\Credentials function "->getEkp((int) amount)" to get just the first 10 digits if longer
101
+
$shipmentDetails = new \Petschko\DHL\ShipmentDetails((string) $credentials->getEkp(10) . '0101'); // Ensure the 0101 at the end (or the number you need for your Product)
102
102
```
103
103
104
-
You can setup details for that, if you need. If you don't set them, it use the default values _(This Part is Optional)_
104
+
You can setup details for that, if you need. If you don't set them, it uses the default values _(This Part is Optional)_
Now you have to create a Sender and a Receiver. They are similar to set, just the XML creation is different so you have to use different Objects for that.
162
158
@@ -173,12 +169,10 @@ Setup all **Required** Information
173
169
```php
174
170
$sender->setName((string) 'Organisation Petschko'); // Can be a Person-Name or Company Name
175
171
176
-
// You can add the whole address with that setter if you want
@@ -219,7 +213,7 @@ I'll not explain the Service-Object because there are too many settings. Please
219
213
220
214
##### \Petschko\DHL\BankData Object
221
215
222
-
You can also use the `\Petschko\DHL\BankData` Object. Bank data can be provided for different purposes. E.g. if COD is booked as service, bank data must be provided by DHL customer (mandatory server logic). The collected money will be transferred to specified bank account.
216
+
You can also use the `\Petschko\DHL\BankData` Object. Bank data can be provided for different purposes. E.g. if COD (Cash on Delivery) is booked as service, bank data must be provided by DHL customer (mandatory server logic). The collected money will be transferred to specified bank account.
223
217
224
218
You can look to the PHP-File of the `\Petschko\DHL\BankData`-Object, and checkout what you can set there. I will not explain it here.
225
219
@@ -265,9 +259,6 @@ $dhl->setLog((bool) true);
265
259
// Set a Sequence-Number if you need a referrence when you get the response
If the request failed, you get `false` else a `\Petschko\DHL\Response` Object.
384
+
For more Information about the Response, look down where I describe the `\Petschko\DHL\Response` Class.
385
+
386
+
### GetManifest
387
+
388
+
_Please note, that you need the `\Petschko\DHL\Credentials` Object with Valid Login-Information for that._
389
+
390
+
I personally also don't know for what is this for, but it works!
391
+
392
+
#### Classes used
393
+
394
+
-`\Petschko\DHL\Credentials`**(Req)** - Login Information
395
+
-`\Petschko\DHL\BusinessShipment`**(Req)** - Manages all Actions + Information
396
+
- `\Petschko\DHL\Version` (Parent)
397
+
-`\Petschko\DHL\Response`**(Req|Auto)** - Response Information
398
+
- `\Petschko\DHL\Version` (Parent)
399
+
400
+
#### How to create
401
+
402
+
The syntax is quite simple, you just need to specify the date where you want to have the manifest:
403
+
404
+
```php
405
+
// Create a \Petschko\DHL\BusinessShipment Object with your credentials
406
+
$dhl = new \Petschko\DHL\BusinessShipment($credentials);
407
+
408
+
// Request to get the manifest from a specific date, the date can be given with an ISO-Date String (YYYY-MM-DD) or with the `time()` value of the day
409
+
$response = $dhl->getManifest('2018-08-06');
410
+
```
411
+
412
+
If the request failed, you get `false` else a `\Petschko\DHL\Response` Object.
413
+
For more Information about the Response, look down where I describe the `\Petschko\DHL\Response` Class.
393
414
394
415
### \Petschko\DHL\Response Object
395
416
@@ -403,6 +424,8 @@ I will explain which values you can get from the Response-Object
403
424
(string) $response->getShipmentNumber(); // Returns the Shipment-Number of the Request or null
404
425
(string) $response->getLabel(); // Returns the Label URL or Base64-Label-String or null
405
426
(string) $response->getReturnLabel(); // Returns the ReturnLabel (URL/B64) or null
427
+
(string) $response->getExportDoc(); // Returns the Export-Document (URL/B64) or null (Can only be obtained if the Export-Doc Object was added to the Shipment request)
428
+
(string) $response->getManifestData(); // Returns the Manifest PDF-Data as Base64 String (Can be obtained via getManifest) or null
406
429
(string) $response->getSequenceNumber(); // Returns your provided sequence number or null
407
430
(int) $response->getStatusCode(); // Returns the Status-Code (Difference to DHL - Weak-Validation is 1 not 0)
408
431
(string) $response->getStatusText(); // Returns the Status-Text or null
@@ -411,7 +434,7 @@ I will explain which values you can get from the Response-Object
411
434
412
435
If a value is not set you get usually `null` as result. Not every Action fills out all of these values!
413
436
414
-
You can also take a look at the Class Constance's, they are helping you to identify the Status-Codes:
437
+
You can also take a look at the Class Constants, they are helping you to identify the Status-Codes:
0 commit comments