Documentation

Referral extends EasypostResource
in package

Table of Contents

$balance  : string
$cc_fee_rate  : string
$children  : array<string|int, User>
$email  : string
$id  : string
$insurance_fee_minimum  : string
$insurance_fee_rate  : string
$name  : string
$object  : string
$parent_id  : string
$phone_number  : string
$price_per_shipment  : string
$recharge_amount  : string
$recharge_threshold  : string
$secondary_recharge_amount  : string
$_apiKey  : string
$_immutableValues  : array<string|int, mixed>
$_retrieveOptions  : array<string|int, mixed>
$_unsavedValues  : array<string|int, mixed>
$_values  : array<string|int, mixed>
$_name  : string
$_parent  : string
__construct()  : mixed
Constructor for EasyPost objects.
__get()  : mixed
Getter.
__isset()  : bool
`isset` magic method.
__set()  : mixed
Standard accessor magic methods.
__toArray()  : array<string|int, mixed>
Convert object to an array.
__toJSON()  : string
Convert object to JSON.
__toString()  : string
Convert object to a string.
__unset()  : mixed
`unset` magic method.
add_credit_card()  : mixed
Add a credit card to a referral user.
all()  : mixed
Retrieve all referrals.
className()  : string
The class name of an object.
classUrl()  : string
The class URL of an object.
constructFrom()  : mixed
Construct from.
create()  : mixed
Create an referral.
current()  : mixed
Iterator methods.
instanceUrl()  : string
The instance URL of an object.
key()  : mixed
Iterator methods.
next()  : mixed
Iterator methods.
offsetExists()  : bool
ArrayAccess methods.
offsetGet()  : mixed
ArrayAccess methods.
offsetSet()  : mixed
ArrayAccess methods.
offsetUnset()  : mixed
ArrayAccess methods.
refresh()  : $this
Refresh the object from the API.
refreshFrom()  : mixed
Refresh from.
rewind()  : void
Iterator methods.
update_email()  : bool
Update an referral email.
valid()  : bool
Iterator methods.
allResources()  : mixed
Internal retrieve all method.
createResource()  : mixed
Internal create method.
deleteResource()  : $this
Internal delete method.
retrieveResource()  : mixed
Internal retrieve method.
saveResource()  : $this
Internal update (save) method.
updateResource()  : $this
Internal update method.
validate()  : mixed
Validate library usage.
create_easypost_credit_card()  : mixed
Submit the Stripe credit card token to EasyPost.
create_stripe_token()  : mixed
Retrieves the public EasyPost Stripe API key.
retrieve_easypost_stripe_api_key()  : string
Retrieves the public EasyPost Stripe API key.

Properties

$insurance_fee_minimum

public string $insurance_fee_minimum

$insurance_fee_rate

public string $insurance_fee_rate

$phone_number

public string $phone_number

$price_per_shipment

public string $price_per_shipment

$recharge_amount

public string $recharge_amount

$recharge_threshold

public string $recharge_threshold

$secondary_recharge_amount

public string $secondary_recharge_amount

$_immutableValues

protected array<string|int, mixed> $_immutableValues

$_retrieveOptions

protected array<string|int, mixed> $_retrieveOptions

$_unsavedValues

protected array<string|int, mixed> $_unsavedValues

Methods

__construct()

Constructor for EasyPost objects.

public __construct([string $id = null ][, string $apiKey = null ][, string $parent = null ][, string $name = null ]) : mixed
Parameters
$id : string = null
$apiKey : string = null
$parent : string = null
$name : string = null
Return values
mixed

__get()

Getter.

public __get(string $k) : mixed
Parameters
$k : string
Return values
mixed

__isset()

`isset` magic method.

public __isset(string $k) : bool
Parameters
$k : string
Return values
bool

__set()

Standard accessor magic methods.

public __set(string $k, mixed $v) : mixed
Parameters
$k : string
$v : mixed
Return values
mixed

__toArray()

Convert object to an array.

public __toArray([bool $recursive = false ]) : array<string|int, mixed>
Parameters
$recursive : bool = false
Return values
array<string|int, mixed>

__toJSON()

Convert object to JSON.

public __toJSON() : string
Return values
string

__toString()

Convert object to a string.

public __toString() : string
Return values
string

__unset()

`unset` magic method.

public __unset(string $k) : mixed
Parameters
$k : string
Return values
mixed

add_credit_card()

Add a credit card to a referral user.

public static add_credit_card(string $referralApiKey, string $number, int $expirationMonth, int $expirationYear, string $cvc[, string $primaryOrSecondary = 'primary' ]) : mixed

This function requires the Referral User's API key.

Parameters
$referralApiKey : string
$number : string
$expirationMonth : int
$expirationYear : int
$cvc : string
$primaryOrSecondary : string = 'primary'
Return values
mixed

all()

Retrieve all referrals.

public static all([mixed $params = null ][, string $apiKey = null ]) : mixed
Parameters
$params : mixed = null
$apiKey : string = null
Return values
mixed

className()

The class name of an object.

public static className(string $class) : string
Parameters
$class : string
Return values
string

classUrl()

The class URL of an object.

public static classUrl(string $class) : string
Parameters
$class : string
Return values
string

constructFrom()

Construct from.

public static constructFrom(array<string|int, mixed> $values[, string $class = null ][, string $apiKey = null ][, string $parent = null ][, string $name = null ]) : mixed
Parameters
$values : array<string|int, mixed>
$class : string = null
$apiKey : string = null
$parent : string = null
$name : string = null
Return values
mixed

create()

Create an referral.

public static create([mixed $params = null ][, string $apiKey = null ]) : mixed
Parameters
$params : mixed = null
$apiKey : string = null
Return values
mixed

current()

Iterator methods.

public current() : mixed
Return values
mixed

instanceUrl()

The instance URL of an object.

public instanceUrl() : string
Tags
throws
Error
Return values
string

key()

Iterator methods.

public key() : mixed
Return values
mixed

next()

Iterator methods.

public next() : mixed
Return values
mixed

offsetExists()

ArrayAccess methods.

public offsetExists(string $k) : bool
Parameters
$k : string
Return values
bool

offsetGet()

ArrayAccess methods.

public offsetGet(string $k) : mixed
Parameters
$k : string
Return values
mixed

offsetSet()

ArrayAccess methods.

public offsetSet(string $k, mixed $v) : mixed
Parameters
$k : string
$v : mixed
Return values
mixed

offsetUnset()

ArrayAccess methods.

public offsetUnset(string $k) : mixed
Parameters
$k : string
Return values
mixed

refresh()

Refresh the object from the API.

public refresh([bool $beta = false ]) : $this
Parameters
$beta : bool = false

Whether to use the beta endpoint (optional, default false)

Tags
throws
Error
Return values
$this

refreshFrom()

Refresh from.

public refreshFrom(array<string|int, mixed> $values, string $apiKey[, bool $partial = false ]) : mixed
Parameters
$values : array<string|int, mixed>
$apiKey : string
$partial : bool = false
Return values
mixed

rewind()

Iterator methods.

public rewind() : void
Return values
void

update_email()

Update an referral email.

public static update_email(string $email, string $userId[, string $apiKey = null ]) : bool
Parameters
$email : string
$userId : string
$apiKey : string = null
Return values
bool

valid()

Iterator methods.

public valid() : bool
Return values
bool

allResources()

Internal retrieve all method.

protected static allResources(string $class[, mixed $params = null ][, string $apiKey = null ][, mixed $beta = false ]) : mixed
Parameters
$class : string
$params : mixed = null
$apiKey : string = null
$beta : mixed = false
Tags
throws
Error
Return values
mixed

createResource()

Internal create method.

protected static createResource(string $class[, mixed $params = null ][, string $apiKey = null ][, string $urlModifier = null ][, mixed $beta = false ]) : mixed
Parameters
$class : string
$params : mixed = null
$apiKey : string = null
$urlModifier : string = null
$beta : mixed = false
Tags
throws
Error
Return values
mixed

deleteResource()

Internal delete method.

protected deleteResource([mixed $params = null ][, mixed $noRefresh = null ]) : $this
Parameters
$params : mixed = null
$noRefresh : mixed = null
Tags
throws
Error
Return values
$this

retrieveResource()

Internal retrieve method.

protected static retrieveResource(string $class, mixed $id[, string $apiKey = null ][, mixed $beta = false ]) : mixed
Parameters
$class : string
$id : mixed
$apiKey : string = null
$beta : mixed = false
Return values
mixed

saveResource()

Internal update (save) method.

protected saveResource(string $class[, mixed $beta = false ][, mixed $method = 'patch' ]) : $this
Parameters
$class : string
$beta : mixed = false
$method : mixed = 'patch'
Tags
throws
Error
Return values
$this

updateResource()

Internal update method.

protected updateResource([mixed $params = null ]) : $this
Parameters
$params : mixed = null
Tags
throws
Error
Return values
$this

validate()

Validate library usage.

protected static validate([array<string|int, mixed> $params = null ][, string $apiKey = null ]) : mixed
Parameters
$params : array<string|int, mixed> = null
$apiKey : string = null
Tags
throws
Error
Return values
mixed

create_easypost_credit_card()

Submit the Stripe credit card token to EasyPost.

private static create_easypost_credit_card(string $referralApiKey, string $stripeObjectId[, mixed $priority = 'primary' ]) : mixed
Parameters
$referralApiKey : string
$stripeObjectId : string
$priority : mixed = 'primary'
Return values
mixed

create_stripe_token()

Retrieves the public EasyPost Stripe API key.

private static create_stripe_token(string $number, int $expirationMonth, mixed $expirationYear, string $cvc, string $easypostStripeKey) : mixed
Parameters
$number : string
$expirationMonth : int
$expirationYear : mixed
$cvc : string
$easypostStripeKey : string
Return values
mixed

retrieve_easypost_stripe_api_key()

Retrieves the public EasyPost Stripe API key.

private static retrieve_easypost_stripe_api_key() : string
Return values
string

Search results