Skip to main content

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

Project description

Courier Fraud Checker BD

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

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

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
REDX_PHONE=your_redx_phone
REDX_PASSWORD=your_redx_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},
#     "redx": {"success": 5, "cancel": 0, "total": 5},
# }

Check a single courier

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

Pass credentials directly

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

Use individual services

from courier_fraud_checker_bd.services import PathaoService, SteadfastService, RedxService

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

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

redx = RedxService(phone="01XXXXXXXXX", password="...")
result = redx.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-0.1.1.tar.gz (8.8 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-0.1.1-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for courier_fraud_checker_bd-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0c4fed98b6dee0d75248567e403ff886e4605676ced8641cd75e1c5db1181b57
MD5 9582b2b726c1b2df6a0c76b173faaada
BLAKE2b-256 4d0191cff3f88f86c1467216c90b172eed4a3bd8f37f3ec7a690f605c4934984

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for courier_fraud_checker_bd-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1c293b447b8fe1893cf78df05a604d985d02feafbf64bcc00e1896ad0e5b7e24
MD5 38de40b98bc59189a827cd3272d44230
BLAKE2b-256 1dee6d92331975016ef83ae8aef55f5bd06cd200fd112cee3bf50d17f4a0c1a4

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