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.0.tar.gz (8.9 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.0-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for courier_fraud_checker_bd-0.1.0.tar.gz
Algorithm Hash digest
SHA256 873f6004fdfbbb4c3c6c5cb8cde10f6b43155f24b3ed6b59cacb4e4d9ece0348
MD5 71e28a6bd515ea575ca86a498c7b9837
BLAKE2b-256 25725e986e23d887ee2b87b32466a45740250bfdcc797f52df4815f86dc8be9a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for courier_fraud_checker_bd-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 88f5a8deaa814a3c1ed1179ae5f8b3625963749c7e070a59221abbd947a4d51b
MD5 2dbd14e3b07a890ccc4d5ae9a4384779
BLAKE2b-256 5c6aef827ae1cd81e0f9c0db68d3c194ade39f8287b9ddf08c1f7ec3f3567523

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