refatbd/bd-courier-fraud-checker

Check for fraudulent customers using Bangladeshi courier data.

Maintainers

Package info

github.com/refatbd/bd-courier-fraud-checker

pkg:composer/refatbd/bd-courier-fraud-checker

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.1.2 2026-05-05 11:01 UTC

This package is auto-updated.

Last update: 2026-05-05 12:05:31 UTC


README

A Laravel package to detect fraudulent customers using Bangladeshi courier data (Steadfast, Pathao, Redx).

Maintained by refatbd

Installation

composer require refatbd/bd-courier-fraud-checker

Publish Config

php artisan vendor:publish --tag=bdcourierfraudchecker-config

Environment Variables

Add these to your .env file:

# Steadfast
STEADFAST_USER=your_email@example.com
STEADFAST_PASSWORD=your_password

# Pathao
PATHAO_USER=your_email@example.com
PATHAO_PASSWORD=your_password

# Redx
REDX_PHONE=01XXXXXXXXX
REDX_PASSWORD=your_password

Usage

use Refatbd\BdCourierFraudChecker\Facade\BdCourierFraudChecker;

$result = BdCourierFraudChecker::check('01XXXXXXXXX');

Response Format

[
    'steadfast' => [
        'status' => true,
        'message' => 'Successful.',
        'data' => [
            'success'             => 45,
            'cancel'              => 5,
            'total'               => 50,
            'deliveredPercentage' => 90.0,
            'returnPercentage'    => 10.0,
        ],
    ],
    'pathao' => [ ... ],
    'redx'   => [ ... ],
]

Supported Couriers

Courier Status
Steadfast
Pathao
Redx

More couriers can be added easily — see Adding a New Courier.

Adding a New Courier

  1. Create a new class in src/Courier/YourCourier.php:
<?php

namespace Refatbd\BdCourierFraudChecker\Courier;

use Refatbd\BdCourierFraudChecker\Traits\Helpers;

class YourCourier
{
    use Helpers;

    public function __construct()
    {
        $this->checkRequiredConfig(['your_courier_user', 'your_courier_password']);
    }

    public function check($phoneNumber)
    {
        $phoneNumber = $this->validateBDPhoneNumber($phoneNumber);
        // Add your API logic here
        return [
            'status'  => true,
            'message' => 'Successful.',
            'data'    => [],
        ];
    }
}
  1. Add credentials to config/bdcourierfraudchecker.php:
"your_courier_user"     => env("YOUR_COURIER_USER", ""),
"your_courier_password" => env("YOUR_COURIER_PASSWORD", ""),
  1. Inject it into CourierCheckerService and add to the check() return array.

  2. Bind it in BdCourierFraudCheckerServiceProvider.

License

MIT