shahariar-ahmad/courier-fraud-checker-bd
A Laravel package to detect potential fraudulent orders by checking customer delivery behavior through Pathao and Steadfast courier services in Bangladesh.
composer require shahariar-ahmad/courier-fraud-checker-bd
In config/app.php:
'providers' => [
ShahariarAhmad\CourierFraudCheckerBd\CourierFraudCheckerBdServiceProvider::class,
],
In config/app.php:
'aliases' => [
'CourierFraudCheckerBd' => ShahariarAhmad\CourierFraudCheckerBd\Facade\CourierFraudCheckerBd::class,
],
Add these environment variables to your .env file:
# Pathao Credentials
PATHAO_USER=your_pathao_email
PATHAO_PASSWORD=your_pathao_password
# Steadfast Credentials
STEADFAST_USER=your_steadfast_email
STEADFAST_PASSWORD=your_steadfast_password
use CourierFraudCheckerBd;
$result = CourierFraudCheckerBd::check('01886607475');
print_r($result);
Output:
[
'pathao' => ['success' => 5, 'cancel' => 2, 'total' => 7],
'steadfast' => ['success' => 3, 'cancel' => 1, 'total' => 4]
]
The package automatically validates phone numbers with this regex:
/^01[3-9][0-9]{8}$/
โ Valid examples:
0171234567801876543219โ Invalid examples:
+8801712345678 (includes country code)1234567890 (too short)02171234567 (invalid prefix)use ShahariarAhmad\CourierFraudCheckerBd\Services\PathaoService;
use ShahariarAhmad\CourierFraudCheckerBd\Services\SteadfastService;
$pathao = (new PathaoService())->pathao('01712345678');
$steadfast = (new SteadfastService())->steadfast('01712345678');
use ShahariarAhmad\CourierFraudCheckerBd\Helpers\CourierFraudCheckerHelper;
CourierFraudCheckerHelper::validatePhoneNumber('01712345678');
Missing Environment Variables
.envphp artisan config:clear after updatingInvalid Phone Number Format
01712345678+88 prefixThis package is open-source software licensed under the GNU General Public License v3.0 (GPL-3.0).
Under this license:
โ You are allowed to:
โ You are NOT allowed to:
Important:
If you distribute modified versions of this package, you must also release your changes under the GPL-3.0 license and include the original copyright.
GPL-3.0 promotes freedom to use, share, and modify, but ensures that any distributed version remains free and open-source.
For issues and feature requests:
How can I help you explore Laravel packages today?