-
- This package is not a official package from SMSA just my develop *
- it's a laravel package for SMSA Integration
-
Require the package using composer:
composer require ahyadessam/smsa
-
Add the service provider to the
providers
inconfig/app.php
:Smsa\SmsaServiceProvider::class,
-
Add alias provider to the
aliases
inconfig/app.php
:'Smsa' => Smsa\SmsaFacade::class,
-
Publish the public assets:
php artisan vendor:publish
-
Configure your
SMSA
account data inconfig/smsa.php
:
Shipping
: Create shipping and git AWB number.PrintAWB
: Create Shipping policy PDF.Tracking
: Get shipping tracking.Cancel
: Cancel shipping.
You can get more information from SMSA documentations
use Smsa;
class HomeController extends Controller
{
public function smsa_shipping(){
$parameters = [
'refNo' => '22222',
'idNo' => 'id',
'cName' => 'name',
'cntry' => 'KSA',
'cCity' => 'Riyadh',
'cMobile' => '033333333',
'cAddr1' => 'test',
'cAddr2' => '',
'PCs' => '1',
'cEmail' => 'test@test.com',
'weight' => '1',
'cZip' => '',
'cPOBox' => '',
'cTel1' => '',
'cTel2' => '',
'carrValue' => '',
'carrCurr' => '',
'codAmt' => '',
'custVal' => '',
'custCurr' => '',
'insrAmt' => '',
'insrCurr' => '',
'itemDesc' => '',
'prefDelvDate' => '',
'gpsPoints' => ''
];
$test = Smsa::Shipping($parameters);
dd($test);
}
public function print_label(){
$get_pdf = Smsa::PrintAWB('290012998106');
dd($get_pdf);
}
public function tracking(){
$tracking = Smsa::Tracking('290012998106');
dd($tracking);
}
public function cancel_shipping(){
$cancel = smsa::Cancel('290012998106', 'test');
}
}
All methods will return array contain status
(true|false) and value
(your need value)
for any question you can contact with me on twitter @AhyadEssam, thanks