azmolla/fraud-checker-bd-courier-laravel
最新稳定版本:v0.1.3
Composer 安装命令:
composer require azmolla/fraud-checker-bd-courier-laravel
包简介
A fraud detection tool for e-commerce platforms to analyze customer order behavior across Steadfast, RedX, Pathao, Paperfly, and Carrybee couriers.
关键字:
README 文档
README
🛡️ Fraud-Checker-BD-Courier-Laravel
A powerful Laravel package to analyze customer delivery behavior across top Bangladeshi courier services.
📌 Introduction
E-commerce businesses in Bangladesh often face significant losses due to fraudulent orders and high return rates. Fraud-Checker-BD-Courier-Laravel protects your bottom line by instantly analyzing a customer's track record across major logistics providers (Steadfast, Pathao, RedX, Paperfly, and Carrybee).
By checking a simple phone number, you get immediate insights into a customer's success and cancellation ratios, helping you decide whether to approve, verify, or reject cash-on-delivery (COD) shipments.
🎯 Key Capabilities
- 🔍 Multi-Courier Analytics: Fetch delivery histories simultaneously from Steadfast, Pathao, RedX, Paperfly, and Carrybee.
- 📊 Aggregated Statistics: Get a unified view of total deliveries, successes, cancellations, and percentages.
- 📱 Smart Number Validation: Built-in strictly enforced validation for standard Bangladeshi mobile numbers (e.g.,
017XXXXXXXX). - 📝 Automated Error Logging: Exceptions from any courier service are automatically logged into Laravel's default log file without breaking the main flow.
- 🏗️ SOLID Architecture: Highly decoupled under the hood. You can easily interact with individual couriers thanks to strict contract implementations.
- ⚡ Developer Friendly: Simple Facade access and effortless Laravel integration.
💻 Requirements
- PHP:
^8.2.0 - Laravel:
8.x,9.x,10.x,11.x,12.x, or13.x - Guzzle:
^7.8
📦 Installation
1. Install via Composer:
composer require azmolla/fraud-checker-bd-courier-laravel
2. Publish Configuration File:
php artisan vendor:publish --tag="config"
(This will create a config/fraud-checker-bd-courier.php file in your application directory.)
(Note: Laravel Auto-Discovery is fully supported. If you are using Laravel 5.4 or older, you will need to manually register the Service Provider and Facade in config/app.php.)
🧩 Environment Setup
To authenticate with the respective courier APIs, strictly add your credentials to your application's .env file:
# Pathao Credentials PATHAO_USER="your_pathao_email@example.com" PATHAO_PASSWORD="your_pathao_password" # Steadfast Credentials STEADFAST_USER="your_steadfast_email@example.com" STEADFAST_PASSWORD="your_steadfast_password" # RedX Credentials # Use your registered phone number (without +880, e.g., 01*********) REDX_PHONE="your_redx_login_phone_number" REDX_PASSWORD="your_redx_password" # Paperfly Credentials PAPERFLY_USER="your_paperfly_username" PAPERFLY_PASSWORD="your_paperfly_password" # Carrybee Credentials CARRYBEE_PHONE="your_carrybee_phone" CARRYBEE_PASSWORD="your_carrybee_password"
🚀 Quick Start
Checking a customer's fraud probability is a one-liner using the provided Facade.
use FraudCheckerBdCourier; // Input a standard 11-digit Bangladeshi mobile number $report = FraudCheckerBdCourier::check('01*********'); dump($report);
🖥️ API Response GUI
📈 Structural Response Example
The package returns a highly structured array indicating individual and aggregated network metrics:
[
'steadfast' => ['success' => 3, 'cancel' => 1, 'total' => 4, 'success_ratio' => 75.0],
'pathao' => ['success' => 5, 'cancel' => 2, 'total' => 7, 'success_ratio' => 71.43],
'redx' => ['success' => 20, 'cancel' => 5, 'total' => 25, 'success_ratio' => 80.0],
'paperfly' => ['success' => 0, 'cancel' => 0, 'total' => 1, 'success_ratio' => 0.0],
'carrybee' => ['success' => 10, 'cancel' => 0, 'total' => 10, 'success_ratio' => 100.0],
// The summary across all supported couriers
'aggregate' => [
'total_success' => 38,
'total_cancel' => 8,
'total_deliveries' => 47,
'success_ratio' => 80.85,
'cancel_ratio' => 17.02
]
]
🛠️ Advanced Usage (SOLID Design)
For granular control, the package is architected using SOLID principles. Every courier class adheres to Azmolla\FraudCheckerBdCourier\Contracts\CourierServiceInterface, guaranteeing a uniform getDeliveryStats(string $phoneNumber): array signature.
Instantiating Individual Services
If you only need to run analytics against a single courier, avoid the Facade overhead and use the specific service classes directly:
use Azmolla\FraudCheckerBdCourier\Services\PathaoService; use Azmolla\FraudCheckerBdCourier\Services\SteadfastService; use Azmolla\FraudCheckerBdCourier\Services\RedxService; use Azmolla\FraudCheckerBdCourier\Services\PaperflyService; use Azmolla\FraudCheckerBdCourier\Services\CarrybeeService; $steadfastData = (new SteadfastService())->getDeliveryStats('01*********'); $redxData = (new RedxService())->getDeliveryStats('01*********'); $pathaoData = (new PathaoService())->getDeliveryStats('01*********'); $paperflyData = (new PaperflyService())->getDeliveryStats('01*********'); $carrybeeData = (new CarrybeeService())->getDeliveryStats('01*********');
📱 Phone Validation Helper
Numbers are strictly validated against ^01[3-9][0-9]{8}$ to prevent unnecessary API failures.
- ✅ Valid:
01*********,01876543219 - ❌ Invalid:
+8801*********,1234567890,02171234567
You can manually trigger this validation check:
use Azmolla\FraudCheckerBdCourier\Helpers\CourierDataValidator; CourierDataValidator::checkBdMobile('01*********'); // Throws InvalidArgumentException if formatting fails
🧪 Testing
The package includes an extensive test suite built with orchestra/testbench and phpunit. API calls are safely mocked, meaning you do not need live .env credentials to confidently run tests locally.
composer test # Or if you don't have scripts defined: ./vendor/bin/phpunit
🙏 Acknowledgments
Special thanks to S. Ahmad for the initial inspiration and discovering the API endpoints of Steadfast, Pathao.
💻 Created By
Abiruzzaman Molla
- 📧 Email: abiruzzaman.molla@gmail.com
- 🐙 GitHub Profile: @AbiruzzamanMolla
- 📦 Repository: Fraud-Checker-BD-Courier-Laravel
If you find this package helpful in fighting fraudulent orders, please consider starring the repository! ⭐ I hate arguing. If you have something to contribute or improve, please fork the repository, make your edits, and then submit a pull request.
azmolla/fraud-checker-bd-courier-laravel 适用场景与选型建议
azmolla/fraud-checker-bd-courier-laravel 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 56 次下载、GitHub Stars 达 3, 最近一次更新时间为 2026 年 03 月 07 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「fraud detection」 「fraud prevention」 「Order Status」 「paperfly」 「api integration」 「fraud checker」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 azmolla/fraud-checker-bd-courier-laravel 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 azmolla/fraud-checker-bd-courier-laravel 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 azmolla/fraud-checker-bd-courier-laravel 相关的其它包
同方向 / 同关键字的高下载量 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.
统计信息
- 总下载量: 56
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 41
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2026-03-07
