Documentation

Webhook extends EasypostResource
in package

Table of Contents

$disabled_at  : string
$id  : string
$modoe  : string
$object  : string
$url  : 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.
all()  : mixed
Retrieve all webhooks.
className()  : string
The class name of an object.
classUrl()  : string
The class URL of an object.
constructFrom()  : mixed
Construct from.
create()  : mixed
Create a webhook.
current()  : mixed
Iterator methods.
delete()  : $this
Delete a webhook.
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.
retrieve()  : mixed
Retrieve a webhook.
rewind()  : void
Iterator methods.
update()  : $this
Update a webhook.
valid()  : bool
Iterator methods.
validateWebhook()  : mixed
Validate a webhook originated from EasyPost by comparing the HMAC header to a shared secret.
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.

Properties

$disabled_at

public string $disabled_at

$_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

all()

Retrieve all webhooks.

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 a webhook.

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

delete()

Delete a webhook.

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

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

retrieve()

Retrieve a webhook.

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

rewind()

Iterator methods.

public rewind() : void
Return values
void

update()

Update a webhook.

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

valid()

Iterator methods.

public valid() : bool
Return values
bool

validateWebhook()

Validate a webhook originated from EasyPost by comparing the HMAC header to a shared secret.

public static validateWebhook(mixed $eventBody, mixed $headers, string $webhookSecret) : mixed

If the signatures do not match, an error will be raised signifying the webhook either did not originate from EasyPost or the secrets do not match. If the signatures do match, the event_body will be returned as JSON.

Parameters
$eventBody : mixed
$headers : mixed
$webhookSecret : string
Return values
mixed

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

Search results