webapix / mygls-sdk
An lightweight php SDK for the MyGLS REST API
Fund package maintenance!
patrons.webapix.hu
Installs: 62 740
Dependents: 2
Suggesters: 0
Security: 0
Stars: 30
Watchers: 4
Forks: 10
Open Issues: 0
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^6.5|^7.0
- webapix/dot-net-json-date-formatter: ^1.0
Requires (Dev)
- mockery/mockery: ^1.3.3
- phpunit/phpunit: ^7.5|8.5.22|9.x
README
An unofficial lightweight PHP SDK for the MyGLS REST API.
Installation
You can install the package via composer:
composer require webapix/mygls-sdk
Usage
use GuzzleHttp\Client as HttpClient; use Webapix\GLS\Client; use Webapix\GLS\Models\Parcel; use Webapix\GLS\Services\SMS; use Webapix\GLS\Requests\PrintLabels; $parcel = (new Parcel) ->setClientNumber(123456789) ->setPickupAddress(<class that extends \Webapix\GLS\Contracts\Address>) ->setDeliveryInfo(<class that extends \Webapix\GLS\Contracts\Contact>) ->when($order->cutomerWantsSmsAlert(), function (Parcel $parcel) use ($order) { return $parcel->addService( new SMS($order->phone_number, 'Your package (#ParcelNr#) is on its way to GLS facility!') ); }); $client = new Client(new HttpClient); $request = PrintLabels; $request->addParcel($parcel); /** @var \Webapix\GLS\Responses\PrintLabels $response */ $response = $client->on($account)->request($request); if ($response->successfull()) { // get the pdf $response->getPdf(); }
You can find more information and examples in our wiki.
Docs
Package docs
Official GLS Docs
Testing
composer test
Postcardware
According to the postcardware concept, if you use the software for your project(s) we would appreciate to receive a postcard of your hometown.
Please send it to:
WEBAPIX KFT.
Kőris utca 2/E, 2/1
2051 Biatorbágy
Hungary
Support us
If you find our packages useful and would like to support our work in maintaining and regularly updating them, consider becoming a patron. Any size of donation is welcome and highly appreciated.
Contributing
Contributions are welcome! When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
Changelog
Please see CHANGELOG for more information on what has changed recently.
Security
If you discover any security related issues, please email pdo@webapix.hu instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.