Lue dans les fichiers PHP du paquet au commit ec1db9bec868 : 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é.
ApiclassJD Logistics' open platform (api.jdl.com): each API is a path, the payload a JSON body, signed with the app key and secret (sign = md5(secret + "access_token" + token + "app_key" + key + "method" + path + "param_json" + body + "timestamp" + ts + "v" + v + secret), in capitals).
3 methods · 2 properties · 2 constants
JdlExpressGatewayFactoryclassoptions: app_key: '%env(JDL_APP_KEY)%' # the open platform app app_secret: '%env(JDL_APP_SECRET)%' access_token: '%env(JDL_ACCESS_TOKEN)%' # the merchant's authorisation token customer_code: '%env(JDL_CUSTOMER)%' # the 商家编码 sandbox: true rates: [...] # prices from configuration: JD quotes by contract
9 options
CancelActionclass/ecap/v1/orders/cancel.
3 methods
ShippingActionclass/ecap/v1/orders/create: the order (service: the product code, ed-m-0001 standard by default), its waybill number; the label from /ecap/v1/orders/print.
3 methods
TrackingActionclass/ecap/v1/orders/trace/query: the waybill's traces, oldest first.
3 methods
Omnibus\JdlExpress
Api class
final class Api Api.php:15
JD Logistics' open platform (api.jdl.com): each API is a path, the payload a JSON body, signed with the app key and secret (sign = md5(secret + "access_token" + token + "app_key" + key + "method" + path + "param_json" + body + "timestamp" + ts + "v" + v + secret), in capitals).
const LIVE = 'https://api.jdl.com'const TEST = 'https://uat-api.jdl.com'public readonly string $customerCodepublic readonly bool $sandbox
Api::__construct()
public function __construct(readonly HttpClientInterface $http, readonly string $appKey, readonly string $appSecret, readonly string $accessToken, public readonly string $customerCode, public readonly bool $sandbox = false, readonly int $timeout = 20)Api::call()
public function call(string $path, array $body): arrayApi::sign()
public static function sign(string $secret, string $token, string $key, string $method, string $json, string $timestamp, string $v): stringJdlExpressGatewayFactory class
final class JdlExpressGatewayFactory extends GatewayFactory JdlExpressGatewayFactory.php:23
options: app_key: '%env(JDL_APP_KEY)%' # the open platform app app_secret: '%env(JDL_APP_SECRET)%' access_token: '%env(JDL_ACCESS_TOKEN)%' # the merchant's authorisation token customer_code: '%env(JDL_CUSTOMER)%' # the 商家编码 sandbox: true rates: [...] # prices from configuration: JD quotes by contract
No pickup points. Unverified until an account's keys are at hand.
Options
| Option | Default | |
|---|---|---|
sandbox | false | |
omnibus.api | function (Config $c) {
$http = $this->http ?? HttpClient::create();
return new Api($http, (string) $c['app_key'], (string) $c['app_secret'], (string)… | |
omnibus.action.shipping | new ShippingAction() | |
omnibus.action.tracking | new TrackingAction() | |
omnibus.action.cancel | new CancelAction() | |
app_key | required | |
app_secret | required | |
access_token | required | |
customer_code | required |
Omnibus\JdlExpress\Action
CancelAction class
final class CancelAction implements ActionInterface, ApiAwareInterface CancelAction.php:13
/ecap/v1/orders/cancel.
CancelAction::__construct()
public function __construct()CancelAction::supports()
public function supports(Request $request): boolCancelAction::execute()
public function execute(Request $request): voidShippingAction class
final class ShippingAction implements ActionInterface, ApiAwareInterface ShippingAction.php:16
/ecap/v1/orders/create: the order (service: the product code, ed-m-0001 standard by default), its waybill number; the label from /ecap/v1/orders/print.
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:16
/ecap/v1/orders/trace/query: the waybill's traces, oldest first.
TrackingAction::__construct()
public function __construct()TrackingAction::supports()
public function supports(Request $request): boolTrackingAction::execute()
public function execute(Request $request): void