abishekrsrikaanth / aftership-laravel
Laravel 4 包,用于与 After-Ship API 集成
dev-master
2015-06-18 11:03 UTC
Requires
- php: >=5.3.0
- abishekrsrikaanth/aftership-php-sdk: dev-master
- illuminate/support: 4.x
This package is auto-updated.
Last update: 2024-09-14 06:34:40 UTC
README
####安装
使用 Composer
"require": {
....
"abishekrsrikaanth/aftership-laravel": "1.0"
},
更新 composer
$ php composer.phar update
将提供者添加到您的 app/config/app.php 配置文件中
'providers' => array(
...
'Abishekrsrikaanth\Aftership\AftershipServiceProvider',
),
并在 app/config/app.php 中添加 Facade 信息
'aliases' => array(
...
'AfterShip' => 'Abishekrsrikaanth\Aftership\Facades\Aftership',
),
发布配置并使用不同电子邮件提供者的凭据设置配置
php artisan config:publish abishekrsrikaanth/aftership-laravel
####快递公司
获取快递对象实例
$courier = AfterShip::Couriers();
$response = $courier->get();
####追踪
获取追踪对象实例
$tracking = AfterShip::Tracking();
$response = $tracking->get($options);
####Webhooks 设置 本库内置了对 Aftership Webhook 通知的简单配置支持。要配置 Webhook 路由,打开已发布的配置文件并设置以下配置。
'web_hook' => array(
'enabled' => true, //Set this to true to enable Web hook Route
'route_url' => '/wehbooks/aftership', //Setup the Route Url that has been configured on Aftership Control Panel
'listener' => array(
'type' => 'event', //Can be "event" or "queue"
'handler' => '', //Handler to be called when the Webhook notification is received
'queue_name' => '', //Used only if the type == "queue"
'queue_connection' => '' //To be used if a connection based queue needs to be used
)
)