Lue dans les fichiers PHP du paquet au commit 4505998105f5 : 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é.
ApiclassPurolator's E-Ship web services (SOAP 1.2, basic auth with the development or production key as username): Estimating, Shipping, Tracking and Locator, each its own endpoint and version.
3 methods · 2 properties · 7 constants
MappingclassPurolator's XML for ours.
4 methods · 1 constant
PurolatorGatewayFactoryclassoptions: key: '%env(PUROLATOR_KEY)%' # the development or production key (eship.purolator.com) password: '%env(PUROLATOR_PASSWORD)%' # its password account_number: '%env(PUROLATOR_ACCOUNT)%' sandbox: true rates: [...] # optional: configured prices instead of Estimating
10 options
CancelActionclassShipping's VoidShipment: a shipment not yet picked up, cancelled.
3 methods
PickupActionclassLocator's GetLocationsByPostalCode: shipping centres and drop boxes near a postal code.
3 methods
RatingActionclassEstimating's GetFullEstimate: every service for the shipment, its total and transit days.
3 methods
ShippingActionclassShipping's CreateShipment, then ShippingDocuments' GetDocuments for the label's link (a thermal label with option label_format ZPL).
3 methods
TrackingActionclassTracking's TrackPackagesByPin: the scans, oldest first.
3 methods
Omnibus\Purolator
Api class
final class Api Api.php:15
Purolator's E-Ship web services (SOAP 1.2, basic auth with the development or production key as username): Estimating, Shipping, Tracking and Locator, each its own endpoint and version.
const LIVE = 'https://webservices.purolator.com/EWS/V2'const TEST = 'https://devwebservices.purolator.com/EWS/V2'const ESTIMATING = ['Estimating/EstimatingService.asmx', '2.2']const SHIPPING = ['Shipping/ShippingService.asmx', '2.2']const SHIPPING_DOCUMENTS = ['ShippingDocuments/ShippingDocumentsService.asmx', '1.3']const TRACKING = ['Tracking/TrackingService.asmx', '1.2']const LOCATOR = ['Locator/LocatorService.asmx', '1.0']public readonly string $accountNumberpublic readonly bool $sandbox
Api::__construct()
public function __construct(readonly HttpClientInterface $http, readonly string $key, readonly string $password, public readonly string $accountNumber, public readonly bool $sandbox = false, readonly int $timeout = 20)Api::call()
public function call(array $service, string $request, string $body, string $language = 'en'): \SimpleXMLElementOne SOAP call: the request element's name and inner XML, back as the response element without namespaces.
Api::e()
public static function e(string $s): stringMapping class
final class Mapping Mapping.php:11
Purolator's XML for ours.
const SERVICES = ['PurolatorExpress' => 'Purolator Express', 'PurolatorExpress9AM' => 'Purolator Express 9AM', 'PurolatorExpress10:30AM' => 'Purolator Express 10:30AM', 'Puro…
Mapping::address()
public static function address(Address $a, ?string $province): stringMapping::piece()
public static function piece(Parcel $p): stringMapping::shipment()
public static function shipment(Shipment $s, string $account): stringThe <Shipment> both Estimating and Shipping take.
Mapping::status()
public static function status(?string $scanType, ?string $description = null): TrackingStatusPurolatorGatewayFactory class
final class PurolatorGatewayFactory extends GatewayFactory PurolatorGatewayFactory.php:22
options: key: '%env(PUROLATOR_KEY)%' # the development or production key (eship.purolator.com) password: '%env(PUROLATOR_PASSWORD)%' # its password account_number: '%env(PUROLATOR_ACCOUNT)%' sandbox: true rates: [...] # optional: configured prices instead of Estimating
Options
| Option | Default | |
|---|---|---|
sandbox | false | |
omnibus.api | function (Config $c) {
$http = $this->http ?? HttpClient::create();
return new Api($http, (string) $c['key'], (string) $c['password'], (string) $c['a… | |
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() | |
omnibus.action.cancel | new CancelAction() | |
key | required | |
password | required | |
account_number | required |
Omnibus\Purolator\Action
CancelAction class
final class CancelAction implements ActionInterface, ApiAwareInterface CancelAction.php:13
Shipping's VoidShipment: a shipment not yet picked up, cancelled.
CancelAction::__construct()
public function __construct()CancelAction::supports()
public function supports(Request $request): boolCancelAction::execute()
public function execute(Request $request): voidPickupAction class
final class PickupAction implements ActionInterface, ApiAwareInterface PickupAction.php:15
Locator's GetLocationsByPostalCode: shipping centres and drop boxes near a postal code.
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
Estimating's GetFullEstimate: every service for the shipment, its total and transit days.
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 CreateShipment, then ShippingDocuments' GetDocuments for the label's link (a thermal label with option label_format ZPL).
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 TrackPackagesByPin: the scans, oldest first.
TrackingAction::__construct()
public function __construct()TrackingAction::supports()
public function supports(Request $request): boolTrackingAction::execute()
public function execute(Request $request): void