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. Paystack Redirect Checkout vs Inline Checkout: Choosing Correctly
Bonaventure OgetoBy Bonaventure Ogeto|Updated July 20, 2026

Paystack Redirect Checkout vs Inline Checkout: Choosing Correctly

Redirect checkout sends the customer to checkout.paystack.com and brings them back to your callback URL after payment. Inline checkout opens a popup iframe on your page using PaystackPop. Choose redirect for simpler implementation and better mobile browser compatibility. Choose inline for a seamless on-site experience. Both are equally secure and support the same payment channels.

In this article

  1. 1. How Redirect Checkout Works
  2. 2. How Inline Checkout Works
  3. 3. When to Use Redirect Checkout
  4. 4. When to Use Inline Checkout
  5. 5. Security Comparison
  6. 6. Mobile Browser Considerations
  7. 7. Handling Post-Payment in Both Approaches
  8. 8. Stay Up to Date

How Redirect Checkout Works

Redirect checkout is the simplest path. Your server initializes the transaction, gets back an authorization_url, and your frontend sends the customer there. The customer leaves your site entirely, completes payment on Paystack's hosted page, and Paystack redirects them back to your callback_url with the reference as a query parameter.

// Server: initialize the transaction
app.post('/api/pay', async function(req, res) {
  var response = await fetch('https://api.paystack.co/transaction/initialize', {
    method: 'POST',
    headers: {
      Authorization: 'Bearer ' + process.env.PAYSTACK_SECRET_KEY,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      email: req.body.email,
      amount: req.body.amount * 100,
      callback_url: 'https://yoursite.com/payment/callback',
    }),
  });

  var data = await response.json();
  // Send the authorization URL to the frontend
  res.json({ url: data.data.authorization_url });
});

// Frontend: redirect the customer
fetch('/api/pay', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ email: email, amount: amount }),
})
.then(function(res) { return res.json(); })
.then(function(data) {
  window.location.href = data.url;
});

After payment, the customer lands on https://yoursite.com/payment/callback?trxref=REF&reference=REF. Your server reads the reference, calls the Paystack verify endpoint, and grants value if the payment succeeded.

The entire frontend code is one line: window.location.href = url. No JavaScript library to load, no popup to manage, no iframe to worry about.

How Inline Checkout Works

Inline checkout opens the Paystack checkout form in a popup iframe on your page. The customer sees the checkout overlaid on top of your site. When they finish, you get a JavaScript callback instead of a page redirect.

<script src="https://js.paystack.co/v2/inline.js"></script>

<script>
  async function payInline() {
    // Step 1: Get access code from your server
    var response = await fetch('/api/pay', {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({ email: email, amount: amount }),
    });
    var data = await response.json();

    // Step 2: Open the popup
    var popup = new PaystackPop();
    popup.checkout({
      accessCode: data.access_code,
      onSuccess: function(transaction) {
        // Step 3: Verify on your server
        verifyPayment(transaction.reference);
      },
      onCancel: function() {
        console.log('Customer closed the popup');
      },
    });
  }
</script>

The customer stays on your page throughout. The Paystack checkout form appears as a modal overlay. When the customer completes payment, the popup closes and your onSuccess function runs with the transaction reference. You then verify server-side.

This requires loading the Paystack Inline.js script, initializing the transaction on your server (to get the access code), and handling two callbacks (success and cancel). It is more code than redirect, but the customer never leaves your domain visually.

Get weekly developer tips

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

No spam. Unsubscribe anytime.

When to Use Redirect Checkout

Redirect checkout is the better choice in these situations:

Mobile-first applications

Mobile browsers handle popup iframes inconsistently. Some browsers block them. Others render them at awkward sizes. Some interfere with keyboard input when the customer types card numbers. Redirect checkout avoids all of these issues because the customer is on a full-page Paystack checkout designed for mobile screens.

Server-rendered applications

If you are building with a server-rendered framework (plain Express with EJS templates, Django, Laravel, Rails), redirect checkout fits naturally. You do not need to add a JavaScript build step or load a client-side library. The server generates the authorization URL and returns a redirect response.

Minimal frontend code

If you want the simplest possible integration with the least frontend JavaScript, redirect checkout wins. There is no library to load, no popup state to manage, and no callback functions to wire up.

Regulatory or compliance requirements

Some compliance frameworks prefer that the payment page is clearly on the payment processor's domain. Redirect checkout makes this obvious to the customer: they can see "checkout.paystack.com" in the browser address bar.

When to Use Inline Checkout

Inline checkout is the better choice in these situations:

Single-page applications (SPAs)

If you are building a React, Vue, or Angular app where the entire experience happens on one page, a full-page redirect breaks the flow. The customer leaves your app, pays, and then has to reload your entire SPA when they return. Inline checkout keeps them in the app.

Checkout conversion optimization

When the customer stays on your site, the visual continuity can reduce drop-off. They see your branding in the background. The checkout feels like part of your purchase flow rather than a handoff to a third party. For established brands where the customer already trusts the site, this can improve completion rates.

Post-payment user experience

With inline checkout, you get a JavaScript callback the instant payment completes. You can update the UI immediately: show a success animation, clear the cart, redirect to a confirmation page, or trigger a download. With redirect checkout, the customer waits for a page load after being redirected back.

Multi-step checkout flows

If payment is one step in a longer flow (like a wizard with shipping, review, payment, and confirmation steps), inline checkout lets you keep the customer in the wizard. After payment, you advance them to the confirmation step without a page reload.

Security Comparison

Both approaches are equally secure. Here is why:

  • Card data handling: In both cases, the customer enters card details on a Paystack-controlled form. Your server and frontend never see card numbers, CVVs, or PINs. Paystack handles PCI compliance.
  • Transaction initialization: Both require server-side initialization with your secret key. The amount and parameters are locked on the server. The customer cannot modify them.
  • Verification: Both require server-side verification after payment. You call GET /transaction/verify/{reference} to confirm the payment before granting value.
  • Webhook support: Both receive the same charge.success webhook from Paystack. Webhooks are the authoritative confirmation and do not depend on the checkout method.

The inline popup runs in a sandboxed iframe on Paystack's domain. Your page cannot read anything inside that iframe (card numbers, OTPs, etc.) due to browser same-origin policy. The iframe communicates with your page only through the structured callback messages (success, cancel).

One nuance: if you are using the v2 inline library with the newTransaction method (passing amount and key directly in the frontend instead of using an access code), a technically skilled customer could modify the amount in the browser console before the popup opens. Always use the access code pattern for production, where the amount is locked server-side. See why you must never call the Paystack API from your frontend for more detail.

Mobile Browser Considerations

Mobile is where the two approaches diverge most in practice.

Redirect on mobile: Works reliably. The customer gets a full-screen Paystack checkout optimized for mobile. Keyboard input, 3DS challenge screens, and bank OTP pages all render at full width. After payment, the customer is redirected back to your callback URL and your mobile-responsive page loads.

Inline on mobile: Can be problematic. The popup iframe may not render at the correct size. On some Android browsers, the keyboard pushes the iframe content out of view when the customer types. iOS Safari sometimes blocks third-party iframes or cookies, which can interfere with the checkout session. 3DS challenge pages that open in a new tab may lose the connection back to the popup.

If your audience is primarily mobile (which is the majority in most African markets), redirect checkout is the safer default. If you want inline checkout on desktop but reliable behavior on mobile, detect the device and switch approaches:

function isMobile() {
  return /Android|iPhone|iPad|iPod/i.test(navigator.userAgent);
}

async function handlePayment() {
  var response = await fetch('/api/pay', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({ email: email, amount: amount }),
  });
  var data = await response.json();

  if (isMobile()) {
    // Redirect on mobile
    window.location.href = data.authorization_url;
  } else {
    // Popup on desktop
    var popup = new PaystackPop();
    popup.checkout({
      accessCode: data.access_code,
      onSuccess: function(tx) { verifyPayment(tx.reference); },
      onCancel: function() { console.log('Cancelled'); },
    });
  }
}

This gives you the best of both worlds: seamless inline checkout on desktop and reliable redirect checkout on mobile.

Handling Post-Payment in Both Approaches

Regardless of which approach you use, the post-payment logic is the same: verify the transaction server-side, then grant value. The difference is how you trigger that verification.

After redirect checkout: The customer lands on your callback URL with a reference query parameter. Your server reads it, calls verify, and renders the appropriate page.

After inline checkout: Your onSuccess callback fires with the transaction object. You send the reference to your server (via fetch or by redirecting to a verification page), your server calls verify, and you update the UI.

In both cases, the webhook may arrive before or after the redirect/callback. Your fulfillment logic should be idempotent: if the webhook already fulfilled the order, the redirect/callback verification should see that and skip re-fulfillment. If the redirect/callback fulfilled first, the webhook handler should see that and skip.

For more on handling the race between webhooks and callbacks, see the complete accepting payments guide.

Stay Up to Date

Paystack updates their checkout experience periodically, including changes to how the inline popup renders and new features for the redirect checkout page.

Sign up for the McTaba newsletter to stay informed about Paystack integration changes.

Key Takeaways

  • ✓Redirect checkout takes the customer to Paystack's domain. Inline checkout opens a popup iframe on your page. Both use the same Paystack checkout form under the hood.
  • ✓Redirect checkout is simpler to implement: one redirect, one callback handler. No JavaScript library needed on the frontend.
  • ✓Inline checkout keeps the customer visually on your site, which can improve perceived trust for brands the customer already knows.
  • ✓On mobile browsers, redirect checkout tends to be more reliable. Some mobile browsers handle popup iframes inconsistently.
  • ✓Both approaches require server-side transaction initialization and server-side verification. The security model is identical.
  • ✓You can offer both in the same application. Use inline for desktop web and redirect for mobile, or let the customer choose.

Frequently Asked Questions

Does inline checkout have higher conversion than redirect?
It depends on your audience and context. For established brands on desktop, inline checkout can reduce friction by keeping the customer on-site. For mobile users or less well-known brands, redirect checkout can actually build trust because customers see the Paystack domain. Test both with your audience and measure completion rates.
Can I use redirect checkout with a single-page application?
Yes, but the customer will leave your SPA for Paystack and then return to your callback URL, which reloads the application from scratch. If your SPA has significant client-side state (cart contents, form progress), you need to persist that state (in localStorage or on your server) before the redirect and restore it on return.
Does Paystack charge different fees for inline vs redirect checkout?
No. The pricing is identical regardless of which checkout method you use. Paystack fees are based on the transaction, not the checkout presentation.
Can I customize the look of the Paystack checkout popup?
You cannot customize the CSS or layout of the Paystack checkout form itself, whether inline or redirect. You can configure your business name, logo, and brand color in your Paystack dashboard, and these appear on the checkout form. The actual form fields and layout are controlled by Paystack.
What if popup blockers prevent the inline checkout from opening?
PaystackPop opens an iframe overlay, not a browser popup window, so standard popup blockers typically do not affect it. However, some aggressive browser extensions or security software may block third-party iframes. If you encounter this, redirect checkout is the reliable fallback.

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

Accepting Payments with Paystack: Complete Guide

Everything you need to accept your first payment with Paystack: choosing between Initialize Transaction and the Charge API, handling amounts in kobo, attaching metadata, setting callback URLs, and designing transaction references that keep your system clean.

Read more

Using Paystack Custom Fields to Collect Extra Checkout Information

Paystack custom fields let you attach structured, human-readable data to a transaction that shows up on the checkout page, in your dashboard, and in webhook payloads. This guide covers display_name vs variable_name, common field patterns, and how to extract custom field data when the webhook arrives.

Read more

Paystack Customer Objects: Create, Fetch, Update, Whitelist

Paystack creates a customer object every time a new email hits your checkout. You can also create customers explicitly, update their details, fetch their transaction history, and whitelist or blacklist them for risk control. This guide covers every operation with working Node.js code.

Read more

Building a Wallet Top-Up Flow on Paystack

A step-by-step guide to building wallet top-up flows with Paystack. Initialize payment, handle webhooks, credit wallets safely, enforce minimum amounts, and prevent double-crediting in production.

Read more

Paystack Webhooks on Cloudflare Workers

A complete guide to handling Paystack webhooks on Cloudflare Workers. Covers the Web Crypto API for HMAC-SHA512 signature verification (since Workers do not have Node.js crypto), request body handling, environment secrets, and a production-ready Worker you can deploy in minutes.

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.