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 with Medusa Commerce
Bonaventure OgetoBy Bonaventure Ogeto|Updated July 22, 2026

Paystack with Medusa Commerce

Install the medusa-payment-paystack plugin, add it to medusa-config.js under plugins with your PAYSTACK_SECRET_KEY, then add the provider to your region (Settings → Regions → select region → Payment Providers → Enable Paystack). On the storefront, call POST /store/carts/:id/payment-sessions, select paystack, then call POST /store/carts/:id/payment-sessions/:provider_id/authorize to get the Paystack authorization_url.

In this article

  1. 1. Installing and Configuring the Medusa Paystack Plugin
  2. 2. Storefront Checkout Flow
  3. 3. Learn More

Installing and Configuring the Medusa Paystack Plugin

npm install medusa-payment-paystack
// medusa-config.js
const plugins = [
  // ... other plugins
  {
    resolve: 'medusa-payment-paystack',
    options: {
      secret_key: process.env.PAYSTACK_SECRET_KEY,
    },
  },
];

module.exports = {
  projectConfig: {
    // ... your existing config
  },
  plugins,
};

Set the environment variable:

PAYSTACK_SECRET_KEY=sk_live_your_key_here

Restart your Medusa server. Then go to the Medusa admin dashboard → Settings → Regions → select your Africa region → Payment Providers → enable Paystack.

Storefront Checkout Flow

// In your Medusa storefront (Next.js example)
async function initializePaystackPayment(cartId) {
  // Create payment session
  await medusaClient.carts.createPaymentSessions(cartId);

  // Select Paystack as provider
  var cartData = await medusaClient.carts.setPaymentSession(cartId, {
    provider_id: 'paystack',
  });

  // Authorize payment — plugin calls Paystack initialize and returns the URL
  var { cart } = await medusaClient.carts.authorizePayment(cartId);

  // The plugin stores the Paystack authorization_url in payment session data
  var authUrl = cart.payment_session.data.authorization_url;
  window.location.href = authUrl; // redirect to Paystack checkout
}

// On callback page (after Paystack redirects back)
async function completePaystackPayment(cartId, reference) {
  // Verify with Paystack and complete the Medusa order
  var { type, data } = await medusaClient.carts.complete(cartId);
  if (type === 'order') {
    router.push('/order/' + data.id + '/confirmed');
  }
}

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

See the Paystack plugins guide for other e-commerce platform integrations.

Sign up for the McTaba newsletter

Key Takeaways

  • ✓Use the community medusa-payment-paystack plugin to add Paystack to Medusa.
  • ✓Configure the plugin in medusa-config.js with your PAYSTACK_SECRET_KEY.
  • ✓Enable Paystack in the Medusa admin under Settings → Regions → Payment Providers.
  • ✓The plugin handles payment session creation, authorization URL generation, and webhook processing.
  • ✓Medusa regions map to Paystack currencies — set your Africa region to use NGN, KES, or GHS as appropriate.

Frequently Asked Questions

Is medusa-payment-paystack an official Medusa plugin?
medusa-payment-paystack is a community plugin, not maintained by the Medusa core team. Check the npm package for its maintenance status and last publish date before using it in production. If the community plugin is outdated, you can build a custom Medusa payment provider using Medusa's PaymentService base class and the Paystack API directly.
How do Medusa regions map to Paystack countries?
Create separate Medusa regions for each Paystack country you support. For example: Nigeria region (currency: NGN, countries: NG), Kenya region (currency: KES, countries: KE). Each region can have Paystack enabled. Your Medusa storefront detects the customer's country and switches to the appropriate region and currency.
How does the Paystack webhook work with Medusa?
The medusa-payment-paystack plugin registers a webhook handler at /paystack/hooks (or similar) in your Medusa backend. Configure Paystack to send webhooks to this endpoint. The plugin handles HMAC validation and updates the Medusa payment session status when charge.success arrives.

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 Plugins and No-Code Integrations

A complete map of every official and community Paystack plugin, no-code connector, and automation tool. Covers e-commerce platforms, website builders, headless commerce, automation workflows, reporting integrations, and the decision framework for choosing plugins over custom code.

Read more

Paystack with OpenCart

A practical guide to integrating Paystack with OpenCart for African e-commerce stores. Covers extension installation, configuration, webhook setup, testing, and the most common setup problems.

Read more

Paystack with Zapier

Zapier connects Paystack to 6,000+ apps without writing code. This guide shows how to set up Paystack webhook triggers in Zapier and build the most common payment automation workflows for African businesses.

Read more

Paystack Storefront for a Small Business

Paystack Storefront gives small businesses a free online shop without needing a website or developer. List your products, set prices, and share a link. Customers browse, pick, and pay — you get notified and fulfill the order.

Read more

Paystack Balance and Settlement APIs Explained

Your Paystack dashboard shows you a balance number and a list of settlements. But when you need to reconcile programmatically, track pending payouts, or build financial reports, you need the API. This guide covers every endpoint, what each field means, and how to build reconciliation logic on top of them.

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.