Documentation

ReferralCustomerService extends BaseService
in package

ReferralCustomer service containing all the logic to make API calls.

Table of Contents

$client  : mixed
addCreditCard()  : mixed
Add a credit card to a referral user.
all()  : mixed
Retrieve all referrals.
create()  : mixed
Create an referral.
updateEmail()  : void
Update an referral email.
__construct()  : mixed
Service constructor shared by all child services.
allResources()  : mixed
Internal retrieve all method.
className()  : string
The class name of an object.
classUrl()  : string
The class URL of an object.
createResource()  : mixed
Internal create method.
deleteResource()  : void
Internal delete method.
instanceUrl()  : string
The instance URL of an object.
retrieveResource()  : mixed
Internal retrieve method.
serviceModelClassName()  : string
Gets the class name of a Service's model.
updateResource()  : mixed
Internal update method.
validate()  : mixed
Validate library usage.
createEasypostCreditCard()  : mixed
Submit the Stripe credit card token to EasyPost.
createStripeToken()  : mixed
Retrieves the public EasyPost Stripe API key.
retrieveEasypostStripeApiKey()  : string
Retrieves the public EasyPost Stripe API key.

Properties

Methods

addCreditCard()

Add a credit card to a referral user.

public addCreditCard(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'
Tags
throws
ExternalApiException
Return values
mixed

all()

Retrieve all referrals.

public all([mixed $params = null ]) : mixed
Parameters
$params : mixed = null
Return values
mixed

create()

Create an referral.

public create([mixed $params = null ]) : mixed
Parameters
$params : mixed = null
Return values
mixed

updateEmail()

Update an referral email.

public updateEmail(string $email, string $userId) : void
Parameters
$email : string
$userId : string
Return values
void

__construct()

Service constructor shared by all child services.

protected __construct(EasyPostClient $client) : mixed
Parameters
$client : EasyPostClient
Return values
mixed

allResources()

Internal retrieve all method.

protected allResources(string $class[, mixed $params = null ][, bool $beta = false ]) : mixed
Parameters
$class : string
$params : mixed = null
$beta : bool = false
Return values
mixed

className()

The class name of an object.

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

classUrl()

The class URL of an object.

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

createResource()

Internal create method.

protected createResource(string $class[, mixed $params = null ][, bool $beta = false ]) : mixed
Parameters
$class : string
$params : mixed = null
$beta : bool = false
Return values
mixed

deleteResource()

Internal delete method.

protected deleteResource(string $class, string $id[, mixed $params = null ][, bool $beta = false ]) : void
Parameters
$class : string
$id : string
$params : mixed = null
$beta : bool = false
Return values
void

instanceUrl()

The instance URL of an object.

protected instanceUrl(string $class, string $id) : string
Parameters
$class : string
$id : string
Tags
throws
InvalidObjectException
Return values
string

retrieveResource()

Internal retrieve method.

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

serviceModelClassName()

Gets the class name of a Service's model.

protected static serviceModelClassName(string $serviceClassName) : string
Parameters
$serviceClassName : string
Return values
string

updateResource()

Internal update method.

protected updateResource(string $class, string $id[, mixed $params = null ][, string $method = 'patch' ][, bool $beta = false ]) : mixed
Parameters
$class : string
$id : string
$params : mixed = null
$method : string = 'patch'
$beta : bool = false
Return values
mixed

validate()

Validate library usage.

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

createEasypostCreditCard()

Submit the Stripe credit card token to EasyPost.

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

createStripeToken()

Retrieves the public EasyPost Stripe API key.

private createStripeToken(string $number, int $expirationMonth, mixed $expirationYear, string $cvc, string $easypostStripeKey) : mixed
Parameters
$number : string
$expirationMonth : int
$expirationYear : mixed
$cvc : string
$easypostStripeKey : string
Tags
throws
HttpException
throws
TimeoutException
Return values
mixed

retrieveEasypostStripeApiKey()

Retrieves the public EasyPost Stripe API key.

private retrieveEasypostStripeApiKey() : string
Return values
string

Search results