PHP Class Pop\Shipping\Adapter\Usps

Author: Nick Sagona, III ([email protected])
Inheritance: extends AbstractAdapter
Mostrar archivo Open project: nicksagona/PopPHP

Protected Properties

Property Type Description
$container string Container type
$containerSize string Container size
$dimensions array Package dimensions
$liveUrl string Live API URL
$machinable string Machinable flag
$request Pop\Dom\Dom Request XML
$shipFrom string Ship from fields
$shipTo array Ship to fields
$testMode boolean Test mode flag
$testUrl string Test API URL
$weight array Package weight

Public Methods

Method Description
__construct ( string $username, string $password, boolean $test = false ) : Usps Constructor
isError ( ) : boolean Return whether the transaction is an error
isSuccess ( ) : boolean Return whether the transaction is a success
send ( boolean $verifyPeer = true ) : void Send transaction
setContainer ( string $container = 'RECTANGULAR' ) : void Set container
setDimensions ( array $dimensions, string $unit = null ) : void Set dimensions
setMachinable ( boolean $machinable = false ) : void Set machinable flag
setWeight ( string $weight, string $unit = null ) : void Set dimensions
shipFrom ( array $shipFrom ) : void Set ship from
shipTo ( array $shipTo ) : void Set ship to

Protected Methods

Method Description
buildRequest ( ) : void Build rate request

Method Details

__construct() public method

Method to instantiate an USPS shipping adapter object
public __construct ( string $username, string $password, boolean $test = false ) : Usps
$username string
$password string
$test boolean
return Usps

buildRequest() protected method

Build rate request
protected buildRequest ( ) : void
return void

isError() public method

Return whether the transaction is an error
public isError ( ) : boolean
return boolean

isSuccess() public method

Return whether the transaction is a success
public isSuccess ( ) : boolean
return boolean

send() public method

Send transaction
public send ( boolean $verifyPeer = true ) : void
$verifyPeer boolean
return void

setContainer() public method

Set container
public setContainer ( string $container = 'RECTANGULAR' ) : void
$container string
return void

setDimensions() public method

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

setMachinable() public method

Set machinable flag
public setMachinable ( boolean $machinable = false ) : void
$machinable boolean
return void

setWeight() public method

Set dimensions
public setWeight ( string $weight, string $unit = null ) : void
$weight string
$unit string
return void

shipFrom() public method

Set ship from
public shipFrom ( array $shipFrom ) : void
$shipFrom array
return void

shipTo() public method

Set ship to
public shipTo ( array $shipTo ) : void
$shipTo array
return void

Property Details

$container protected_oe property

Container type
protected string $container
return string

$containerSize protected_oe property

Container size
protected string $containerSize
return string

$dimensions protected_oe property

Package dimensions
protected array $dimensions
return array

$liveUrl protected_oe property

Live API URL
protected string $liveUrl
return string

$machinable protected_oe property

Machinable flag
protected string $machinable
return string

$request protected_oe property

Request XML
protected Dom,Pop\Dom $request
return Pop\Dom\Dom

$shipFrom protected_oe property

Ship from fields
protected string $shipFrom
return string

$shipTo protected_oe property

Ship to fields
protected array $shipTo
return array

$testMode protected_oe property

Test mode flag
protected bool $testMode
return boolean

$testUrl protected_oe property

Test API URL
protected string $testUrl
return string

$weight protected_oe property

Package weight
protected array $weight
return array