McTaba Labs logo
Software EngineeringThe WhiteboardProjectsEventsMasterclassesWebinarsLearn
Book Call

500+ developers already in the community

Get answers, find accountability partners, and stay ahead

Join Discord →
McTaba Labs logo

Educating 1 million students in tech by 2030.

Programs

  • HighSchool Graduates Launchpad
  • AI & Business Automation
  • Corporate Training
  • McTaba Story & Mission
  • Full-Stack Curriculum
  • Course Pricing & Plans
  • Frequently Asked Questions

Resources

  • Join Discord Community
  • Tech Events in Nairobi
  • Masterclasses
  • Free Resources
  • Learn
  • Campus
  • Africa Tech Talent Report
  • Partner With Us
  • Start a Project
  • Our Work

Contact Us

  • 124 Manyani East Road, Lavington, Nairobi
  • +254727795603
  • Book a Discovery Call

Office Hours:

Mon-Fri: 9am - 2pm EAT

Sat: 10am - 12pm EAT

© 2027 McTaba Labs - A product of Edtech Industries. All rights reserved.

Privacy PolicyTerms of ServiceRefund Policy
  1. Learn
  2. Paystack for African Developers
  3. Fraud Detection Signals with Machine Learning on Payment Data
Bonaventure OgetoBy Bonaventure Ogeto|Updated July 22, 2026

Fraud Detection Signals with Machine Learning on Payment Data

Key fraud signals computable from Paystack data: 1) Velocity — more than N successful transactions from the same card or email in 1 hour. 2) BIN mismatch — card BIN (first 6 digits) country differs from customer's stated country (Paystack returns authorization.country_code). 3) Amount anomaly — large round amounts from first-time customers. 4) Email pattern — disposable email domains. 5) Time-of-day spike — unusual volume at 2-4am local time. These signals feed a risk score. Flag for human review at a threshold; do not auto-block. False positives cost real customers real money.

Computing Fraud Signals from Paystack Data

Paystack transaction data fields useful for fraud detection:

SignalPaystack FieldWhat to ComputeRisk Indicator
Velocitycustomer.email, paid_atCount transactions from same email in last 1 hour> 3 attempts in 1 hour = high risk
BIN mismatchauthorization.bin, authorization.country_code, customer metadataCompare card-issuing country to customer countryMismatch on first-time customer = medium risk
Amount anomalyamount, customer historyCompare amount to customer's average transaction> 5× average from first-time customer = medium risk
Round amountamountIs amount divisible by 10,000 (kobo)?Large round amounts from new customers = low-medium risk
Email patterncustomer.emailCheck domain against disposable email listDisposable domain = medium risk
Card reuseauthorization.signatureCount distinct customers using same card signature> 2 customers on same card = high risk
// Risk scorer — computes a score from Paystack transaction data
async function scoreTransaction(txn) {
  var signals = [];
  var score = 0;

  // Velocity: count same email in last hour
  var recentCount = await db.transactions.countByEmailInHour(txn.customer.email);
  if (recentCount > 3) { signals.push('high_velocity'); score += 40; }
  else if (recentCount > 1) { signals.push('moderate_velocity'); score += 15; }

  // BIN mismatch: card country vs customer country
  var cardCountry = txn.authorization?.country_code;
  var customerCountry = txn.metadata?.customer_country;
  if (cardCountry && customerCountry && cardCountry !== customerCountry) {
    signals.push('bin_country_mismatch'); score += 20;
  }

  // Card reuse across multiple customers
  var cardCustomers = await db.transactions.countCustomersByCardSignature(txn.authorization?.signature);
  if (cardCustomers > 2) { signals.push('card_shared_across_customers'); score += 50; }

  // Disposable email
  var disposableDomains = ['mailinator.com', 'guerrillamail.com', 'temp-mail.org'];
  if (disposableDomains.some(d => txn.customer.email.endsWith('@' + d))) {
    signals.push('disposable_email'); score += 25;
  }

  return { score, signals, action: score >= 60 ? 'review' : score >= 30 ? 'monitor' : 'allow' };
}

Learn More

See AI-assisted reconciliation for the broader AI in financial operations context.

Sign up for the McTaba newsletter

Key Takeaways

  • ✓Fraud signals are inputs to a risk score — not triggers for automatic blocks.
  • ✓Velocity, BIN mismatch, amount anomaly, email pattern, and time-of-day spike are the core signals from Paystack data.
  • ✓Paystack returns authorization.country_code and authorization.bin — use these for BIN-country mismatch.
  • ✓False positives in fraud detection block legitimate customers — tune thresholds conservatively.
  • ✓All fraud flags should route to human review before action, not auto-block.

Frequently Asked Questions

Does Paystack have its own fraud detection?
Yes — Paystack has built-in fraud screening that declines high-risk transactions before they reach you. Your application-level fraud detection is an additional layer for business-specific patterns that Paystack's general system may not catch: your specific customer base behavior, known bad actors from your own data, or industry-specific fraud patterns. The two layers are complementary, not alternatives.
What should I do when a transaction is flagged as high risk?
Route it to a human fraud analyst for review before taking action. Possible outcomes: allow (false positive), request additional verification from the customer (ID or OTP), or refund and blacklist. Never auto-block based on a risk score alone — false positive rates of even 1% mean blocking legitimate customers regularly. Build a review queue with clear SLAs so fraud decisions are made promptly.
Can an LLM help with fraud detection beyond rule-based scoring?
Yes — an LLM can analyze a cluster of flagged transactions and identify patterns your rule-based system missed. Feed it the flagged transaction data (not raw customer PII) and ask: "Are there common patterns across these flagged transactions?" It can surface non-obvious correlations. But keep the LLM in an analysis role — the actual block/allow decision should be made by a human fraud analyst, not the LLM.

Learn Paystack Integration

KES 2,999

The definitive guide to building payment systems with Paystack — from your first transaction to production-grade payment infrastructure across Africa. 9 modules, 47 lessons. Free preview available.

Start Paystack Course

Not ready? Create Free Account

Keep reading

Paystack AI Agents and the MCP Server: The Complete Guide

A comprehensive guide to building AI agents that interact with Paystack through the Model Context Protocol (MCP) server. Covers connecting the MCP server to Claude Code, querying transactions with natural language, building payment support chatbots, AI-assisted reconciliation, agentic payouts with safety rails, secret key security, human-in-the-loop design, prompt injection risks, and audit trails for AI-initiated financial actions.

Read more

RAG Over Your Payment Documentation and Transaction History

RAG lets an LLM answer questions grounded in your actual Paystack docs and transaction history instead of its training data. "What does this error code mean?" retrieves from your embedded docs. "What happened to transaction X?" retrieves from your transaction store.

Read more

Why You Should Never Give an LLM Your Paystack Secret Key

Your Paystack secret key can initialize transactions, trigger transfers, and access all your transaction data. Giving it to an LLM — even once — creates risks that do not go away when you close the chat window.

Read more

Building a Voice Agent That Collects Payment

A customer calls your number. They say what they want to pay for. The voice agent creates a Paystack payment link and texts it to their phone. No human operator needed. Here is how to build it.

Read more

Build Paystack Subscriptions in iOS with Swift

Add Paystack subscription billing to an iOS app built with Swift. This guide covers the subscription checkout flow, checking subscription status from your backend, displaying plan information in SwiftUI, and handling cancellation.

Read more

Explore related topics

M-Pesa & African Stack

M-Pesa Daraja API tutorials, USSD development, and WhatsApp Business API guides. The African Stack that global bootcamps do not teach.

Learn to Code in Kenya

Everything a Kenyan needs to know before writing their first line of code. Career paths, real costs, hardware requirements, and honest answers about what it takes.

Learning to Code

Roadmaps, language guides, and practical advice for learning to code and launching a programming career.

Breaking Into Tech

Practical, no-nonsense guides for anyone looking to start or change their career in tech. From choosing your first language to acing interviews.

The African Stack: Skills for This Market

The skills that make Kenyan developers hard to replace: M-Pesa, USSD, WhatsApp, fintech, and building for the African market.

Bonaventure Ogeto

Bonaventure Ogeto

Founder, McTaba Labs

Bonaventure is the founder of McTaba Labs, a coding bootcamp in Nairobi, Kenya. He has spent years building products for the African market and mentoring the next generation of developers across the continent.