xenon/multicourier
最新稳定版本:v1.0.3
Composer 安装命令:
composer require xenon/multicourier
包简介
This is a courier api endpoints library for interacting such as e-courier, pathao, paperfly etc
README 文档
README
This is a courier api endpoints library for interacting such as e-courier, pathao etc
Installation
Step 1:
composer require xenon/multicourier
Step 2:
Then, publish the package
php artisan vendor:publish --provider=Xenon\MultiCourier\MultiCourierServiceProvider
Step 3:
Set .env configuration for individual couriers
PATHAO_CLIENT_SECRET="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
PATHAO_USERNAME="xxxx@example.com"
PATHAO_PASSWORD="xxxxxx"
PATHAO_GRANT_TYPE="password"
ECOURIER_API_KEY='xxx'
ECOURIER_API_SECRET='xxx'
ECOURIER_USER_ID='xxxx'
ECOURIER_ENVIRONMENT='xxxx'
Otherwise, if you want more control, you can use the underlying sender object. This will not touch any laravel facade or service provider.
Sample Code Requesting to E-courier
use Xenon\MultiCourier\Provider\ECourier;
use Xenon\MultiCourier\Courier;
$courier = Courier::getInstance();
$courier->setProvider(ECourier::class, 'local'); /* local/production */
$courier->setConfig([
'API-KEY' => 'xxx',
'API-SECRET' => 'xxxx',
'USER-ID' => 'xxxx',
]);
$courier->setParams(['city'=>'Dhaka']);
$thanas = $courier->getThanas(); //get thana
$cities = $courier->getCities(); //get city
//place order
use Xenon\MultiCourier\Provider\ECourier;
use Xenon\MultiCourier\Courier;
$courier = Courier::getInstance();
$courier->setProvider(ECourier::class, 'local'); /* local/production */
$courier->setConfig([
'API-KEY' => 'xxx',
'API-SECRET' => 'xxx',
'USER-ID' => 'xxx',
]);
$orderData = array(
'recipient_name' => 'XXXXX',
'recipient_mobile' => '017XXXXX',
'recipient_city' => 'Dhaka',
'recipient_area' => 'Badda',
'recipient_thana' => 'Badda',
'recipient_address' => 'Full Address',
'package_code' => '#XXXX',
'product_price' => '1500',
'payment_method' => 'COD',
'recipient_landmark' => 'DBBL ATM',
'parcel_type' => 'BOX',
'requested_delivery_time' => '2019-07-05',
'delivery_hour' => 'any',
'recipient_zip' => '1212',
'pick_hub' => '18490',
'product_id' => 'DAFS',
'pick_address' => 'Gudaraghat new mobile',
'comments' => 'Please handle carefully',
'number_of_item' => '3',
'actual_product_price' => '1200',
'pgwid' => 'XXX',
'pgwtxn_id' => 'XXXXXX'
);
$courier->setParams($orderData);
$response = $courier->placeOrder();
Sample Code Requesting to Pathao
use Xenon\MultiCourier\Courier;
use Xenon\MultiCourier\Provider\Pathao;
$courier = Courier::getInstance();
$courier->setProvider(Pathao::class, 'local'); /* local/production */
$courier->setMethod('get');
$courier->setRequestEndpoint('cities/1/zone-list', []); //second param should be array. its optional. you should form params here
$response = $courier->send();
Available Methods to Interact with Provider's Api
getInstance()
getConfig()
setConfig()
getParams()
setParams()
getProvider()
setProvider()
getCities()
getThanas()
trackOrder()
trackChildOrder()
getPackages()
placeOrder()
cancelOrder()
cancelChildOrder()
fraudStatusCheck()
getAreas()
getPostCodes()
getBranches()
printLabel()
boostSms()
topupSms()
topTransactionStatus()
topupOtp()
Currently Supported Courier Gateways
- ECourier
- Pathao
We are continuously working in this open source library for adding more Bangladeshi courier companies. If you feel something
is missing then make a issue regarding that. Your can pull request to dev branch.
If you want to contribute in this library, then you are highly welcome to
do that....
read blog from here
https://dev.to/arif98741/bangladeshi-courier-company-api-integration-in-laravel-using-xenon-multicourier-package-4m12
xenon/multicourier 适用场景与选型建议
xenon/multicourier 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2.04k 次下载、GitHub Stars 达 20, 最近一次更新时间为 2022 年 01 月 17 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 xenon/multicourier 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 xenon/multicourier 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 2.04k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 20
- 点击次数: 24
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-01-17

