Read from the package's own PHP files at the commit 340746f7ec76: its namespaces, classes, interfaces and enums, their public constants, properties and methods with their PHPDoc, and the options its factories take. Nothing of it is run.
ApiclassAramex's web services as JSON (ws.aramex.net/.../json): every request carries the ClientInfo.
3 methods · 1 property · 2 constants
AramexGatewayFactoryclassoptions: username: '%env(ARAMEX_USERNAME)%' # the web services account (an email) password: '%env(ARAMEX_PASSWORD)%' account_number: '%env(ARAMEX_ACCOUNT)%' account_pin: '%env(ARAMEX_PIN)%' account_entity: '%env(ARAMEX_ENTITY)%' # e.g. AMM, DXB, BAH: the account's station account_country: '%env(ARAMEX_COUNTRY)%' # e.g. JO, AE, BH sandbox: true rates: [...] # optional: configured prices instead of CalculateRate
12 options
MappingclassAramex's shapes for ours. Products: PDX Priority Document Express, PPX Priority Parcel Express, EPX Economy Parcel Express, OND domestic, CDS domestic.
3 methods · 1 constant
PickupActionclassLocation's FetchOffices: Aramex offices in the country, nearest city first.
3 methods
RatingActionclassRateCalculator's CalculateRate, once per product (option products: the codes to price; by default PPX and EPX across borders, OND and CDS at home).
3 methods
ShippingActionclassShipping's CreateShipments with a label (report 9729 PDF, or ZPL with option label_format).
3 methods
TrackingActionclassTracking's TrackShipments: the updates, oldest first.
3 methods
Omnibus\Aramex
Api class
final class Api Api.php:11
Aramex's web services as JSON (ws.aramex.net/.../json): every request carries the ClientInfo.
const LIVE = 'https://ws.aramex.net/ShippingAPI.V2'const TEST = 'https://ws.sbx.aramex.net/ShippingAPI.V2'public readonly bool $sandbox
Api::__construct()
public function __construct(readonly HttpClientInterface $http, readonly string $username, readonly string $password, readonly string $accountNumber, readonly string $accountPin, readonly string $accountEntity, readonly string $accountCountry, public readonly bool $sandbox = false, readonly int $timeout = 20)Api::clientInfo()
public function clientInfo(): arrayApi::call()
public function call(string $service, string $operation, array $body): arrayAramexGatewayFactory class
final class AramexGatewayFactory extends GatewayFactory AramexGatewayFactory.php:24
options: username: '%env(ARAMEX_USERNAME)%' # the web services account (an email) password: '%env(ARAMEX_PASSWORD)%' account_number: '%env(ARAMEX_ACCOUNT)%' account_pin: '%env(ARAMEX_PIN)%' account_entity: '%env(ARAMEX_ENTITY)%' # e.g. AMM, DXB, BAH: the account's station account_country: '%env(ARAMEX_COUNTRY)%' # e.g. JO, AE, BH sandbox: true rates: [...] # optional: configured prices instead of CalculateRate
Options
| Option | Default | |
|---|---|---|
sandbox | false | |
omnibus.api | function (Config $c) {
$http = $this->http ?? HttpClient::create();
return new Api($http, (string) $c['username'], (string) $c['password'], (string) … | |
omnibus.action.rating | static fn(Config $c) => $c->get('rates') ? null : new RatingAction() | |
omnibus.action.shipping | new ShippingAction() | |
omnibus.action.tracking | new TrackingAction() | |
omnibus.action.pickup | new PickupAction() | |
username | required | |
password | required | |
account_number | required | |
account_pin | required | |
account_entity | required | |
account_country | required |
Mapping class
final class Mapping Mapping.php:10
Aramex's shapes for ours. Products: PDX Priority Document Express, PPX Priority Parcel Express, EPX Economy Parcel Express, OND domestic, CDS domestic.
const PRODUCTS = ['PPX' => 'Priority Parcel Express', 'PDX' => 'Priority Document Express', 'EPX' => 'Economy Parcel Express', 'GPX' => 'Ground Parcel Express', 'OND' => 'Ove…
Mapping::party()
public static function party(Address $a, ?string $reference = null): arrayMapping::details()
public static function details(Shipment $s, string $product): arrayMapping::status()
public static function status(?string $code, ?string $description = null): TrackingStatusOmnibus\Aramex\Action
PickupAction class
final class PickupAction implements ActionInterface, ApiAwareInterface PickupAction.php:15
Location's FetchOffices: Aramex offices in the country, nearest city first.
PickupAction::__construct()
public function __construct()PickupAction::supports()
public function supports(Request $request): boolPickupAction::execute()
public function execute(Request $request): voidRatingAction class
final class RatingAction implements ActionInterface, ApiAwareInterface RatingAction.php:15
RateCalculator's CalculateRate, once per product (option products: the codes to price; by default PPX and EPX across borders, OND and CDS at home).
RatingAction::__construct()
public function __construct()RatingAction::supports()
public function supports(Request $request): boolRatingAction::execute()
public function execute(Request $request): voidShippingAction class
final class ShippingAction implements ActionInterface, ApiAwareInterface ShippingAction.php:16
Shipping's CreateShipments with a label (report 9729 PDF, or ZPL with option label_format).
ShippingAction::__construct()
public function __construct()ShippingAction::supports()
public function supports(Request $request): boolShippingAction::execute()
public function execute(Request $request): voidTrackingAction class
final class TrackingAction implements ActionInterface, ApiAwareInterface TrackingAction.php:17
Tracking's TrackShipments: the updates, oldest first.
TrackingAction::__construct()
public function __construct()TrackingAction::supports()
public function supports(Request $request): boolTrackingAction::execute()
public function execute(Request $request): void