ePages 6.17.35 - DE_EPAGES/DHL/API/Tools.pm

Package DE_EPAGES::DHL::API::Tools

This is a tool library used for common DHL tasks

@EXPORT_OK
ConvertFromDHLDate
ConvertStringToDateTime
GetMinShippingLengthFromDB
GetMaxShippingLengthFromDB
GetMinShippingWidthFromDB
GetMaxShippingWidthFromDB
GetMinShippingHeightFromDB
GetMaxShippingHeightFromDB
GetMinShippingWeightFromDB
GetMaxShippingWeightFromDB
GetDHLProductFromDB
DeleteDHLProductListFromDB
DHLShippingLabelIsDHLDeliveryDestInDB
OrderIsDHLDeliveryDestInDB
GetDHLProductMaxDimensionsFromDB
IsInteger

Functions

ConvertFromDHLDate
ConvertStringToDateTime
DHLShippingLabelIsDHLDeliveryDestInDB
DeleteDHLProductListFromDB
GetDHLProductFromDB
GetDHLProductMaxDimensionsFromDB
GetMaxShippingHeightFromDB
GetMaxShippingLengthFromDB
GetMaxShippingWeightFromDB
GetMaxShippingWidthFromDB
GetMinShippingHeightFromDB
GetMinShippingLengthFromDB
GetMinShippingWeightFromDB
GetMinShippingWidthFromDB
IsInteger
OrderIsDHLDeliveryDestInDB

ConvertFromDHLDate

Parses an DHL DateTime string and returns a DateTime object. Converts the time to the local server time zone.

Syntax
ConvertFromDHLDate( $DateString );
Input
$DateString (string)
datetime string in ISO8601
Return
$dt (DateTime object)
converted date

ConvertStringToDateTime

Converts a string to a DateTime object, using locale de_DE and timezone GMT+1

Syntax
ConvertStringToDateTime( $UnconvertedString );
Input
$UnconvertedString (string)
datetime string
Return
$DateTime (DateTime)
datetime object

DHLShippingLabelIsDHLDeliveryDestInDB

Checks if a shipping destination country of a DHL shipping label is in the list of valid delivery destinations. If not, the API cannot be used.

Syntax
DHLShippingLabelIsDHLDeliveryDestInDB( $DHLShippingLabelID );
Input
$DHLShippingLabelID (integer)
dhl shipping label id
Return
$DeliveryDestIsInDB (boolean)
true if the delivery destination is ok

DeleteDHLProductListFromDB

Deletes all DHL ProductList entries from DB

Syntax
DeleteDHLProductListFromDB( );

GetDHLProductFromDB

Get dhl product information.

Syntax
GetDHLProductFromDB( );
Input
$DHLShippingLabel (DE_EPAGES::DHL::API::Object::DHLShippingLabel)
shipping label
Return
$hDHLProduct (ref.hash)
dhl product description. used keys:
  • DHLProductID
  • DHLProductListID
  • ValidFrom
  • ValidTo
  • CountryCode
  • OverallPriceAmountEUR
  • DisplayName
  • DisplayText

GetDHLProductMaxDimensionsFromDB

Returns max dimensions from db

Syntax
GetDHLProductMaxDimensionsFromDB( $DHLProductID );
Input
$DHLProductID (integer)
dhl product id
Return
$hDHLProductMaxDimensions (ref.hash)
Max dimensions. Used keys:
  • DHLProductID - DHL Product ID - string
  • MaxLengthCm -
  • MaxWidthCm -
  • MaxHeightCm -

  • GetMaxShippingHeightFromDB

    Get maximum height of a shipping from db

    Syntax
    GetMaxShippingHeightFromDB( );
    Return
    $MaxShippingHeightFromDB (float)
    maximum height

    GetMaxShippingLengthFromDB

    Get maximum length of a shipping from db

    Syntax
    GetMaxShippingLengthFromDB( );
    Return
    $MaxShippingLengthFromDB (float)
    maximum length

    GetMaxShippingWeightFromDB

    Get maximum weight of a shipping from db

    Syntax
    GetMaxShippingWeightFromDB( );
    Return
    $MaxShippingWeightFromDB (float)
    maximum weight

    GetMaxShippingWidthFromDB

    Get maximum width of a shipping from db

    Syntax
    GetMaxShippingWidthFromDB( );
    Return
    $MaxShippingWidthFromDB (float)
    maximum width

    GetMinShippingHeightFromDB

    Get minimum height of a shipping from db

    Syntax
    GetMinShippingHeightFromDB( );
    Return
    $MinShippingHeightFromDB (float)
    minimum height

    GetMinShippingLengthFromDB

    Get minimum length of a shipping from db

    Syntax
    GetMinShippingLengthFromDB( );
    Return
    $MinShippingLengthFromDB (float)
    minimum length

    GetMinShippingWeightFromDB

    Get minimum weight of a shipping from db

    Syntax
    GetMinShippingWeightFromDB( );
    Return
    $MinShippingWeightFromDB (float)
    minimum weight

    GetMinShippingWidthFromDB

    Get minimum width of a shipping from db

    Syntax
    GetMinShippingWidthFromDB( );
    Return
    $MinShippingWidthFromDB (float)
    minimum width

    IsInteger

    Checks if value is a (positive) integer

    Syntax
    IsInteger( $Value );
    Input
    $Value (integer)
    input value
    Return
    $IsInteger (boolean)
    True if value is an integer

    OrderIsDHLDeliveryDestInDB

    Checks if a shipping destination country of an order is in the list of valid delivery destinations. If not, the API cannot be used.

    Syntax
    OrderIsDHLDeliveryDestInDB( $OrderID );
    Input
    $OrderID (integer)
    order id
    Return
    $DeliveryDestIsInDB (boolean)
    true if the delivery destination is ok