Lue dans les fichiers PHP du paquet au commit 139d00dc1ce8 : 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é.
ApiclassDTDC's customer integration APIs (an api-key per customer for consignments and cancellation; a separate access token for tracking, fetched with the tracking username and password).
3 methods · 4 properties · 4 constants
DtdcGatewayFactoryclassoptions: api_key: '%env(DTDC_API_KEY)%' # the customer integration key customer_code: '%env(DTDC_CUSTOMER)%' tracking_username: null # the tracking API's login tracking_password: null sandbox: true rates: [...] # prices from configuration: DTDC quotes by contract
10 options
CancelActionclassPOST /consignment/cancel.
3 methods
GetSlipActionclassGET /consignment/label by reference number: the label of a consignment booked earlier, as ship() fetches it (label code SHIP_LABEL_4X6, PDF: DTDC prints no other format).
4 methods
ShippingActionclassPOST /consignment/softdata: the consignment (service: B2C Priority by default, PTP for Priority, GROUND...), then its label from /consignment/label.
4 methods
TrackingActionclassThe tracking API's getTrackDetails: the consignment's actions, oldest first.
3 methods
Omnibus\Dtdc
Api class
final class Api Api.php:15
DTDC's customer integration APIs (an api-key per customer for consignments and cancellation; a separate access token for tracking, fetched with the tracking username and password).
const LIVE = 'https://dtdcapi.shipsy.io/api/customer/integration'const TEST = 'https://demodashboardapi.shipsy.in/api/customer/integration'const TRACKING = 'https://blktracksvc.dtdc.com/dtdc-api/rest/JSONCnTrk/getTrackDetails'const TRACKING_TOKEN = 'https://blktracksvc.dtdc.com/dtdc-api/api/dtdc/authenticate'public readonly string $customerCodepublic readonly ?string $trackingUsernamepublic readonly ?string $trackingPasswordpublic readonly bool $sandbox
Api::__construct()
public function __construct(readonly HttpClientInterface $http, readonly string $apiKey, public readonly string $customerCode, public readonly ?string $trackingUsername = null, public readonly ?string $trackingPassword = null, public readonly bool $sandbox = false, readonly int $timeout = 20)Api::call()
public function call(string $method, string $path, ?array $body = null, array $query = []): arrayApi::track()
public function track(string $number): arrayDtdcGatewayFactory class
final class DtdcGatewayFactory extends GatewayFactory DtdcGatewayFactory.php:24
options: api_key: '%env(DTDC_API_KEY)%' # the customer integration key customer_code: '%env(DTDC_CUSTOMER)%' tracking_username: null # the tracking API's login tracking_password: null sandbox: true rates: [...] # prices from configuration: DTDC quotes by contract
No pickup points: DTDC delivers to the door. Unverified until an account's keys are at hand.
Options
| Option | Default | |
|---|---|---|
tracking_username | null | |
tracking_password | null | |
sandbox | false | |
omnibus.api | function (Config $c) {
$http = $this->http ?? HttpClient::create();
return new Api($http, (string) $c['api_key'], (string) $c['customer_code'], $c['t… | |
omnibus.action.shipping | new ShippingAction() | |
omnibus.action.tracking | static fn(Config $c) => $c['tracking_username'] && $c['tracking_password'] ? new TrackingAction() : null | |
omnibus.action.cancel | new CancelAction() | the tracking API has a login of its own |
omnibus.action.get_slip | new GetSlipAction() | |
api_key | required | |
customer_code | required |
Omnibus\Dtdc\Action
CancelAction class
final class CancelAction implements ActionInterface, ApiAwareInterface CancelAction.php:13
POST /consignment/cancel.
CancelAction::__construct()
public function __construct()CancelAction::supports()
public function supports(Request $request): boolCancelAction::execute()
public function execute(Request $request): voidGetSlipAction class
final class GetSlipAction implements ActionInterface, ApiAwareInterface GetSlipAction.php:18
GET /consignment/label by reference number: the label of a consignment booked earlier, as ship() fetches it (label code SHIP_LABEL_4X6, PDF: DTDC prints no other format).
GetSlipAction::__construct()
public function __construct()GetSlipAction::supports()
public function supports(Request $request): boolGetSlipAction::execute()
public function execute(Request $request): voidGetSlipAction::fetch()
public static function fetch(Api $api, string $number, string $labelCode): ?stringThe consignment's label, base64-decoded, or null when DTDC sends none.
ShippingAction class
final class ShippingAction implements ActionInterface, ApiAwareInterface ShippingAction.php:16
POST /consignment/softdata: the consignment (service: B2C Priority by default, PTP for Priority, GROUND...), then its label from /consignment/label.
ShippingAction::__construct()
public function __construct()ShippingAction::supports()
public function supports(Request $request): boolShippingAction::execute()
public function execute(Request $request): voidShippingAction::trackingUrl()
public static function trackingUrl(string $number): stringTrackingAction class
final class TrackingAction implements ActionInterface, ApiAwareInterface TrackingAction.php:16
The tracking API's getTrackDetails: the consignment's actions, oldest first.
TrackingAction::__construct()
public function __construct()TrackingAction::supports()
public function supports(Request $request): boolTrackingAction::execute()
public function execute(Request $request): void