- How do I install ernadoo/mondial-relay in a Laravel application?
- Run composer require ernadoo/mondial-relay. The package requires PHP 8.2+ plus ext-curl, ext-soap, and ext-simplexml, so confirm those extensions are enabled in your Laravel runtime. It is framework-agnostic, so you typically bind MondialRelayClient or the shipment clients in a Laravel service provider rather than relying on package auto-discovery.
- Which Laravel and PHP versions does this package support?
- The documented requirement is PHP 8.2 or newer; the package does not advertise Laravel-specific version constraints because it is framework-agnostic. In practice, use a Laravel release that runs on PHP 8.2+ and check the Composer constraints before upgrading. Pin an exact package version in production rather than floating to avoid surprise API vocabulary changes.
- How do I create a Mondial Relay shipping label and download the PDF?
- Build a ShipmentRequest with sender and recipient Address objects, one or more Parcel objects, and an optional delivery location. Call createShipment on MondialRelayClient, then read shipmentNumber, labelOutput (the PDF URL), and trackingUrl from the response. Queue this in order fulfilment and store the returned identifiers for retries and customer tracking.
- How do I search for Mondial Relay pickup points at checkout?
- Use the V1 SOAP relay-point search client (SoapParcelShopClient) because Mondial Relay has not published a V2 REST endpoint for this. Call it during checkout after you have a country and postcode, then present the eligible relay points to the customer. Cache results per area to reduce latency and external dependency risk.
- What credentials do I need for Mondial Relay sandbox and production?
- You need the Mondial Relay login, password, customer ID, and secret key. In v4.1.0 these are expressed as apiLogin, apiPassword, brandCode, and privateKey for named arguments. Pass sandbox: true for testing and false for production, and keep all values in environment/config rather than code.
- What breaks in v4.1.0 when credential names changed?
- The release renames named arguments from login, password, customerId, and secretKey to apiLogin, apiPassword, brandCode, and privateKey. Positional calls are unaffected, but any named-argument calls, config aliases, or DI bindings using the old names must be updated. Audit your integration before deploying and pin v4.1.0 for the label, relay-point, and dimension fixes.
- How should I handle Mondial Relay API errors and retries in Laravel?
- Catch MondialRelayException and branch on ConfigurationException for deployment/config failures, TransportException for transient infrastructure or network failures, and ApiException for business or validation rejections. Retry only TransportException with backoff and alerting; do not blindly retry ApiException. Note that getErrors() keys may be integers for numeric Mondial Relay codes, so error mapping must accept int|string.
- Does ernadoo/mondial-relay integrate with Laravel logging and dependency injection?
- Yes, you can inject a PSR-3 logger with setLogger(), which fits Laravel's logging stack. Bind the client and any wrapper shipping service in the container, and keep controllers and checkout code dependent on your domain service rather than the vendor client. The package intentionally excludes credentials and request bodies from its logs, but your own logs and exception messages still need PII review.
- Can I test Mondial Relay label creation without creating real shipments?
- Use sandbox mode by passing sandbox: true when creating the client. Run end-to-end tests for label creation, PDF download, and relay-point search against the sandbox before production. The package includes PHPUnit tests, but your application should also verify its own request mapping, exception handling, and stored shipment identifiers.
- How do I make Mondial Relay label creation reliable in production?
- Queue label creation from order fulfilment, persist idempotency keys or order-to-shipment mappings, and retry only transient TransportException failures with backoff. Monitor API rejection, warning, and transport rates, and canary production label creation before rolling out broadly. Confirm brand activation and production credentials, and verify sandbox parity for both labels and relay-point search.