ernadoo/mondial-relay
Composer 安装命令:
composer require ernadoo/mondial-relay
包简介
Mondial Relay API client — V2 REST (label creation) + SOAP (relay point search)
README 文档
README
PHP client for the Mondial Relay shipping API. Framework-agnostic.
- Label creation — V2 REST API (production + sandbox)
- Relay point search — V1 SOAP API (MR has not yet published a V2 REST endpoint for this)
Requirements
- PHP 8.2+
ext-curl,ext-soap,ext-simplexml
Installation
composer require ernadoo/mondial-relay
Quick start
use Ernadoo\MondialRelay\MondialRelayClient; use Ernadoo\MondialRelay\Shipment\Address; use Ernadoo\MondialRelay\Shipment\DeliveryMode; use Ernadoo\MondialRelay\Shipment\Parcel; use Ernadoo\MondialRelay\Shipment\ShipmentRequest; $client = MondialRelayClient::create( login: 'YOUR_LOGIN', password: 'YOUR_PASSWORD', customerId: 'YOUR_CUSTOMER_ID', secretKey: 'YOUR_SECRET_KEY', sandbox: true, // false in production ); $request = new ShipmentRequest( sender: new Address('FR', '59510', 'Hem', '4 Av. Antoine Pinay', 'Erwan', 'Nader', mobileNo: '+33600000000'), recipient: new Address('FR', '75001', 'Paris', '1 Rue de la Paix', 'Jane', 'Doe', mobileNo: '+33600000001'), parcels: [new Parcel(weightGrams: 500, content: 'Vêtements')], // deliveryLocation left empty = "Notif Destinataire": // Mondial Relay notifies the recipient by SMS so they choose their relay point. ); $response = $client->createShipment($request); echo $response->shipmentNumber; // e.g. "12345678" echo $response->labelOutput; // PDF URL to download the label echo $response->trackingUrl; // Public tracking link
Documentation
Tests
composer install vendor/bin/phpunit
统计信息
- 总下载量: 14
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-08-29