CarrierAccount
in package
implements
JsonSerializable
Class CarrierAccount - This class represents a given Carrier Account e.g. FedEx, UPS, USPS.
Interfaces, Classes and Traits
- JsonSerializable
Table of Contents
- $accountId : string
- The unique ID that is associated with the current carrier account.
- $accountNumber : string
- The account number of the current carrier account.
- $carrier : Carrier
- An immutable object that will represent a carrier account.
- $name : string
- The account name of the current carrier account.
- __construct() : mixed
- CarrierAccount constructor. This class contains account information such as the carrier/provider, accountId, account number, and account name.
- jsonSerialize() : mixed
- { "carrier": { "carrier_name": "FedEx", "carrierCode": "fedex" }, "accountId": "car_a09a8jsfd09wjzxcs9dfyha", "accountNumber": "SDF987", "name": "ShipEngine FedEx Account" }
- setCarrierAccount() : mixed
- Instantiate an immutable carrier class based on the `carrier` key and sets `$this->carrier` based on it's value.
Properties
$accountId
The unique ID that is associated with the current carrier account.
public
string
$accountId
$accountNumber
The account number of the current carrier account.
public
string
$accountNumber
$carrier
An immutable object that will represent a carrier account.
public
Carrier
$carrier
$name
The account name of the current carrier account.
public
string
$name
Methods
__construct()
CarrierAccount constructor. This class contains account information such as the carrier/provider, accountId, account number, and account name.
public
__construct(array<string|int, mixed> $accountInformation) : mixed
Parameters
- $accountInformation : array<string|int, mixed>
Return values
mixed —jsonSerialize()
{ "carrier": { "carrier_name": "FedEx", "carrierCode": "fedex" }, "accountId": "car_a09a8jsfd09wjzxcs9dfyha", "accountNumber": "SDF987", "name": "ShipEngine FedEx Account" }
public
jsonSerialize() : mixed
Specify data which should be serialized to JSON
Tags
Return values
mixed —data which can be serialized by json_encode
setCarrierAccount()
Instantiate an immutable carrier class based on the `carrier` key and sets `$this->carrier` based on it's value.
private
setCarrierAccount(array<string|int, mixed> $accountInformation) : mixed
Parameters
- $accountInformation : array<string|int, mixed>