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. Why Paystack Means You Should Never Touch Card Data
Bonaventure OgetoBy Bonaventure Ogeto|Updated July 22, 2026

Why Paystack Means You Should Never Touch Card Data

When you use Paystack Inline or the Paystack Popup, the customer enters card details on a Paystack-hosted form. Those details are tokenized in the customer's browser and sent directly to Paystack's servers — they never pass through your backend. You only receive an authorization_code, not the card number. Never build a custom card form that collects card numbers and posts them to your own server.

In this article

  1. 1. How Paystack Keeps Card Data Off Your Servers
  2. 2. PCI DSS Scope Reduction
  3. 3. Learn More

How Paystack Keeps Card Data Off Your Servers

When a customer pays on your site using Paystack Inline:

  1. The Paystack JavaScript widget renders a secure iframe
  2. The customer types their card number into the iframe — your code cannot read this input
  3. Paystack's code tokenizes the card and sends it directly to Paystack's servers over TLS
  4. Your server receives a callback/webhook with a reference and authorization_code — not the card number

Your backend never touches the card number. It is technically impossible for your server to accidentally log or store it through the normal Paystack flow.

// WRONG — do not build your own card form
// This takes card data through your server
app.post('/charge-card', async (req, res) => {
  var { cardNumber, cvv, expiryMonth, expiryYear } = req.body; // NEVER DO THIS
});

// RIGHT — let Paystack handle card input
// Your backend only receives the reference after checkout
app.post('/webhook', async (req, res) => {
  var event = req.body;
  if (event.event === 'charge.success') {
    var reference = event.data.reference; // Safe to store
    var last4 = event.data.authorization.last4; // Safe to store for display
    var authCode = event.data.authorization.authorization_code; // Safe to store for re-use
    // No card number here — ever
  }
});

PCI DSS Scope Reduction

PCI DSS (Payment Card Industry Data Security Standard) is a set of security requirements for organizations that handle card data. Compliance is tiered:

  • SAQ A — Lightest. All card processing outsourced to a compliant provider. Your site just redirects to their checkout. This is where Paystack puts you.
  • SAQ A-EP — Your page loads scripts that touch card data (e.g., custom Inline implementation). Heavier requirements.
  • SAQ D — Heaviest. You store, process, or transmit card data. Requires full annual audit.

By never touching card data and using Paystack's hosted or inline checkout, you remain in SAQ A — the simplest compliance tier, achievable with a self-assessment questionnaire.

Get weekly developer tips

Join 25,000+ developers. Practical guides, job tips, and new content — straight to your inbox.

No spam. Unsubscribe anytime.

Learn More

This guide is part of the Paystack security and PCI compliance guide.

Sign up for the McTaba newsletter

Key Takeaways

  • ✓Paystack handles all card number input, tokenization, and transmission — you never see the raw PAN.
  • ✓The authorization_code you receive is a safe token, not a card number. Store it for recurring charges.
  • ✓Never build a custom HTML form that POSTs card numbers to your server — this puts you in scope for PCI DSS SAQ D.
  • ✓Using Paystack Inline/Popup reduces your PCI scope to SAQ A (the lightest compliance level).
  • ✓If you are collecting card data in any way — even "temporarily" — stop and redesign the flow using Paystack's hosted checkout.
  • ✓The last4 and bin fields in Paystack responses are safe to store for display purposes — they are not the full card number.

Frequently Asked Questions

Is it safe to store the authorization_code in my database?
Yes. The authorization_code is a safe, tokenized representation of the card. It is not the card number. Store it encrypted in your database for recurring charges. It is already useless without your Paystack secret key, but encryption adds an extra layer.
What if my mobile app needs to accept card payments without leaving the app?
Use Paystack's mobile SDK (for iOS and Android) or the official React Native/Flutter packages. These embed a secure card capture form that handles tokenization in the mobile environment. Still no raw card data passes through your backend.
Can I build a custom-styled checkout with Paystack without handling card data?
Yes. Use the Paystack Charge API with Paystack Inline JavaScript. You can style the form container, but the actual card input fields are rendered in a Paystack-controlled iframe. This keeps you in SAQ A scope while having a custom-looking checkout.
What happens if I accidentally log a card number in my server logs?
Treat it as a security incident. Immediately rotate your Paystack keys. Purge the affected logs. Notify Paystack and your payment processor. Check if the log files were accessed. Depending on your country and the card networks involved, you may have a regulatory notification obligation.

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 Security, Keys and PCI Compliance: Complete Guide

A complete security reference for Paystack integrations. Covers API key types and rotation, secure key storage, PCI DSS compliance scope, price tampering prevention, webhook replay attacks, rate limiting, fraud signals, and logging without exposing secrets.

Read more

Never Commit Your Paystack Key: Detection and Remediation

Committing a Paystack secret key to version control is one of the most common and most dangerous mistakes in payment integrations. This guide shows you how to detect committed keys, set up automated prevention with pre-commit hooks, and remediate the damage when a key does slip through.

Read more

Replay Attacks on Paystack Webhooks

A replay attack captures a legitimate Paystack webhook and sends it to your server again. The signature is valid because the payload is unchanged. Without idempotency checks, your server processes the same payment twice, granting double value to the attacker. This guide shows how to defend against replays.

Read more

Logging Payments Without Logging Secrets

Good payment logging helps you debug failed charges and reconcile transactions. Bad payment logging leaks your Paystack secret key, card tokens, or customer data into log files that attackers can read. This guide draws a clear line between safe and dangerous payment log data.

Read more

Paystack Rate Limit and 429 Handling

Paystack returns 429 Too Many Requests when you exceed their API rate limit. This guide covers the actual limits, how to implement exponential backoff, when to cache responses, and how to batch operations to avoid hitting the limit.

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.