DHL-PHP-SDK  v0.4
A wrapper for the DHL-XML-API Version 2
BusinessShipment Class Reference
Inheritance diagram for BusinessShipment:
Version

Public Member Functions

 __construct ($credentials, $testMode=false, $version=null)
 
 __destruct ()
 
 getLastXML ()
 
 getErrors ()
 
 setErrors ($errors)
 
 isLog ()
 
 setLog ($log)
 
 setCredentials ($credentials)
 
 getShipmentDetails ()
 
 setShipmentDetails ($shipmentDetails)
 
 getService ()
 
 setService ($service)
 
 getBank ()
 
 setBank ($bank)
 
 getSender ()
 
 setSender ($sender)
 
 getReceiver ()
 
 setReceiver ($receiver)
 
 getReturnReceiver ()
 
 setReturnReceiver ($returnReceiver)
 
 getExportDocument ()
 
 setExportDocument ($exportDocument)
 
 getSequenceNumber ()
 
 setSequenceNumber ($sequenceNumber)
 
 getReceiverEmail ()
 
 setReceiverEmail ($receiverEmail)
 
 getPrintOnlyIfReceiverIsValid ()
 
 setPrintOnlyIfReceiverIsValid ($printOnlyIfReceiverIsValid)
 
 getLabelResponseType ()
 
 setLabelResponseType ($labelResponseType)
 
 getShipmentOrders ()
 
 setShipmentOrders ($shipmentOrders)
 
 addShipmentOrder ($shipmentOrder)
 
 clearShipmentOrders ()
 
 countShipmentOrders ()
 
 getCustomAPIURL ()
 
 setCustomAPIURL ($customAPIURL)
 
 getVersion ($viaSOAP=false, $getBuildNumber=false, $returnAsArray=false)
 
 doManifest ($shipmentNumbers)
 
 getManifest ($manifestDate, $useIntTime=false)
 
 createShipment ()
 
 createShipmentOrder ()
 
 deleteShipment ($shipmentNumbers)
 
 deleteShipmentOrder ($shipmentNumbers)
 
 getShipmentLabel ($shipmentNumbers)
 
 getLabel ($shipmentNumbers)
 
 getExportDoc ($shipmentNumbers)
 
 validateShipment ()
 
- Public Member Functions inherited from Version
 getVersion ()
 
 getMayor ()
 
 getMinor ()
 

Data Fields

const DHL_WSDL_LIB_URL = 'https://cig.dhl.de/cig-wsdls/com/dpdhl/wsdl/geschaeftskundenversand-api/'
 
const DHL_SOAP_HEADER_URI = 'http://dhl.de/webservice/cisbase'
 
const DHL_SANDBOX_URL = 'https://cig.dhl.de/services/sandbox/soap'
 
const DHL_PRODUCTION_URL = 'https://cig.dhl.de/services/production/soap'
 
const NEWEST_VERSION = '2.2'
 
const RESPONSE_TYPE_URL = 'URL'
 
const RESPONSE_TYPE_B64 = 'B64'
 
const MAX_DHL_REQUESTS = 30
 

Protected Member Functions

 getAPIUrl ()
 
- Protected Member Functions inherited from Version
 __construct ($version)
 
 __destruct ()
 
 setVersion ($version)
 
 getVersionClass ()
 

Detailed Description

Definition at line 26 of file BusinessShipment.php.

Constructor & Destructor Documentation

§ __construct()

__construct (   $credentials,
  $testMode = false,
  $version = null 
)

BusinessShipment constructor.

Parameters
Credentials$credentials- DHL-Credentials-Object
bool | string$testMode- Use a specific Sandbox-Mode or Production-Mode Test-Mode (Normal): Credentials::TEST_NORMAL, 'test', true Test-Mode (Thermo-Printer): Credentials::TEST_THERMO_PRINTER, 'thermo' Live (No-Test-Mode): false - default
null | string$version- Version to use or null for the newest

Definition at line 253 of file BusinessShipment.php.

§ __destruct()

__destruct ( )

Clears Memory

Definition at line 281 of file BusinessShipment.php.

Member Function Documentation

§ addShipmentOrder()

addShipmentOrder (   $shipmentOrder)

Adds a Shipment-Order to the List

Parameters
ShipmentOrder$shipmentOrder- Shipment-Order to add

Definition at line 846 of file BusinessShipment.php.

§ clearShipmentOrders()

clearShipmentOrders ( )

Clears the Shipment-Order list

Definition at line 853 of file BusinessShipment.php.

§ countShipmentOrders()

countShipmentOrders ( )

Returns how many Shipment-Orders are in this List

Returns
int - ShipmentOrder Count

Definition at line 862 of file BusinessShipment.php.

§ createShipment()

createShipment ( )

Alias for createShipmentOrder

Creates the Shipment-Request

Returns
bool|Response - false on error or DHL-Response Object

Definition at line 1205 of file BusinessShipment.php.

§ createShipmentOrder()

createShipmentOrder ( )

Creates the Shipment-Request

Returns
bool|Response - false on error or DHL-Response Object

Definition at line 1214 of file BusinessShipment.php.

§ deleteShipment()

deleteShipment (   $shipmentNumbers)

Alias for deleteShipmentOrder

Deletes a Shipment

Parameters
string|string[]$shipmentNumbers - Shipment-Number(s) of the Shipment(s) to delete (up to 30 Numbers)
Returns
bool|Response - Response

Definition at line 1382 of file BusinessShipment.php.

§ deleteShipmentOrder()

deleteShipmentOrder (   $shipmentNumbers)

Deletes a Shipment

Parameters
string|string[]$shipmentNumbers - Shipment-Number(s) of the Shipment(s) to delete (up to 30 Numbers)
Returns
bool|Response - Response

Definition at line 1392 of file BusinessShipment.php.

§ doManifest()

doManifest (   $shipmentNumbers)

Creates the doManifest-Request

Parameters
string|string[]$shipmentNumbers - Shipment-Number(s) for Manifest (up to 30 Numbers)
Returns
bool|Response - false on error or DHL-Response Object

Definition at line 1040 of file BusinessShipment.php.

§ getAPIUrl()

getAPIUrl ( )
protected

Get the Business-API-URL for this Version

Returns
string - Business-API-URL

Definition at line 308 of file BusinessShipment.php.

§ getBank()

getBank ( )

Get the Bank-Object

Returns
BankData|null - Bank-Object or null if none
Deprecated:

Definition at line 511 of file BusinessShipment.php.

§ getCustomAPIURL()

getCustomAPIURL ( )

Get the Custom-API-URL

Returns
null|string - Custom-API-URL or null for none

Definition at line 871 of file BusinessShipment.php.

§ getErrors()

getErrors ( )

Get Error-Array

Returns
string[] - Error-Array

Definition at line 354 of file BusinessShipment.php.

§ getExportDoc()

getExportDoc (   $shipmentNumbers)

Requests a Export-Document again

Parameters
string|string[]$shipmentNumbers - Shipment-Number(s) of the Export-Document(s) (up to 30 Numbers)
Returns
bool|Response - Response or false on error

Definition at line 1581 of file BusinessShipment.php.

§ getExportDocument()

getExportDocument ( )

Get the ExportDocument-Object

Returns
ExportDocument|null - ExportDocument-Object or null if none
Deprecated:
  • These details belong to the ShipmentOrder Object, please do them there

Definition at line 661 of file BusinessShipment.php.

§ getLabel()

getLabel (   $shipmentNumbers)

Requests a Shipment-Label again

Parameters
string|string[]$shipmentNumbers - Shipment-Number(s) of the Label(s) (up to 30 Numbers)
Returns
bool|Response - Response or false on error

Definition at line 1491 of file BusinessShipment.php.

§ getLabelResponseType()

getLabelResponseType ( )

Get the Label-Response type

Returns
null|string - Label-Response type | null means DHL-Default

Definition at line 799 of file BusinessShipment.php.

§ getLastXML()

getLastXML ( )

Returns the Last XML-Request or null

Returns
null|string - Last XML-Request or null if none

Definition at line 333 of file BusinessShipment.php.

§ getManifest()

getManifest (   $manifestDate,
  $useIntTime = false 
)

Creates the getManifest-Request

Parameters
string | int$manifestDate- Manifest-Date as String (YYYY-MM-DD) or the int time() value of the date
bool$useIntTime- Use the int Time Value instead of a String
Returns
bool|Response - false on error or DHL-Response Object

Definition at line 1112 of file BusinessShipment.php.

§ getPrintOnlyIfReceiverIsValid()

getPrintOnlyIfReceiverIsValid ( )

Get if the label should only printed if the Receiver-Address is valid

Returns
bool|null - Should the label only printed on a valid Address | null means DHL-Default
Deprecated:
  • These details belong to the ShipmentOrder Object, please do them there

Definition at line 763 of file BusinessShipment.php.

§ getReceiver()

getReceiver ( )

Get the Receiver-Object

Returns
Receiver|PackStation|Filial|null - Receiver-Object or null if none
Deprecated:
  • These details belong to the ShipmentOrder Object, please do them there

Definition at line 585 of file BusinessShipment.php.

§ getReceiverEmail()

getReceiverEmail ( )

Get the Receiver-Email

Returns
null|string - Receiver-Email or null if none
Deprecated:
  • Moved Receiver E-Mail to correct Class (Shipment-Details)

Definition at line 733 of file BusinessShipment.php.

§ getReturnReceiver()

getReturnReceiver ( )

Get the ReturnReceiver-Object

Usually only used for Re-Tour (In most cases the same Address like the Sender)

Returns
ReturnReceiver|null - ReturnReceiver-Object or null if none
Deprecated:
  • These details belong to the ShipmentOrder Object, please do them there

Definition at line 623 of file BusinessShipment.php.

§ getSender()

getSender ( )

Get the Sender-Object

Returns
Sender|null - Sender-Object or null if none
Deprecated:
  • These details belong to the ShipmentOrder Object, please do them there

Definition at line 549 of file BusinessShipment.php.

§ getSequenceNumber()

getSequenceNumber ( )

Get the Sequence-Number

Returns
string - Sequence-Number
Deprecated:
  • These details belong to the ShipmentOrder Object, please do them there

Definition at line 697 of file BusinessShipment.php.

§ getService()

getService ( )

Get the Service-Object

Returns
Service|null - Service-Object or null if none
Deprecated:

Definition at line 473 of file BusinessShipment.php.

§ getShipmentDetails()

getShipmentDetails ( )

Get Shipment-Details-Object

Returns
ShipmentDetails - Shipment-Details-Object
Deprecated:
  • These details belong to the ShipmentOrder Object, please do them there

Definition at line 437 of file BusinessShipment.php.

§ getShipmentLabel()

getShipmentLabel (   $shipmentNumbers)

Alias for getLabel

Requests a Shipment-Label again

Parameters
string|string[]$shipmentNumbers - Shipment-Number(s) of the Label(s) (up to 30 Numbers)
Returns
bool|Response - Response or false on error

Definition at line 1481 of file BusinessShipment.php.

§ getShipmentOrders()

getShipmentOrders ( )

Get the list with all Shipment-Orders Objects

Returns
ShipmentOrder[] - List with all Shipment-Orders Objects

Definition at line 817 of file BusinessShipment.php.

§ getVersion()

getVersion (   $viaSOAP = false,
  $getBuildNumber = false,
  $returnAsArray = false 
)

Gets the current (local)-Version or Request it via SOAP from DHL

Parameters
bool$viaSOAP- Request the Version from DHL (Default: false - get local-version as string)
bool$getBuildNumber- Return the Build number as well (String look then like this: 2.2.12) Only possible via SOAP - Default false
bool$returnAsArray- Return the Version as Array - Default: false
Returns
bool|array|string - Returns the Version as String|array or false on error

Definition at line 961 of file BusinessShipment.php.

§ isLog()

isLog ( )

Returns if log is enabled

Returns
bool - Log enabled

Definition at line 399 of file BusinessShipment.php.

§ setBank()

setBank (   $bank)

Set the Bank-Object

Parameters
BankData | null$bank- Bank-Object or null for none
Deprecated:

Definition at line 530 of file BusinessShipment.php.

§ setCredentials()

setCredentials (   $credentials)

Set Credentials-Object

Parameters
Credentials$credentials- Credentials-Object

Definition at line 426 of file BusinessShipment.php.

§ setCustomAPIURL()

setCustomAPIURL (   $customAPIURL)

Set the Custom-API-URL

Parameters
null | string$customAPIURL- Custom-API-URL or null for none

Definition at line 880 of file BusinessShipment.php.

§ setErrors()

setErrors (   $errors)

Set Error-Array

Parameters
string[]$errors - Error-Array

Definition at line 363 of file BusinessShipment.php.

§ setExportDocument()

setExportDocument (   $exportDocument)

Set the ExportDocument-Object

Parameters
ExportDocument | null$exportDocument- ExportDocument-Object or null for none
Deprecated:
  • These details belong to the ShipmentOrder Object, please do them there

Definition at line 679 of file BusinessShipment.php.

§ setLabelResponseType()

setLabelResponseType (   $labelResponseType)

Set the Label-Response type

Parameters
null | string$labelResponseType- Label-Response type | null uses DHL-Default

Definition at line 808 of file BusinessShipment.php.

§ setLog()

setLog (   $log)

Set if log enabled

Parameters
bool$log- Enable log

Definition at line 408 of file BusinessShipment.php.

§ setPrintOnlyIfReceiverIsValid()

setPrintOnlyIfReceiverIsValid (   $printOnlyIfReceiverIsValid)

Set if the label should only printed if the Receiver-Address is valid

WARNING: The Address-Validation can fail sometimes also on existing Addresses (for example new streets) use with care!

Parameters
bool | null$printOnlyIfReceiverIsValid- Should the label only printed on a valid Address | null uses default from DHL
Deprecated:
  • These details belong to the ShipmentOrder Object, please do them there

Definition at line 783 of file BusinessShipment.php.

§ setReceiver()

setReceiver (   $receiver)

Set the Receiver-Object

Parameters
Receiver | PackStation | Filial | null$receiver- Receiver-Object or null if none
Deprecated:
  • These details belong to the ShipmentOrder Object, please do them there

Definition at line 603 of file BusinessShipment.php.

§ setReceiverEmail()

setReceiverEmail (   $receiverEmail)

Set the Receiver-Email

Parameters
null | string$receiverEmail- Receiver-Email or null for none
Deprecated:
  • Moved Receiver E-Mail to correct Class (Shipment-Details)

Definition at line 748 of file BusinessShipment.php.

§ setReturnReceiver()

setReturnReceiver (   $returnReceiver)

Set the ReturnReceiver-Object

Usually only used for Re-Tour (In most cases the same Address like the Sender)

Parameters
ReturnReceiver | null$returnReceiver- ReturnReceiver-Object or null for none
Deprecated:
  • These details belong to the ShipmentOrder Object, please do them there

Definition at line 643 of file BusinessShipment.php.

§ setSender()

setSender (   $sender)

Set the Sender-Object

Parameters
Sender | null$sender- Sender-Object or null if none
Deprecated:
  • These details belong to the ShipmentOrder Object, please do them there

Definition at line 567 of file BusinessShipment.php.

§ setSequenceNumber()

setSequenceNumber (   $sequenceNumber)

Set the Sequence-Number

Parameters
string$sequenceNumber- sequence-Number
Deprecated:
  • These details belong to the ShipmentOrder Object, please do them there

Definition at line 715 of file BusinessShipment.php.

§ setService()

setService (   $service)

Set the Service-Object

Parameters
Service | null$service- Service-Object or null for none
Deprecated:

Definition at line 492 of file BusinessShipment.php.

§ setShipmentDetails()

setShipmentDetails (   $shipmentDetails)

Set Shipment-Details-Object

Parameters
ShipmentDetails$shipmentDetails- Shipment-Details-Object
Deprecated:
  • These details belong to the ShipmentOrder Object, please do them there

Definition at line 455 of file BusinessShipment.php.

§ setShipmentOrders()

setShipmentOrders (   $shipmentOrders)

Set the list with all Shipment-Orders Objects

Parameters
ShipmentOrder[]|ShipmentOrder$shipmentOrders - Shipment-Order Object-Array or a Single Shipment-Order Object

Definition at line 826 of file BusinessShipment.php.

§ validateShipment()

validateShipment ( )

Validates a Shipment

Returns
bool|Response - Response or false on error

Definition at line 1654 of file BusinessShipment.php.

Field Documentation

§ DHL_PRODUCTION_URL

const DHL_PRODUCTION_URL = 'https://cig.dhl.de/services/production/soap'

DHL-Live SOAP-URL

Definition at line 45 of file BusinessShipment.php.

§ DHL_SANDBOX_URL

const DHL_SANDBOX_URL = 'https://cig.dhl.de/services/sandbox/soap'

DHL-Sandbox SOAP-URL

Definition at line 40 of file BusinessShipment.php.

§ DHL_SOAP_HEADER_URI

const DHL_SOAP_HEADER_URI = 'http://dhl.de/webservice/cisbase'

DHL-Soap-Header URL

Definition at line 35 of file BusinessShipment.php.

§ DHL_WSDL_LIB_URL

const DHL_WSDL_LIB_URL = 'https://cig.dhl.de/cig-wsdls/com/dpdhl/wsdl/geschaeftskundenversand-api/'

DHL Origin WSDL-Lib-URL

Definition at line 30 of file BusinessShipment.php.

§ MAX_DHL_REQUESTS

const MAX_DHL_REQUESTS = 30

Maximum requests to DHL in one call

Definition at line 65 of file BusinessShipment.php.

§ NEWEST_VERSION

const NEWEST_VERSION = '2.2'

Newest-Version

Definition at line 50 of file BusinessShipment.php.

§ RESPONSE_TYPE_B64

const RESPONSE_TYPE_B64 = 'B64'

Response-Type Base64

Definition at line 60 of file BusinessShipment.php.

§ RESPONSE_TYPE_URL

const RESPONSE_TYPE_URL = 'URL'

Response-Type URL

Definition at line 55 of file BusinessShipment.php.


The documentation for this class was generated from the following file: