Documentation

AddressValidateResult
in package
implements JsonSerializable

`AddressValidateResult` Type to be returned by *AddressService*. This is the result of validating a given address, whether it's valid or not.

Interfaces, Classes and Traits

JsonSerializable

Table of Contents

$errors  : array<string|int, mixed>
Error messages about the address validation, such as invalid fields that prevent the address from being fully validated.
$errors  : array<string|int, mixed>
$info  : array<string|int, mixed>
$info  : array<string|int, mixed>
An array of informational messages about the address validation, such as minor corrections.
$isValid  : bool|null
Indicates whether the address is valid
$normalizedAddress  : Address|null
$normalizedAddress  : Address|null
The normalized form of the address. This will only be populated if the address was valid (i.e. `$valid` is `true`).
$requestId  : string|null
$requestId  : string|null
The unique ID that is associated with the current request to ShipEngine API for address validation.
$valid  : bool
$warnings  : array<string|int, mixed>
$warnings  : array<string|int, mixed>
Warning messages about the address validation, such as major changes that were made to the normalized address.
__construct()  : mixed
AddressValidateResult Type constructor. Takes in a `POPO` (Plain Old PHP Object) that is the response object from the `JSON-RPC` response we get back.
jsonSerialize()  : mixed
Return a JsonSerialized string representation of the `AddressValidateResult` Type.

Properties

$errors

Error messages about the address validation, such as invalid fields that prevent the address from being fully validated.

public array<string|int, mixed> $errors = array()

$info

An array of informational messages about the address validation, such as minor corrections.

public array<string|int, mixed> $info = array()

$normalizedAddress

The normalized form of the address. This will only be populated if the address was valid (i.e. `$valid` is `true`).

public Address|null $normalizedAddress

Addresses are normalized according to the normalization rules of the countryCode they're in.

$requestId

The unique ID that is associated with the current request to ShipEngine API for address validation.

public string|null $requestId

$warnings

Warning messages about the address validation, such as major changes that were made to the normalized address.

public array<string|int, mixed> $warnings = array()

Methods

__construct()

AddressValidateResult Type constructor. Takes in a `POPO` (Plain Old PHP Object) that is the response object from the `JSON-RPC` response we get back.

public __construct(array<string|int, mixed> $apiResponse) : mixed
Parameters
$apiResponse : array<string|int, mixed>
Return values
mixed

jsonSerialize()

Return a JsonSerialized string representation of the `AddressValidateResult` Type.

public jsonSerialize() : mixed
{ "valid": true, "normalizedAddress": { "address": { "name": "BRUCE WAYNE", "phone": "1234567891", "company": "SHIPENGINE", "street": [ "4 JERSEY ST" ], "cityLocality": "BOSTON", "stateProvince": "MA", "postalCode": "02215", "countryCode": "US", "isResidential": false } }, "info": [], "warnings": [], "errors": [], "requestId": "req_9yvuxhYGymTzNorcM16gwT" }

Specify data which should be serialized to JSON

Tags
link
https://php.net/manual/en/jsonserializable.jsonserialize.php
Return values
mixed

data which can be serialized by json_encode

Search results