ePages 7.21.0 - DE_EPAGES/DHLIntraship/API/Tools.pm

Package DE_EPAGES::DHLIntraship::API::Tools

Useful functions for this cartridge.

Functions

GetCustomerNumber
GetPackageType
IsDateInThePast
LogShopContext
new
truncateAttribute

GetCustomerNumber

Gets Customer Number.

Syntax
GetCustomerNumber( $ShippingFulfillmentMethod, $Address );
Input
$ShippingFulfillmentMethod (object)
ShippingFulfillmentMethodDHLIntraship
$Address (object)
Address
Return
$CustomerNumber (string)
CustomerNumber

GetPackageType

Obtains package type.

Syntax
GetPackageType( $CustomerNumber );
Input
$CustomerNumber (string)
CustomerNumber
Return
$PackageType (string)
Package Type

IsDateInThePast

Finds out whether a date is in the past or not.

Syntax
IsDateInThePast( $Date );
Input
$Date (DateTime)
Date
Return
$IsDateInThePast (boolean)
Whether a date is in the past or not.

LogShopContext

it allows to include shop context into logs for the specified function pointer

Syntax
LogShopContext( $ShopObject, $MethodName, $FunctionPointer );
Input
$ShopObject (object)
an epages object that belongs to a shop
$MethodName (string)
name of the method
$FunctionPointer (ref.code)
reference pointer to a code

new

Class constructor.

Syntax
new( );
Return
$self (object)
self

truncateAttribute

Truncates an attribute to its maximum allowed length.

Syntax
truncateAttribute( $Attribute, $FieldName );
Input
$Attribute (String)
Attribute to truncate.
$FieldName (String)
Name of the field to truncate.
Return
$TruncatedAttribute (object)
Truncated attribute.