You can install the package via composer:
composer require gdinko/acs
If you plan to use database for storing nomenclatures:
php artisan migrate
If you need to export configuration file:
php artisan vendor:publish --tag=acs-config
If you need to export migrations:
php artisan vendor:publish --tag=acs-migrations
If you need to export models:
php artisan vendor:publish --tag=acs-models
If you need to export commands:
php artisan vendor:publish --tag=acs-commands
ACS_API_KEY=
ACS_COMPANY_ID=
ACS_COMPANY_PASSWORD=
ACS_USER_ID=
ACS_USER_PASSWORD=
ACS_BILLING_CODE=
ACS_API_BASE_URL= #default=https://webservices.acscourier.net/ACSRestServices/api/ACSAutoRest/
ACS_API_TIMEOUT= #default=5
Runtime Setup
Acs::setTimeout(99);
/**
* You can call all methods from the API like this , there is no need
* to pass company data every time. The data is injected automaticaly
* on every request
**/
dd(Acs::ACS_Address_Validation([
'Address' => 'Address ...'
]));
dd(Acs::ACS_Trackingsummary([
'Voucher_No' => '999999999'
]));
Commands
#get acs api status (use -h to view options)
php artisan acs:api-status
#track parcels (use -h to view options)
php artisan acs:track
Models
CarrierAcsTracking
CarrierAcsApiStatus
Events
CarrierAcsTrackingEvent
- Subscribe to tracking event, you will recieve last tracking info, if tracking command is schduled
Event::listen(function (CarrierAcsTrackingEvent $event) {
echo $event->account;
dd($event->tracking);
});
- Before use of tracking command you need to create your own command and define setUp method
php artisan make:command TrackCarrierAcs
- In app/Console/Commands/TrackCarrierAcs define your logic for parcels to be tracked
use Gdinko\Acs\Commands\TrackCarrierAcsBase;
class TrackCarrierAcsSetup extends TrackCarrierAcsBase
{
protected function setup()
{
//define parcel selection logic here
// $this->parcels = [];
}
}
- Use the command
php artisan acs:track
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email dinko359@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.