devrkb21/czbd-courier
最新稳定版本:v1.0.0
Composer 安装命令:
composer require devrkb21/czbd-courier
包简介
Laravel courier fraud and delivery behavior checker for Bangladesh couriers.
关键字:
README 文档
README
Laravel package for checking customer delivery behavior across major Bangladeshi courier services.
What It Does
- Queries multiple couriers with a single phone number input.
- Returns per-courier success/cancel counts and success ratio.
- Builds an aggregate summary across all couriers.
- Supports account failover pools per courier when one account is limited or fails.
- Supports optional global or per-courier HTTP proxy routing.
Supported couriers:
- Steadfast
- Pathao
- RedX
- Paperfly
- Carrybee
Requirements
- PHP:
^8.2 - Laravel:
^8.0|^9.0|^10.0|^11.0|^12.0|^13.0 - Guzzle:
^7.8
Installation
composer require devrkb21/czbd-courier
Publish config:
php artisan vendor:publish --provider="Czbd\\CourierChecker\\CourierCheckerServiceProvider" --tag="courier-checker-config"
This creates config/courier-checker.php.
You can still use Laravel's default tag when needed:
php artisan vendor:publish --tag="config"
Environment Configuration
Add credentials to .env.
# Pathao PATHAO_USER="your_pathao_email@example.com" PATHAO_PASSWORD="your_pathao_password" PATHAO_USERS="fallback1@example.com,fallback2@example.com" PATHAO_PASSWORDS="pass1,pass2" # Steadfast STEADFAST_USER="your_steadfast_email@example.com" STEADFAST_PASSWORD="your_steadfast_password" STEADFAST_USERS="fallback1@example.com,fallback2@example.com" STEADFAST_PASSWORDS="pass1,pass2" # RedX (local 11-digit mobile format) REDX_PHONE="017XXXXXXXX" REDX_PASSWORD="your_redx_password" REDX_PHONES="017XXXXXXXX,018XXXXXXXX" REDX_PASSWORDS="pass1,pass2" # Paperfly PAPERFLY_USER="your_paperfly_username" PAPERFLY_PASSWORD="your_paperfly_password" PAPERFLY_USERS="fallback_user_1,fallback_user_2" PAPERFLY_PASSWORDS="pass1,pass2" # Carrybee (local 11-digit mobile format) CARRYBEE_PHONE="017XXXXXXXX" CARRYBEE_PASSWORD="your_carrybee_password" CARRYBEE_PHONES="017XXXXXXXX,018XXXXXXXX" CARRYBEE_PASSWORDS="pass1,pass2" # Proxy flags (strict yes/no) COURIER_PROXY_ALL="no" COURIER_PROXY_PATHAO="no" COURIER_PROXY_STEADFAST="no" COURIER_PROXY_REDX="no" COURIER_PROXY_PAPERFLY="no" COURIER_PROXY_CARRYBEE="no" # Shared proxy endpoint COURIER_PROXY_ADDRESS="http://127.0.0.1:8080"
Configuration rules:
- Fallback pools are optional.
- Pool values are parsed from comma-separated or newline-separated lists.
- Fallback lists must be index-aligned. Example: 2 users must have 2 passwords.
- Proxy flags accept only
yesorno. Any other value throws an exception. COURIER_PROXY_ALL=yesenables proxy for all couriers.COURIER_PROXY_{COURIER}=yesenables proxy only for that courier.
Usage
Using the facade:
use CourierChecker; $report = CourierChecker::check('01712345678');
Using dependency injection:
use Czbd\CourierChecker\CourierCheckerManager; public function show(CourierCheckerManager $manager) { return $manager->check('01712345678'); }
Using individual service classes:
use Czbd\CourierChecker\Services\PathaoService; $result = app(PathaoService::class)->getDeliveryStats('01712345678');
Response Shape
[ 'steadfast' => [ 'success' => 10, 'cancel' => 2, 'total' => 12, 'success_ratio' => 83.33, ], 'pathao' => [ 'success' => 5, 'cancel' => 1, 'total' => 6, 'success_ratio' => 83.33, 'customer_rating' => 'trusted_customer', // optional ], 'redx' => [...], 'paperfly' => [...], 'carrybee' => [...], 'aggregate' => [ 'total_success' => 0, 'total_cancel' => 0, 'total_deliveries' => 0, 'success_ratio' => 0.0, 'cancel_ratio' => 0.0, ], ]
Validation and Error Behavior
- Phone input is validated with
^01[3-9][0-9]{8}$. - Service-level errors are returned as arrays with an
errorkey. - Manager-level exceptions are logged and wrapped per courier.
Testing
From package root:
composer install
composer test
Tests use mocked HTTP responses; live courier credentials are not required.
Security Notes
- Do not expose raw courier credentials in logs or frontend output.
- Keep
.envout of version control. - Prefer least-privilege accounts for courier API access.
License
This package is licensed under GPL-3.0-only. See LICENSE.md.
Maintainer
- Author: Rakib Uddin
- GitHub: https://github.com/devrkb21
- Repository: https://github.com/devrkb21/czbd-courier
devrkb21/czbd-courier 适用场景与选型建议
devrkb21/czbd-courier 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 2 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 09 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「fraud detection」 「fraud prevention」 「Order Status」 「paperfly」 「api integration」 「pathao」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 devrkb21/czbd-courier 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 devrkb21/czbd-courier 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 devrkb21/czbd-courier 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Shim repository for phpmd/phpmd
This Extension integrates a credit check and more made by the LEONEX Risk Management Platform into your order process. Extensive configuration and evaluation options is provided in the Platform
Language detection in PSR-15 middleware
Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mob
A fraud detection tool for e-commerce platforms to analyze customer order behavior across Steadfast and Pathao couriers.
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 39
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-only
- 更新时间: 2026-04-09