npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

fake-order-detector

v1.0.2

Published

A React component library for detecting fake orders in e-commerce applications with Bangladeshi payment gateway integration.

Readme

Fake Order Detector

A React component library for detecting fake orders in e-commerce applications with Bangladeshi payment gateway integration.

Features

  • 🛡️ Advanced Detection Logic: Rule-based algorithm analyzing multiple factors
  • 🇧🇩 Bangladeshi Payment Gateways: Integration with bKash, Nagad, Rocket, and more
  • 📱 Phone Validation: Validates Bangladeshi phone number patterns
  • 📊 Analytics Dashboard: Comprehensive insights and statistics
  • 📝 Order History: Track and manage analyzed orders
  • 🎨 Modern UI: Beautiful, responsive interface with Tailwind CSS
  • TypeScript: Full type safety and excellent developer experience

Installation

npm install fake-order-detector

Quick Start

import React from "react";
import { FakeOrderDetector } from "fake-order-detector";

function App() {
  return (
    <div>
      <FakeOrderDetector
        onOrderAnalyzed={(order, result) => {
          console.log("Order analyzed:", order, result);
        }}
      />
    </div>
  );
}

Components

FakeOrderDetector

The main component that provides a complete interface for order detection.

import { FakeOrderDetector } from "fake-order-detector";

<FakeOrderDetector
  className="custom-class"
  showNavigation={true}
  defaultTab="detector"
  onOrderAnalyzed={(order, result) => {
    // Handle analyzed order
  }}
  storageKey="my_custom_storage_key"
/>;

Individual Components

You can also use individual components:

import {
  OrderForm,
  DetectionResult,
  OrderHistory,
  AdminDashboard
} from 'fake-order-detector';

// Use components individually
<OrderForm onSubmit={handleSubmit} />
<DetectionResult result={result} onNewOrder={handleNewOrder} />
<OrderHistory orders={orders} onOrdersChange={handleChange} />
<AdminDashboard orders={orders} />

Hooks

useFakeOrderDetector

A custom hook for managing detection functionality:

import { useFakeOrderDetector } from "fake-order-detector";

function MyComponent() {
  const {
    orders,
    isAnalyzing,
    lastResult,
    analyzeOrder,
    removeOrder,
    clearAllOrders,
    analytics,
  } = useFakeOrderDetector();

  const handleAnalyze = async () => {
    const { order, result } = await analyzeOrder({
      customerName: "John Doe",
      phoneNumber: "01712345678",
      address: "Dhaka, Bangladesh",
      paymentMethod: "COD",
    });

    console.log("Analysis complete:", result);
  };

  return (
    <div>
      <button onClick={handleAnalyze} disabled={isAnalyzing}>
        {isAnalyzing ? "Analyzing..." : "Analyze Order"}
      </button>

      <div>Total Orders: {analytics.totalOrders}</div>
      <div>Fake Percentage: {analytics.fakePercentage}%</div>
    </div>
  );
}

Utilities

Detection Logic

Use the detection logic directly:

import { detectFakeOrder } from "fake-order-detector";

const result = detectFakeOrder(
  "Customer Name",
  "01712345678",
  "Complete Address",
  "COD",
  [] // Previous orders for pattern analysis
);

console.log(result);
// {
//   status: 'Genuine' | 'Fake',
//   riskScore: 25,
//   reasons: ['Valid phone number detected', ...],
//   confidence: 85,
//   gatewayAnalysis: { ... }
// }

Storage Utilities

Manage order storage:

import {
  saveOrder,
  getOrders,
  deleteOrder,
  clearOrders,
} from "fake-order-detector";

// Save an order
saveOrder(orderObject);

// Get all orders
const orders = getOrders();

// Delete specific order
deleteOrder("order_id");

// Clear all orders
clearOrders();

Types

import type {
  Order,
  DetectionResultType,
  Analytics,
} from "fake-order-detector";

interface Order {
  id: string;
  customerName: string;
  phoneNumber: string;
  address: string;
  paymentMethod: "COD" | "Prepaid";
  timestamp: Date;
  status: "Genuine" | "Fake";
  riskScore: number;
  detectionReasons: string[];
}

Detection Algorithm

The detection algorithm analyzes:

  • Payment Gateway Performance: Access rates, cancellation rates, success rates
  • Phone Number Validation: Bangladeshi operator patterns (GP, Robi, Banglalink, etc.)
  • Address Analysis: City validation, completeness, suspicious keywords
  • Pattern Recognition: Duplicate orders, frequency analysis
  • Risk Scoring: Comprehensive scoring based on multiple factors

Bangladeshi Payment Gateways Supported

  • bKash (95.2% access rate, 12.8% cancellation rate)
  • Nagad (92.5% access rate, 15.3% cancellation rate)
  • Rocket (88.7% access rate, 18.2% cancellation rate)
  • Upay (85.3% access rate, 22.1% cancellation rate)
  • SSLCommerz (93.8% access rate, 11.5% cancellation rate)
  • AamarPay (90.1% access rate, 16.7% cancellation rate)
  • PortWallet (82.4% access rate, 25.6% cancellation rate)

Styling

The package uses Tailwind CSS. Make sure to include Tailwind in your project:

npm install tailwindcss

Or include the Tailwind CDN in your HTML:

<script src="https://cdn.tailwindcss.com"></script>

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT © [Alam Hossain]

Support

For support, email [email protected] or create an issue on GitHub.

fake-order-detector