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-0.0.1.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-0.0.1-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for courier_fraud_checker_bd-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f8796111d20288a4f5261d1498500fb2c0795db71df191d41df133ec2ea1ec21
MD5 95c8b52a2dc8785075ead25e11deb00e
BLAKE2b-256 44bcaf76fff73a2977456327578b1670fc32a02dc9197e21648fbdf2797d4bb5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for courier_fraud_checker_bd-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2bd7706da7c3fd9a10e4e6028887a2781964a2a913a1805ae7371e85f794228f
MD5 2b9caf5360625886f2ace7733f9789a3
BLAKE2b-256 47fc05188eedefae2c975549cba468ad1d90e91f66d4e4cad7edf2582dfa341b

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