Paystack works with any language or framework that can make HTTP requests. The API is REST-based with JSON payloads, so the integration pattern is the same everywhere: initialize a transaction on your server, redirect the customer to pay, verify the result, and listen for webhooks. The only thing that changes between frameworks is the HTTP client you use and where you put your route handlers.
Paystack does not care what language you write. It is a REST API. You send HTTP requests to https://api.paystack.co, include your secret key in the Authorization header, and send or receive JSON. That is the entire protocol.
Here is what a transaction initialization looks like as a raw HTTP request:
POST https://api.paystack.co/transaction/initialize
Authorization: Bearer sk_test_xxxxxxxxxxxxx
Content-Type: application/json
{
"email": "customer@example.com",
"amount": 500000,
"currency": "KES",
"callback_url": "https://yourapp.com/payment/callback"
}
That request is the same whether you send it from Node.js, Python, PHP, Go, Ruby, Java, C#, or Dart. The language is just the HTTP client. fetch in JavaScript, requests in Python, Guzzle in PHP, net/http in Go. Different syntax, same bytes on the wire.
This is good news. It means three things:
The guides in this cluster take this universal API and show you exactly where to put each piece in your specific framework. Where does the secret key go? How do you set up the route for webhooks? How do you verify a signature in your middleware? Those are framework questions, not Paystack questions, and that is what each guide answers.
For the full picture of how Paystack works before you pick a framework guide, read the complete engineering guide.
JavaScript is the most common language in the Paystack ecosystem. Most African startups run Node.js on the backend and React or Vue on the frontend, so this is where the largest chunk of our guides live.
Next.js with the App Router (Next.js 13+) uses React Server Components and Route Handlers. Your Paystack secret key lives in a Route Handler (app/api/paystack/route.ts), and the frontend uses Paystack Inline or redirects. Server Actions can also initialize transactions directly.
The Pages Router uses API Routes (pages/api/) instead of Route Handlers. If your project is on Next.js 12 or earlier, or you have not migrated to the App Router yet, these guides are for you.
Plain React apps (Create React App, Vite, etc.) have no server. You use Paystack Inline on the client to collect payment, then call your own backend API to verify. The backend can be Express, FastAPI, Laravel, or anything else. These guides cover the React side.
Vue integrations follow the same pattern as React: Paystack Inline on the client, backend API for verification and webhooks. Vue's composition API makes the Paystack popup easy to wrap in a composable.
Nuxt gives you server routes out of the box (server/api/), so you get the full-stack experience without a separate backend. Your Paystack secret key goes in a server route, and Nuxt handles the rest.
Angular uses services and dependency injection. The Paystack integration lives in a service that loads Paystack Inline, and your backend (often a separate Node or .NET API) handles verification and webhooks.
SvelteKit has server-side load functions and API endpoints (+server.ts files) that make Paystack integration clean. Plain Svelte without SvelteKit needs a separate backend, similar to plain React or Vue.
Express is still the most common Node.js backend framework in Africa. The integration is straightforward: Express routes handle initialization, verification, and webhook receipt. Use fetch (Node 18+) or axios to call the Paystack API.
NestJS adds structure to Node.js with modules, controllers, services, and decorators. Your Paystack logic lives in a service, the controller handles routes, and guards can protect webhook endpoints. NestJS's dependency injection makes testing Paystack calls easy to mock.
Supabase Edge Functions run on Deno. They are good for serverless Paystack integrations where you want to keep your backend light. The function receives the request, calls Paystack, writes to your Supabase database, and returns. No server to manage.
Firebase Cloud Functions (v2, based on Cloud Run) let you write Paystack handlers as serverless functions. You deploy them alongside your Firestore rules and Firebase Auth. Good for teams already deep in the Firebase ecosystem.
Get weekly developer tips
Join 25,000+ developers. Practical guides, job tips, and new content — straight to your inbox.
No spam. Unsubscribe anytime.
Python is the second most popular backend language among African developers, especially for fintech teams and data-heavy products. Paystack integration in Python means using the requests library (or httpx for async) to call the API, then plugging the routes into your framework of choice.
Django's view system handles Paystack routes. Your webhook endpoint is a Django view with @csrf_exempt (because Paystack cannot send CSRF tokens). Use Django's ORM to record transactions. The guides cover both function-based and class-based views.
If your Django project exposes a REST API through DRF, these guides show you how to build Paystack endpoints as DRF views with serializers and proper response formatting. Useful for mobile apps and SPAs that talk to a Django API.
FastAPI is async-native, so you can use httpx.AsyncClient to call Paystack without blocking. Type hints and Pydantic models give you automatic request validation. FastAPI's dependency injection works well for sharing a Paystack client across routes.
Flask is minimal by design. You add routes, call Paystack with requests, and return JSON. No batteries included means no magic to fight. If you want the simplest possible Python integration, Flask is it.
PHP runs a large share of web applications in Africa, especially in Nigeria where Laravel is the dominant framework. Paystack itself was built in Lagos, so PHP support is first-class. The official paystack-php library exists, but you can also call the API directly with Guzzle or even curl.
Laravel is the most popular PHP framework for Paystack integrations. You can use the paystack-php library or call the API through Laravel's HTTP client (which wraps Guzzle). Webhook routes go in routes/api.php to skip CSRF verification. Laravel's event system works well for dispatching jobs after payment confirmation.
Symfony is less common than Laravel in the African dev scene but used in larger enterprise projects. The integration uses Symfony's HttpClient component and controller routes. Webhook handling works through a dedicated controller action.
These frameworks are less common in the African startup scene but popular in enterprise environments, fintech backends, and teams with specific language preferences.
Rails handles Paystack with Net::HTTP or the httparty gem. Controllers receive webhooks, models store transaction records, and Active Job processes async work after payment. Rails conventions make the integration predictable.
Go's net/http standard library is all you need. No external dependencies required. Go's strong typing and built-in JSON marshalling make Paystack response handling clean. Good for high-throughput payment services where you want low latency and small memory footprint.
Spring Boot is common in African banks and large fintech companies. The integration uses RestTemplate or WebClient (reactive) to call Paystack. Spring's @RestController annotation handles webhook endpoints. Spring Security can validate webhook signatures in a filter.
ASP.NET Core is used by some enterprise teams in South Africa, Kenya, and Nigeria. The integration uses HttpClient (injected via IHttpClientFactory) and controller actions. ASP.NET Core's middleware pipeline is a natural place for webhook signature verification.
Mobile apps cannot safely store your Paystack secret key. The secret key must stay on your server. So every mobile Paystack integration has two parts: the mobile app (which shows the payment UI and collects the result) and a backend API (which initializes transactions, verifies payments, and receives webhooks).
The mobile guides in this cluster cover both parts. They show the mobile-side code and the backend calls your app needs to make.
Flutter is the most popular cross-platform framework among African mobile developers. You can use the paystack_flutter package for a pre-built payment UI, or load Paystack Inline in a WebView. The backend is usually Node.js, Django, or Firebase Cloud Functions.
React Native integrations typically use react-native-paystack-webview to show the Paystack checkout inside your app. The JavaScript side calls your backend API, which does the actual Paystack API calls. If you already have a Node.js backend, the server code is identical to a web integration.
Native Android apps can use Paystack's Android SDK or load the checkout in a WebView using Android's WebViewClient. Kotlin coroutines handle async API calls to your backend. The webhook and verification logic lives on your server, not in the Android app.
iOS apps can load the Paystack checkout in a WKWebView or use a native form with the Paystack iOS SDK. Swift's URLSession calls your backend to initialize and verify. As with all mobile platforms, the secret key must never appear in your app bundle.
No matter what framework you pick, your Paystack integration needs to handle four tasks. Every guide in this cluster is organized around these four tasks.
This is the starting point. You call POST /transaction/initialize with the customer's email, amount (in the smallest currency unit, e.g., kobo or cents), and a callback URL. Paystack returns an authorization_url where the customer pays. After payment, the customer is redirected back to your callback URL with a reference in the query string.
For frontend frameworks, you can skip the redirect and use Paystack Inline (a JavaScript popup) that handles payment in a modal without leaving your page.
See the accepting payments guide for the full breakdown of initialization, channels, and checkout options.
After the customer pays (or claims to have paid), you call GET /transaction/verify/:reference using your secret key. You check that the response shows status: "success" and that the amount and currency match what you expected. This is the single most important security step. Never grant access or deliver goods based on a client-side callback alone.
Paystack sends POST requests to your webhook URL whenever something happens: a charge succeeds, a transfer completes, a subscription renews, a charge-back is filed. You must validate the x-paystack-signature header using HMAC SHA-512 with your secret key, return a 200 status immediately, then process the event asynchronously.
Webhooks are your safety net. If the customer closes the browser before the redirect, your webhook still fires. If the network drops during verification, the webhook still fires. Build your system so that webhooks are the source of truth, not redirects.
Read the webhooks engineering guide for retry logic, event types, and security patterns.
Recurring billing means creating a Plan (with an interval and amount), then subscribing a customer to that plan. Paystack handles the charging schedule. You listen for subscription.create, invoice.payment_failed, and subscription.disable webhook events to keep your app in sync.
Each framework guide in this cluster covers all four tasks for your specific stack. Pick your framework from the lists above and work through the four guides in order.
This is the hub page for the framework integration cluster. It contains 100 spoke articles organized as a matrix of 25 frameworks and 4 tasks.
The 25 frameworks:
The 4 tasks:
Every guide follows the same structure: what you need before you start, the complete code, an explanation of each step, and common mistakes to avoid. The code examples are designed to work as-is in a fresh project with your Paystack test keys.
If you are starting a new project and want a recommendation:
But honestly, it does not matter much. Paystack is a REST API. Pick the framework your team already knows and get building. You can always switch later because the API calls are identical.
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