Download the PHP package seniorprogramming/postisgate without Composer
On this page you can find all versions of the php package seniorprogramming/postisgate. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package postisgate
PostisGate API Client
A simple PostisGate implementation for Laravel.
Installation
Install the package through Composer.
Run the Composer require command from the Terminal:
composer require seniorprogramming/postisgate
Now all you have to do is add the service provider of the package and alias the package. To do this open your config/app.php
file.
Add a new line to the providers
array:
SeniorProgramming\PostisGate\Providers\ApiServiceProvider::class,
And optionally add a new line to the aliases
array:
'PostisGate' => SeniorProgramming\PostisGate\Facades\PostisGate::class,
Important, add in .env PostisGate credentials:
And in config/filesystems.php
Now you're ready to start using the PostisGate API Client in your application.
Overview
Look at one of the following topics to learn more about PostisGate API Clien
- Usage
- Exceptions
- Example
Usage
The PostisGate API Client gives you the following methods to use:
Login()
Retrieves the token for authentication when calling methods.
CreateShipment()
Creates the shipment for the client order. The login command is not required. It does it automatically.
The createShipment()
method will return an array of objects with: clientOrderDate, createdDate, sendType, productCategory, courierId, shipmentId, shipmentParcels[parcelReferenceId, parcelType, itemCode, itemDescription1, barCode], clientOrderId.
GetShipmentLabel()
Retrieve the AWB to a pdf file. The login command is not required. It does it automatically.
The getShipmentLabel()
method will return TRUE.
Exceptions
The PostisGate package will throw exceptions if something goes wrong. This way it's easier to debug your code using the PostisGate package or to handle the error based on the type of exceptions. The PostisGate packages can throw the following exceptions:
Exception |
---|
PostisGateInstanceException |
PostisGateInvalidParamException |
PostisGateTokenInvalidException |
PostisGateUnknownModelException |
Example
Login()
CreateShipment()
GetShipmentLabel()
For more information use the PostisgGate API documentation.
If you want to create more operations, create a class in the src/Operations
folder just like the existing one and call through:
All versions of postisgate with dependencies
php-curl-class/php-curl-class Version ^7.1
laravel/framework Version 5.7.*