Skip to main content

Fraud detection tool for e-commerce platforms to analyze customer order behavior across Bangladeshi couriers (Pathao, Steadfast).

Project description

Courier Fraud Checker BD

A fraud detection tool for e-commerce platforms to analyze customer order behavior across Bangladeshi courier services — Pathao and Steadfast.

Check a customer's delivery history (successful deliveries vs. cancellations) to identify potential fraud patterns before accepting orders.

Note: RedX integration is temporarily disabled because RedX recently implemented OTP verification for login, which cannot be automated.

Installation

pip install courier-fraud-checker-bd

Configuration

Set the following environment variables (or create a .env file):

PATHAO_USER=your_pathao_username
PATHAO_PASSWORD=your_pathao_password
STEADFAST_USER=your_steadfast_email
STEADFAST_PASSWORD=your_steadfast_password

Usage

Check all couriers at once

from courier_fraud_checker_bd import CourierFraudChecker

checker = CourierFraudChecker()
result = checker.check("01712345678")
print(result)
# {
#     "steadfast": {"success": 15, "cancel": 2, "total": 17},
#     "pathao": {"success": 8, "cancel": 1, "total": 9},
# }

Check a single courier

result = checker.check_pathao("01712345678")
result = checker.check_steadfast("01712345678")

Pass credentials directly

checker = CourierFraudChecker(config={
    "pathao": {"user": "your_username", "password": "your_password"},
    "steadfast": {"user": "your_email", "password": "your_password"},
})

Use individual services

from courier_fraud_checker_bd.services import PathaoService, SteadfastService

pathao = PathaoService(username="...", password="...")
result = pathao.check("01712345678")

steadfast = SteadfastService(email="...", password="...")
result = steadfast.check("01712345678")

Quick one-liner

from courier_fraud_checker_bd import check

result = check("01712345678")

Response Format

Each courier returns the same structure:

{
    "success": 15,   # Successful deliveries
    "cancel": 2,     # Cancelled/failed deliveries
    "total": 17      # Total deliveries
}

On error, the dict will contain an "error" key with a message:

{"error": "Failed to authenticate with Pathao"}

Phone Number Format

Phone numbers must be in local Bangladeshi format: 11 digits starting with 01.

  • Valid: 01712345678
  • Invalid: +8801712345678, 1712345678

License

GPL-3.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

courier_fraud_checker_bd-1.0.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

courier_fraud_checker_bd-1.0.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file courier_fraud_checker_bd-1.0.0.tar.gz.

File metadata

File hashes

Hashes for courier_fraud_checker_bd-1.0.0.tar.gz
Algorithm Hash digest
SHA256 fa0a7164085a958006b7f542c1b428cca54ffd704a6778425f2ab122f787c541
MD5 09873d85bc6e0f737c93910bfd09d512
BLAKE2b-256 d6ed4d6935d5fc96fadab4167aeda73ae9cd31086a584e2cbe1bdcec20951357

See more details on using hashes here.

File details

Details for the file courier_fraud_checker_bd-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for courier_fraud_checker_bd-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a876c1e9878d32b979bb6b3e9da1131f047d1cfd5ddf1e06e6abff4bc8171f2
MD5 f244e44828c0ca288aba5f39d87b034c
BLAKE2b-256 55d918a53b24a57866bad996f5a5455e7f4905b8110bf6891011bbcd9db6b97b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page