Properties

$response

$response : object

Response object

Type

object

$responseCode

$responseCode : integer

Response code

Type

integer

$responseMessage

$responseMessage : string

Response message

Type

string

$rates

$rates : array

Service rates

Type

array

$liveUrl

$liveUrl : string

Live API URL

Type

string

$testUrl

$testUrl : string

Test API URL

Type

string

$testMode

$testMode : boolean

Test mode flag

Type

boolean

$request

$request : string

Request XML

Type

string

$shipTo

$shipTo : array

Ship to fields

Type

array

$shipFrom

$shipFrom : string

Ship from fields

Type

string

$container

$container : string

Container type

Type

string

$containerSize

$containerSize : string

Container size

Type

string

$machinable

$machinable : string

Machinable flag

Type

string

$dimensions

$dimensions : array

Package dimensions

Type

array

$weight

$weight : array

Package weight

Type

array

Methods

send()

send(boolean  $verifyPeer = true) : void

Send transaction

Parameters

boolean $verifyPeer

isSuccess()

isSuccess() : boolean

Return whether the transaction is a success

Returns

boolean

isError()

isError() : boolean

Return whether the transaction is an error

Returns

boolean

getResponse()

getResponse() : object

Get response

Returns

object

getResponseCode()

getResponseCode() : integer

Get response code

Returns

integer

getResponseMessage()

getResponseMessage() : string

Get response message

Returns

string

getRates()

getRates() : array

Get service rates

Returns

array

__construct()

__construct(string  $username, string  $password, boolean  $test = false) : \Pop\Shipping\Adapter\Usps

Constructor

Method to instantiate an USPS shipping adapter object

Parameters

string $username
string $password
boolean $test

Returns

\Pop\Shipping\Adapter\Usps

shipTo()

shipTo(array  $shipTo) : void

Set ship to

Parameters

array $shipTo

shipFrom()

shipFrom(array  $shipFrom) : void

Set ship from

Parameters

array $shipFrom

setContainer()

setContainer(string  $container = 'RECTANGULAR') : void

Set container

Parameters

string $container

Throws

\Pop\Shipping\Adapter\Exception

setMachinable()

setMachinable(boolean  $machinable = false) : void

Set machinable flag

Parameters

boolean $machinable

setDimensions()

setDimensions(array  $dimensions, string  $unit = null) : void

Set dimensions

Parameters

array $dimensions
string $unit

setWeight()

setWeight(string  $weight, string  $unit = null) : void

Set dimensions

Parameters

string $weight
string $unit

parseResponse()

parseResponse(resource  $curl) : string

Parse the curl response

Parameters

resource $curl

Returns

string

buildRequest()

buildRequest() : void

Build rate request