ePages 7.0.0 - DE_EPAGES/USPS/API/Tools.pm

Package DE_EPAGES::USPS::API::Tools

This package provides general tooling for USPS cartridge.

@EXPORT_OK
getUsZipCodeBaseOrEmpty
getUsZipCodeExtensionOrEmpty
getWebServiceURL
trimErrorDescription

Functions

getUsZipCodeBaseOrEmpty
getUsZipCodeExtensionOrEmpty
getWebServiceURL
trimErrorDescription

getUsZipCodeBaseOrEmpty

It takes out the zip code base from an US zipcode. It returns an empty string if code is not valid.

Syntax
$baseZipCode = $self->getUsZipCodeBaseOrEmpty($zipCode);
Input
$zipCode (string)
zip code string
Return
$baseZipCode (string)
base zip code string

getUsZipCodeExtensionOrEmpty

It takes out the zip code extension or an empty string.

Syntax
$extensionZipCode = $self->getUsZipCodeExtensionOrEmpty($zipCode);
Input
$zipCode (string)
zip code string
Return
$extensionZipCode (string)
base zip code string

getWebServiceURL

returns the Web service URL taking into account the status of the Shop

Syntax
$WebServiceURL = getWebServiceURL($ShippingFulfillmentMethod);
Example
my $WebServiceURL  = getWebServiceURL($ShippingFulfillmentMethod);
Input
#ShippingFulfillmentMethod (object)
shippingFulfillmentMethod object
Return
#WebServiceUrl (string)
Web Service URL

trimErrorDescription

provide a trimmed label error description from incoming raw error description

Syntax
$LabelErrorDescription = trimErrorDescription( $errorDescription );
Input
$errorDescription (string)
error description
Return
(string)
$LabelErrorDescription