PHP Class Usps\InternationalLabel

Inheritance: extends USPSBase
Mostrar archivo Open project: vinceg/usps-php-api

Protected Properties

Property Type Description
$apiVersion - the api version used for this type of call
$contents
$fields - route added so far.

Public Methods

Method Description
addContent ( $description, $value, $pounds, $ounces, integer $quantity = 1, null $tarrifNumber = null, null $countryOfOrigin = null ) : object Add shipping contents.
createLabel ( ) : string Perform the API call.
getConfirmationNumber ( ) : string | boolean Return the USPS confirmation/tracking number if we have one.
getLabelContents ( ) : string | boolean Return the USPS label as a base64 encoded string.
getPostFields ( ) : array returns array of all fields added.
setField ( integer $position, string $key, string $value ) : object Set any other requried string make sure you set the correct position as well as the position of the items matters.
setFromAddress ( string $firstName, string $lastName, string $company, string $address, string $city, string $state, string $zip, string $address2 = null, string $zip4 = null, string $phone = null, string $middleName = null ) : object Set the from address.
setToAddress ( string $firstName, string $lastName, string $company, string $address, string $city, string $province, string $country, string $zip, string $address2 = null, string $poBoxFlag = 'N', string $phone = null, null $fax = null, null $email = null ) : object Set the to address.
setWeightOunces ( $weight ) Set package weight in ounces.
setWeightPounds ( $weight ) Set package weight in ounces.

Protected Methods

Method Description
addMissingRequired ( ) : void Add missing required elements.

Method Details

addContent() public method

Add shipping contents.
public addContent ( $description, $value, $pounds, $ounces, integer $quantity = 1, null $tarrifNumber = null, null $countryOfOrigin = null ) : object
$description
$value
$pounds
$ounces
$quantity integer
$tarrifNumber null
$countryOfOrigin null
return object

addMissingRequired() protected method

Add missing required elements.
protected addMissingRequired ( ) : void
return void

createLabel() public method

Perform the API call.
public createLabel ( ) : string
return string

getConfirmationNumber() public method

Return the USPS confirmation/tracking number if we have one.

getLabelContents() public method

Return the USPS label as a base64 encoded string.
public getLabelContents ( ) : string | boolean
return string | boolean

getPostFields() public method

returns array of all fields added.
public getPostFields ( ) : array
return array

setField() public method

Set any other requried string make sure you set the correct position as well as the position of the items matters.
public setField ( integer $position, string $key, string $value ) : object
$position integer
$key string
$value string
return object

setFromAddress() public method

Set the from address.
public setFromAddress ( string $firstName, string $lastName, string $company, string $address, string $city, string $state, string $zip, string $address2 = null, string $zip4 = null, string $phone = null, string $middleName = null ) : object
$firstName string
$lastName string
$company string
$address string
$city string
$state string
$zip string
$address2 string
$zip4 string
$phone string
$middleName string
return object

setToAddress() public method

Set the to address.
public setToAddress ( string $firstName, string $lastName, string $company, string $address, string $city, string $province, string $country, string $zip, string $address2 = null, string $poBoxFlag = 'N', string $phone = null, null $fax = null, null $email = null ) : object
$firstName string
$lastName string
$company string
$address string
$city string
$province string
$country string
$zip string
$address2 string
$poBoxFlag string
$phone string
$fax null
$email null
return object

setWeightOunces() public method

Set package weight in ounces.
public setWeightOunces ( $weight )
$weight

setWeightPounds() public method

Set package weight in ounces.
public setWeightPounds ( $weight )
$weight

Property Details

$apiVersion protected_oe property

- the api version used for this type of call
protected $apiVersion

$contents protected_oe property

protected $contents

$fields protected_oe property

- route added so far.
protected $fields