Download the PHP package tsukasa/fan-courier-api-client without Composer
On this page you can find all versions of the php package tsukasa/fan-courier-api-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download tsukasa/fan-courier-api-client
More information about tsukasa/fan-courier-api-client
Files in tsukasa/fan-courier-api-client
Informations about the package fan-courier-api-client
Fan Courier API Client Library
License MIT
FanCourier API Client
A client developed as a library, easy to integrate in other projects.
Installation
Install the package through Composer.
Run the Composer require command from the Terminal:
composer require infifni/fan-courier-api-client
Now you're ready to start using the FanCourier API Client in your application.
Overview
Look at one of the following topics to learn more about FanCourier API Client.
- Usage
- Exceptions
Usage
Explanations
See the phpunit tests for more in depth understanding of how the library works. The FanCourier API Client library gives you the following methods to use:
city method
Retrieves cities based on county and language.
The city()
method will return an array of objects with: judet, localitate, agentie, km, cod_rutare, id_localitate_fan.
These keys will be translated if english language is being specified.
streets method
Retrieves streets based on county, city and language.
The streets()
method will return an array of objects with the following keys: judet, localitate, strada, de_la, pana_la, paritate, cod_postal, tip, cod_cartare, numar_depozite.
These keys will be translated if english language is being specified.
price method
Retrieves price based on service, package, distance and other params.
The price()
method will return a double (standard service) or a json string (export service).
trackAwbMethod
Track expedition using AWB code.
The trackAwb()
method will return a plain text.
generateAwb method
Send orders to generate AWB
The generateAwb()
method will return an array of objects with: line, awb, send_params, error_message.
order method
Place a order to a FanCourier Agent. The agent will come a pick-up the package at the requested hour, same day.
The order()
method will return a plain message if the request is being done successfully
exportAwbErrors method
All FanCourier AWB with errors.
The exportAwbErrors()
method will return an empty array or with objects containing: nume, judet, localitate, telefon, plicuri, colete, greutate, descriere.
deleteAwb method
Deletes AWB only if the shipping process has not finished.
The deleteAwb()
method will return an int (the deleted AWB number) if the request was successful or the error message.
getAwb method
Return documents containing shipping details.
The getAwb()
method will return a html page containing documents that can be printed if the request was successful or the error message.
downloadAwb method
Returns AWB document in jpg format.
The downloadAwb()
method will return a jpg if the request is made successfully or the error message.
exportOrders method
All orders made within selected date through order method.
The exportOrders()
method will return an empty array or with objects containing: nr._crt., data_ridicare_comanda, ora_de_la, ora_pana_la, persoana_contact, telefon, email, colete, numar_comanda, status.
exportBordereau method
All orders made within selected date through generateAwb method.
The exportBordereau()
method will return an empty array or with objects containing: nr._crt., awb, ridicat, status, data_confirmarii, restituire, tip_serviciu, continut...
exportReports method
Returns all expeditions that have placed the total amount in the deposit account within selected date for the bank transfer.
The exportReports()
method will return an empty array or with objects containing: oras_destinatar, dat_awb, suma_incasata, numar_awb, numar_awb, expeditor, destinatar, continut, persoanaD, data_virament, persoanaE, ramburs_la_awb, awb_retur
exportObservations method
Returns all observations that can be set when an expedition is being requested.
The exportObservations()
method will return an empty array or with objects containing: observatii_fan_courier
endBordereau method
Will close all orders made for the current date.
The endBordereau()
method will return a html.
Exceptions
The FanCourier package will throw exceptions if something goes wrong. This way it's easier to debug your code using the FanCourier package or to handle the error based on the type of exceptions. The FanCourier packages can throw the following exceptions:
Exception |
---|
FanCourierInstanceException |
FanCourierInvalidParamException |
FanCourierUnknownRequestException |
CsvWrongReadException |