Download the PHP package smart-dato/arco-spedizioni-sdk without Composer
On this page you can find all versions of the php package smart-dato/arco-spedizioni-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download smart-dato/arco-spedizioni-sdk
More information about smart-dato/arco-spedizioni-sdk
Files in smart-dato/arco-spedizioni-sdk
Package arco-spedizioni-sdk
Short Description Arco Spedizioni Laravel SDK
License MIT
Homepage https://github.com/smart-dato/arco-spedizioni-sdk
Informations about the package arco-spedizioni-sdk
Arco Spedizioni SDK
A Laravel package for the Italian carrier Arco Spedizioni. It talks to Arco's web services (waybill numbers and routing), generates the fixed-width DDT and TXT files Arco exchanges with clients, parses Arco's delivery-outcome (esiti) files, and renders PDF and ZPL shipping labels.
Requirements
- PHP 8.2+
- Laravel 10 – 13
Installation
Publish the config file:
Configuration
The client code is sent as CodCliente in routing requests unless you pass clientCode to ShipmentData.
Web services
The ArcoSpedizioni facade is bound to a client built from the configured credentials. It logs in lazily on the first call and reuses the token.
Or construct it yourself:
Routing
Ask Arco how a shipment will be routed (instradamento):
Errors
ArcoSpedizioniConnectionException— the request could not be sentArcoSpedizioniRequestException— Arco returned an error responseArcoSpedizioniInvalidWaybillNumberException—nextWaybillNumber()got an empty number back
DDT and TXT files
DdtFileGenerator and TxtFileGenerator build Arco's fixed-width record files. Set each field by name, close the record, and repeat for as many records as you need:
Each field is padded to its defined width — numeric fields with leading zeros, text fields with trailing spaces — and every record ends with a newline. The field names and their positions are defined in the $structure of each generator.
Delivery outcomes
Parse the esiti files Arco sends back:
Arco sends the event label in Italian (Consegnata, Messa in Transito, ...) or English (DELIVERED, DEPARTED FROM VR, ...) depending on the client account. Both map to the same TrackingEvent case: DELIVERED, OUT_FOR_DELIVERY, IN_TRANSIT, STORAGE_OPENED, STORAGE_CLOSED, RECEIVED, LOADED, DEPARTED and ARRIVED. The case value is the stable code to map against, whatever the language.
R29EVE is null for a label the enum does not know yet, so one new status does not abort the file; R29EVE_LABEL always holds the label as sent. English hub events carry the hub's province code, which TrackingEvent::hubFromLabel('DEPARTED FROM VR') returns ('VR'). parseFile() throws if the file cannot be read.
Labels
Render a label as PDF or ZPL from the package's Blade templates:
These are the variables the pdf and zpl templates read.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- SmartDato
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of arco-spedizioni-sdk with dependencies
dompdf/dompdf Version ^3.1
illuminate/contracts Version ^10.0||^11.0||^12.0||^13.0
saloonphp/saloon Version ^4.0
spatie/laravel-package-tools Version ^1.16