Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Mondial Relay Laravel Package

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.

View on GitHub
Deep Wiki
Context7
v4.2.0

Added

  • Relay point search around coordinates: 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).
v4.1.0

Changed (breaking for named arguments)

  • Credential arguments are named after MR Connect: login → apiLogin, password → apiPassword, customerId → brandCode, secretKey → privateKey (MondialRelayClient::create(), RestShipmentClient, SoapParcelShopClient). Positional calls are not affected.

Added

  • PSR-3 logging (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()).

Fixed

  • ApiException::getErrors() is documented as array<int|string, string>: PHP turns numeric Mondial Relay codes into integer keys ("10051" becomes 10051).
  • Relay point names and addresses no longer contain runs of spaces: Mondial Relay replaces apostrophes with spaces ("RUE D'ARMOR" comes back as "RUE D ARMOR").
  • Missing credentials fail with a clear message before calling Mondial Relay: API login and password for label creation, private key for relay point search.
  • HTTP errors no longer copy the response body into the exception message: Mondial Relay echoes the credentials in it.
  • Label creation always failed: the request did not declare the http://www.example.org/Request namespace, so Mondial Relay rejected every request with "10061 Problème de formatage du XML".
  • Errors returned by Mondial Relay were ignored and reported as "Incomplete API response": status codes start with "1", which were all treated as warnings. The severity now comes from the Level attribute (Error and Critical error raise an ApiException, Warning does not).
  • Successful responses were rejected: the shipment number is returned as an attribute (<Shipment ShipmentNumber="…">), and the success status (Code="0", which carries an informative message in the sandbox) was treated as an error.
  • Relay point search always failed with STAT 97 "Incorrect security key": the signed parameters of 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.
  • Relay points: distances were returned in metres as kilometres (×1000), and names, addresses and cities kept their padding spaces.
  • STAT errors use the official Mondial Relay messages (e.g. 95 "Merchant account not activated").
  • Parcel dimensions were sent after the weight: elements now follow the order of the official XSD (Content, Length, Width, Depth, Weight).
  • The README claimed that the sandbox accepted the BDTEST brand with any credentials: it needs a valid API user.
  • Tests use real responses of the Mondial Relay sandbox. Verified end to end against the sandbox: shipment created and PDF label downloaded.
v3.0.0

Breaking changes

Réécriture complète — remplace QuentinBontemps/php-mondialrelay-api.

Ce qui change

  • PSR-18 (psr/http-client) + PSR-17 (psr/http-factory, psr/http-message) : le client HTTP est maintenant injecté, aucun transport maison
  • V2 REST pour la création d'étiquettes, V1 SOAP pour la recherche de points relais
  • ext-curl supprimé — apportez votre implémentation PSR-18 (symfony/http-client, guzzle…)
  • ShipmentClientInterface / ParcelShopClientInterface : contrats internes substituables

Utilisation

// 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);
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
mehedimi/laravel-amp-mail
happones/laravel-vue-i18n-generator
jwerd/inertia-table
siberfx/flysystem-wasabi
hollyit/token-replace
ippanelcom/laravel-sdk
adachsoft/changelog-linter
adachsoft/collection
payerurl/telegrambot-crypto-payment-instant-payout
dskripchenko/laravel-hybrid-search
riorizkyrainey/lara-ced
mehedimi/static-vel
zharp/zharp
nonsapiens/bigquery-model-sync
lgu-bayambang-ict-office/lgu-laravel-development-standards
andydefer/laravel-support
se7enxweb/flysystem
lampwick/laravel
jeslage/statamic-emojis
micahdshackelford/rmap-laravel