承接 enan/pathao-courier 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

enan/pathao-courier

Composer 安装命令:

composer require enan/pathao-courier

包简介

A complete Laravel package for Pathao Courier

README 文档

README

A complete Laravel Package for Pathao Courier

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A complete package for Laravel to use Pathao Courier Merchant API. Setup once and forget about it. You don’t even have to worry about the validation of creating orders, creating a store, or getting calculated price value which are generally a POST request on the Pathao courier end.
With this package you can get the following

  • Get the city list
  • Get the zone list
  • Get the area list
  • Get the store list
  • Create Store
  • Get order details
  • Get calculated price
  • Get the token exipiration days left and also expected date of it
  • Get the user success rate using phone number New

It offers you a bunch of validation for Create order, Create Store, Get calculated price.So you don't have to worry about the validation for all of this.

⚙️ Installation

You can install the package via composer:

composer require enan/pathao-courier

You can publish the migration file and config file with:

php artisan vendor:publish --tag="pathao-courier-config"

Though Laravel auto discover. If not add the following in config\app.php. You can skip this part if you want.

// add below line in the providers array
Enan\PathaoCourier\PathaoCourierServiceProvider::class,


// add below line in the alias array
'PathaoCourier' => Enan\PathaoCourier\Facades\PathaoCourier::class,

Add the following environment variables to your .env file. You can choose the table name of migration before running the migration. Default is 'pathao-courier'

PATHAO_DB_TABLE_NAME='pathao-courier'
PATHAO_CLIENT_ID=
PATHAO_CLIENT_SECRET=
PATHAO_SECRET_TOKEN=

🔑 Where can I find the value?

Go to your Pathao Developers Api and you'll find Merchant API Credentials there. And for PATHAO_SECRET_TOKEN= you'll be provided it after the successfull authentication.

🎫 Setup

Run the migration

php artisan migrate

You have to set the token of pathao courier. To set run below artisan command
The command will ask the credentials. This is a one time process. You don't have to setup this again.
If you want to update current token and secret you can run the command again.
You will be provided a secret token here. Please set the token in your .env file with PATHAO_SECRET_TOKEN=

php artisan set:pathao-courier

🏗 Usage

Add the Facade before using

use Enan\PathaoCourier\Facades\PathaoCourier;

For the POST type response the required validation are mentioned before the function like <required, string> So here the value should be required and string

/**
 * To Get the days left of token expiration
 * You'll get the expected date of the expiration and total days left
 *
 * @type <GET>
 */
PathaoCourier::GET_ACCESS_TOKEN_EXPIRY_DAYS_LEFT();

/**
 * To Get the cities
 *
 * @type <GET>
 */
PathaoCourier::GET_CITIES();

/**
 * To Get the Zones
 * @type <GET>
 *
 * @param int $city_id
 */
PathaoCourier::GET_ZONES(int $city_id);

/**
 * To Get the Areas
 * @type <GET>
 *
 * @param int $zone_id
 */
PathaoCourier::GET_AREAS(int $zone_id);

/**
 * To Get the Stores
 * @type <GET>
 *
 * @param int $page
 * $page param is optional. If you want you can implement pagination here.
 */
PathaoCourier::GET_STORES(int $page);

/**
 * To Create Store
 * @type <POST>
 * Pass below mentioned parameter
 *
 * @param $name <required, string>
 * @param $contact_name <required, string>
 * @param $contact_number <required, numeric>
 * @param $address <required, string>
 * @param $city_id <required, numeric>
 * @param $zone_id <required, numeric>
 * @param $area_id <required, numeric>
 */
PathaoCourier::CREATE_STORE($request);

/**
 * To Create Order
 * @type <POST>
 * Pass below mentioned parameter
 *
 * @param $store_id <required, numeric>
 * @param $merchant_order_id    <nullable, string>
 * @param $sender_name  <required, numeric>
 * @param $sender_phone     <required, string/>
 * @param $recipient_name   <required, string>
 * @param $recipient_phone  <required, string>
 * @param $recipient_address    <required, string, Min:10>
 * @param $recipient_city   <required, numeric>
 * @param $recipient_zone   <required, numeric>
 * @param $recipient_area   <required, numeric>
 * @param $delivery_type    <required, numeric> is provided by the merchant and not changeable. 48 for Normal Delivery, 12 for On Demand Delivery"
 * @param $item_type    <required, numeric> is provided by the merchant and not changeable. 1 for Document, 2 for Parcel"
 * @param $special_instruction  <nullable, string>
 * @param $item_quantity    <required, numeric>
 * @param $item_weight  <required, numeric>
 * @param $amount_to_collect    <required, numeric>
 * @param $item_description     <nullable, string>
 */
PathaoCourier::CREATE_ORDER($request);

/**
 * To Get Price Calculation
 * @type <POST>
 * Pass below mentioned parameter
 *
 * @param $delivery_type <required, numeric>
 * @param $item_type <required, numeric>
 * @param $item_weight <required, numeric>
 * @param $recipient_city <required, numeric>
 * @param $recipient_zone <required, numeric>
 * @param $store_id <required, numeric>
 */
PathaoCourier::GET_PRICE_CALCULATION($request);


/**
 * To View Order
 * @type <GET>
 * @param string $consignment_id
 */
PathaoCourier::VIEW_ORDER(string $consignment_id);


/**
 * To Get User's success rate using phone number
 * @type <POST>
 * @param string $phone
 */
PathaoCourier::GET_USER_SUCCESS_RATE($request);

Credits

License

The MIT License (MIT). Please see License File for more information.

Check me on

enan/pathao-courier 适用场景与选型建议

enan/pathao-courier 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 697 次下载、GitHub Stars 达 15, 最近一次更新时间为 2023 年 12 月 14 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「Moammer Farshid Enan」 「pathao-courier」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 enan/pathao-courier 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 enan/pathao-courier 我们能提供哪些服务?
定制开发 / 二次开发

基于 enan/pathao-courier 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 697
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 15
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 15
  • Watchers: 3
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-12-14