ePages 7.0.0 - DE_EPAGES/USPS/API/WebServices/PackagePickupAvailability.pm

Package DE_EPAGES::USPS::API::WebServices::PackagePickupAvailability

It collects (XML) information required to generate USPS Package Pickup Availability requests and processed correct responses

Functions

callWebService
feedRequest
getAddress2OrError
getCarrierRouteOrEmpty
getCityOrError
getDateOrEmpty
getDayOfWeekOrEmpty
getFirmNameOrEmpty
getStateOrError
getSuiteOrAptOrEmpty
getUrbanizationOrEmpty
getZipcode4OrEmpty
getZipcode5OrError
isValidResponseOrError
new
setAddress
setCredentials
setPickUpDateOrError

callWebService

It arranges the log filter and calls the web service through the common interface.

Syntax
$self->callWebService();

feedRequest

It feeds USPS PickupAvailabilityObject object, ready to use the web service call.

Syntax
$self->feedRequest($ShippingLabel);
Input
$ShippingLabel (object)
Shipping label object

getAddress2OrError

It checks that the label node exists for the response and returns the content. It throws an error if no label can be found.

Syntax
getAddress2OrError(  );
Return
$Address2 (String)
Street atribute string

getCarrierRouteOrEmpty

It checks that the response is of APItag type, that the node name exists for the response and returns the content. It returns an empty string if no node can be found.

Syntax
getCarrierRouteOrEmpty(  );
Return
$CarrierRoute (String)
Carrier Route (can be C for City, H for Highway, R for Rural)

getCityOrError

It checks that the label node exists for the response and returns the content. It throws an error if no label can be found.

Syntax
getCityOrError(  );
Return
$City (String)
City atribute string

getDateOrEmpty

It checks that the response is of APItag type, that the node name exists for the response and returns the content. It returns an empty string if no node can be found.

Syntax
getDateOrEmpty(  );
Return
$Date (String)
First day available for pickup

getDayOfWeekOrEmpty

It checks that the response is of APItag type, that the node name exists for the response and returns the content. It returns an empty string if no node can be found.

Syntax
getDayOfWeekOrEmpty(  );
Return
$DayOfWeek (String)
First day of the week available for pickup

getFirmNameOrEmpty

It checks that the response is of APItag type, that the node name exists for the response and returns the content. It returns an empty string if no node can be found.

Syntax
getFirmNameOrEmpty(  );
Return
$FirmName (String)
Company atribute string

getStateOrError

It checks that the label node exists for the response and returns the content. It throws an error if no label can be found.

Syntax
getStateOrError(  );
Return
$State (String)
State atribute string

getSuiteOrAptOrEmpty

It checks that the response is of APItag type, that the node name exists for the response and returns the content. It returns an empty string if no node can be found.

Syntax
getSuiteOrAptOrEmpty(  );
Return
$SuiteOrApt (String)
Suite or Apartment address atribute string

getUrbanizationOrEmpty

It checks that the response is of APItag type, that the node name exists for the response and returns the content. It returns an empty string if no node can be found.

Syntax
getUrbanizationOrEmpty(  );
Return
$Urbanization (String)
Urbanization atribute string

getZipcode4OrEmpty

It checks that the response is of APItag type, that the node name exists for the response and returns the content. It returns an empty string if no node can be found.

Syntax
getZipcode4OrEmpty(  );
Return
$Zipcode4 (String)
Zipcode4 atribute string

getZipcode5OrError

It checks that the label node exists for the response and returns the content. It throws an error if no label can be found.

Syntax
getZipcode5OrError(  );
Return
$Zipcode (String)
Zipcode5 atribute string

isValidResponseOrError

It checks that the response is of Address Informattion API web service type. If it's not, it throws an error.

Syntax
$isValid = $self->isValidResponseOrError();
Return
(boolean)
$isValid

new

Creates a new Package Pickup Availability object .

Syntax
$PackagePickupAvailability = DE_EPAGES::USPS::API::WebServices::PackagePickupAvailability->new();
Input
$ShippingFulfillmentMethod (object)
ShippingFulfillmentMethod object
$Client (object)
Remote Client object -only used for mocking-
Return
$PackagePickupAvailability (object)
PackagePickupAvailability object

setAddress

It sets origin address into the request XML structure inside the PackagePickupAvailability object.

Syntax
$self->setAddress($OriginAddress);
Input
$OriginAddress (object)
Address object

setCredentials

It sets USPS access credentials for Package Pickup Availability web services into XML root node as required by USPS.

Syntax
$self->setCredentials($Username, $Password);
Input
$Username (object)
User credential for the Package Pickup Availability WS
$Password (object)
Password credential for the Package Pickup Availability WS

setPickUpDateOrError

It sets the PickUp Date into the request XML structure inside the PackagePickupAvailability object.

Syntax
$self->setPickUpDateOrError($PickUpDate);
Input
$PickUpDate (String)
Pick Up Date