Lue dans les fichiers PHP du paquet au commit ac579cd975f2 : ses espaces de noms, classes, interfaces et énumérations, leurs constantes, propriétés et méthodes publiques avec leur PHPDoc, et les options que prennent ses fabriques. Rien n’en est exécuté.
ApiclassFedEx's REST APIs on an OAuth2 client-credentials token, kept until it expires.
3 methods · 2 properties · 2 constants
FedexGatewayFactoryclassoptions: client_id: '%env(FEDEX_CLIENT_ID)%' # a project in the FedEx Developer Portal client_secret: '%env(FEDEX_CLIENT_SECRET)%' account_number: '%env(FEDEX_ACCOUNT)%' sandbox: true rates: [...] # optional: configured prices instead of the Rate API
9 options
MappingclassFedEx's shapes for ours.
4 methods
PickupActionclassThe Location API: FedEx locations that take parcels, nearest first.
3 methods
RatingActionclassThe Rate API's quotes: every service, with the account's rates.
3 methods
ShippingActionclassThe Ship API: the shipment booked, its label (PDF 4x6; option label_format: PDF, PNG or ZPLII).
3 methods
TrackingActionclassThe Track API: the parcel's scan events, oldest first.
3 methods
Omnibus\Fedex
Api class
final class Api Api.php:11
FedEx's REST APIs on an OAuth2 client-credentials token, kept until it expires.
const LIVE = 'https://apis.fedex.com'const TEST = 'https://apis-sandbox.fedex.com'public readonly string $accountNumberpublic readonly bool $sandbox
Api::__construct()
public function __construct(readonly HttpClientInterface $http, readonly string $clientId, readonly string $clientSecret, public readonly string $accountNumber, public readonly bool $sandbox = false, readonly int $timeout = 20)Api::base()
public function base(): stringApi::call()
public function call(string $method, string $path, ?array $body = null, string $locale = 'en_US'): arrayFedexGatewayFactory class
final class FedexGatewayFactory extends GatewayFactory FedexGatewayFactory.php:21
options: client_id: '%env(FEDEX_CLIENT_ID)%' # a project in the FedEx Developer Portal client_secret: '%env(FEDEX_CLIENT_SECRET)%' account_number: '%env(FEDEX_ACCOUNT)%' sandbox: true rates: [...] # optional: configured prices instead of the Rate API
Options
| Option | Default | |
|---|---|---|
sandbox | false | |
omnibus.api | function (Config $c) {
$http = $this->http ?? HttpClient::create();
return new Api($http, (string) $c['client_id'], (string) $c['client_secret'], (st… | |
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() | |
client_id | required | |
client_secret | required | |
account_number | required |
Mapping class
final class Mapping Mapping.php:10
FedEx's shapes for ours.
Mapping::party()
public static function party(Address $a): arrayMapping::address()
public static function address(Address $a): arrayMapping::package()
public static function package(Parcel $p): arrayMapping::status()
public static function status(?string $code): TrackingStatusOmnibus\Fedex\Action
PickupAction class
final class PickupAction implements ActionInterface, ApiAwareInterface PickupAction.php:16
The Location API: FedEx locations that take parcels, nearest 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
The Rate API's quotes: every service, with the account's rates.
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
The Ship API: the shipment booked, its label (PDF 4x6; option label_format: PDF, PNG or ZPLII).
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
The Track API: the parcel's scan events, oldest first.
TrackingAction::__construct()
public function __construct()TrackingAction::supports()
public function supports(Request $request): boolTrackingAction::execute()
public function execute(Request $request): void