ernadoo/mondial-relay
Framework-agnostic PHP client for Mondial Relay: create shipment labels via the V2 REST API and search relay points via the V1 SOAP API. Supports sandbox testing, tracking URLs, and label PDFs.
ParcelShopSearchRequest::around($countryCode, $latitude, $longitude),
or the new latitude and longitude arguments; the post code may then be empty. A request without a
post code nor coordinates, with a single coordinate or with out-of-range coordinates now fails with
\InvalidArgumentException before calling Mondial Relay (it was rejected by the API anyway).ParcelShop::schedule(): opening hours day by day (OpeningHours: on($isoDay), isOpenOn(),
isAlwaysOpen(), isEmpty()), instead of parsing "0930-1300 1400-1900". openingHours keeps the
raw values.ParcelShop::$locker (Mondial Relay flags lockers in its Information field) and
ParcelShop::$directions (Localisation1 and Localisation2, when given).login → apiLogin, password → apiPassword,
customerId → brandCode, secretKey → privateKey (MondialRelayClient::create(),
RestShipmentClient, SoapParcelShopClient). Positional calls are not affected.setLogger() on MondialRelayClient and both clients): created shipments and
relay point searches at info level, API rejections at error level with their codes, non-blocking
API warnings (previously ignored silently) at warning level. Credentials, request and response
bodies are never logged.ConfigurationException (a credential needed by the operation is missing) and
TransportException (Mondial Relay unreachable, HTTP or SOAP error, invalid or incomplete
response), both extending MondialRelayException: the cause of a failure can be told apart
without reading the message, e.g. to show a translated message. ApiException keeps the
Mondial Relay codes (getErrors()).ApiException::getErrors() is documented as array<int|string, string>: PHP turns numeric
Mondial Relay codes into integer keys ("10051" becomes 10051).http://www.example.org/Request
namespace, so Mondial Relay rejected every request with "10061 Problème de formatage du XML".Level attribute (Error and Critical error raise an ApiException, Warning does not).<Shipment ShipmentNumber="…">), and the success status (Code="0", which carries an
informative message in the sandbox) was treated as an error.WSI4_PointRelais_Recherche were incomplete and out of order. They now follow the order
signed by Mondial Relay, and the brand code is padded to 8 characters.BDTEST brand with any credentials: it needs a
valid API user.Réécriture complète — remplace QuentinBontemps/php-mondialrelay-api.
psr/http-client) + PSR-17 (psr/http-factory, psr/http-message) : le client HTTP est maintenant injecté, aucun transport maisonext-curl supprimé — apportez votre implémentation PSR-18 (symfony/http-client, guzzle…)ShipmentClientInterface / ParcelShopClientInterface : contrats internes substituables// symfony/http-client — Psr18Client implémente PSR-18 + PSR-17
$psr18 = new \Symfony\Component\HttpClient\Psr18Client();
$client = MondialRelayClient::create($psr18, $psr18, $psr18, $login, $password, $customerId, $secretKey);
// Guzzle
$guzzle = new \GuzzleHttp\Client();
$factory = new \GuzzleHttp\Psr7\HttpFactory();
$client = MondialRelayClient::create($guzzle, $factory, $factory, $login, $password, $customerId, $secretKey);
How can I help you explore Laravel packages today?