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

Paystack with Saleor

Saleor payment gateways are Python plugins implementing the GatewayPlugin interface. Build a PaystackGatewayPlugin class with process_payment() (calls POST /transaction/initialize and returns ClientToken with the authorization_url), confirm_payment() (calls GET /transaction/verify), and optionally refund() (calls POST /refund). Register the plugin in PLUGINS setting in saleor/settings.py.

In this article

  1. 1. Saleor Paystack Gateway Plugin Structure
  2. 2. Registering the Plugin in Saleor
  3. 3. Learn More

Saleor Paystack Gateway Plugin Structure

# saleor/payment/gateways/paystack/__init__.py
import requests, hmac, hashlib
from saleor.payment.interface import GatewayConfig, GatewayResponse, PaymentData

PAYSTACK_API = 'https://api.paystack.co'

def process_payment(payment_information: PaymentData, config: GatewayConfig) -> GatewayResponse:
    secret_key = config.connection_params['secret_key']
    resp = requests.post(
        PAYSTACK_API + '/transaction/initialize',
        json={
            'email': payment_information.customer_email,
            'amount': int(payment_information.amount * 100),  # to minor unit
            'reference': payment_information.token,
            'currency': 'NGN',  # or from config
            'callback_url': config.connection_params['callback_url'],
        },
        headers={'Authorization': 'Bearer ' + secret_key},
    )
    data = resp.json()
    return GatewayResponse(
        is_success=data['status'],
        client_token=data['data']['authorization_url'],  # storefront redirects here
        transaction_id=data['data']['reference'],
        amount=payment_information.amount,
        currency=payment_information.currency,
        error=data.get('message') if not data['status'] else None,
    )

def confirm_payment(payment_information: PaymentData, config: GatewayConfig) -> GatewayResponse:
    secret_key = config.connection_params['secret_key']
    resp = requests.get(
        PAYSTACK_API + '/transaction/verify/' + payment_information.token,
        headers={'Authorization': 'Bearer ' + secret_key},
    )
    data = resp.json()
    success = data['data']['status'] == 'success'
    return GatewayResponse(
        is_success=success,
        transaction_id=payment_information.token,
        amount=data['data']['amount'] / 100,
        currency=data['data']['currency'],
        error=None if success else data['data'].get('gateway_response'),
    )

Registering the Plugin in Saleor

# saleor/settings.py
PLUGINS = [
    # ... other plugins
    'saleor.payment.gateways.paystack.PaystackGatewayPlugin',
]

# In your PaystackGatewayPlugin class:
class PaystackGatewayPlugin(BasePlugin):
    PLUGIN_NAME = 'Paystack'
    PLUGIN_ID = 'paystack'
    CONFIG_STRUCTURE = {
        'secret_key': {'label': 'Secret Key', 'type': 'secret'},
        'callback_url': {'label': 'Callback URL', 'type': 'string'},
    }
    DEFAULT_ACTIVE = False

After registering, go to Saleor Dashboard → Plugins → Paystack to enter your secret key and callback URL. Activate the plugin and assign it to your channels.

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 integrations overview for all platform options.

Sign up for the McTaba newsletter

Key Takeaways

  • ✓Saleor payment gateways are Python plugins — implement the GatewayPlugin interface.
  • ✓process_payment() initializes the Paystack transaction and returns the checkout URL as a client token.
  • ✓confirm_payment() is called after the customer returns from Paystack — it verifies the transaction.
  • ✓Store the Paystack secret key in Saleor's plugin configuration (encrypted in the database).
  • ✓Webhook events from Paystack can update Saleor order status via the Saleor order management API.

Frequently Asked Questions

Does Saleor have an official Paystack payment gateway?
Saleor does not have an official Paystack gateway as of 2026. You need to build a custom plugin following the GatewayPlugin interface. The code pattern above gives you a working starting point. Check the Saleor community forums and GitHub for any community-maintained Paystack plugins that may have been published.
How do I handle Paystack webhooks in Saleor?
Create a Django view or Saleor webhook endpoint that receives Paystack events. On charge.success, call the Saleor order management API (or internal service) to mark the payment as confirmed. Alternatively, your Saleor plugin can expose a webhook endpoint that Saleor routes to from its webhook handler system.
What Saleor version is this compatible with?
The plugin structure shown works with Saleor 3.x. Saleor's payment plugin API has evolved across versions — check the Saleor developer docs for your specific version. The core approach (process_payment, confirm_payment) is consistent across 3.x but method signatures may differ.

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 Settlement Timelines and What Engineers Should Assume

Settlement is when the money actually lands in your bank account. It does not happen at the same time as the charge. This guide explains the settlement cycle for each Paystack-supported country, how to query settlement data, and how to build your application so that settlement timing never causes bugs or confusion.

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.