Payment Gateway Integration in Pakistan: A 2026 Guide

Many Pakistani businesses want customers to pay inside their website or app instead of sending a screenshot of a bank transfer. A payment gateway makes that possible, but the gateway is only half the job. The other half is the integration: how your software starts a payment, learns the result and keeps the books straight.
This guide explains how payment gateway integration in Pakistan works, what the State Bank of Pakistan (SBP) framework means, and the design decisions that make online payments reliable.
What is payment gateway integration?
A payment gateway is the service that securely passes a customer’s payment from your checkout to the banks and payment networks, and returns an approved or failed result. Payment gateway integration is the software work that connects your website, mobile app, ERP or billing system to that service.
In practice, integration covers four things:
- Starting the payment with the correct amount and order number.
- Receiving the result through a redirect and a server-to-server notification.
- Updating records so the order, invoice and stock change together.
- Handling what follows: refunds, failures, disputes and settlement reports.
How online payments are regulated in Pakistan
Payment gateways in Pakistan sit under SBP’s payment systems framework. SBP’s Payment Systems Policy and Oversight Department issues rules under the Payment Systems and Electronic Fund Transfers Act, 2007, including the Rules for Payment System Operators and Payment Service Providers (PSO/PSP Rules), 2014.
SBP says institutions licensed under these rules provide platforms for “clearing, processing, routing and switching of electronic transactions” and can make agreements with banks, merchants and e-commerce service providers. SBP also publishes a list of authorised PSOs and PSPs. That list shows “E-Commerce Payment Gateway” approvals at three separate stages: commercial operations, pilot operations and in-principle approval.
Two practical points follow from this:
- Check the stage, not just the name. An in-principle approval or pilot is not the same as commercial operation.
- The list is not an endorsement. SBP’s own note says the list “shall not be construed as an endorsement” of a provider’s business model, financial position or operational soundness.
Many businesses also ask “how to get payment gateway from bank”. Whichever route you take, you sign a merchant agreement first and then receive test and live credentials.
Pakistani customers pay mostly from accounts and wallets
The way people pay should shape your checkout. In its Annual Report on Payment Systems for FY26, SBP reported that account-based online payments made up 96 percent of e-commerce transactions conducted through banking channels. The same report counted 99.1 million branchless banking mobile app users and 30.4 million users of banks’ mobile apps.
So a card form alone is not enough. Your checkout should support the methods customers actually use, such as bank account and mobile wallet payments, with cards alongside where relevant. A wallet payment may need approval on the customer’s phone, so your system must wait for confirmation instead of assuming success.
Raast QR is also worth planning for. On 13 November 2026, Business Recorder reported that the Prime Minister decided to continue the subsidy on merchant discount rate (MDR) charges for Raast QR payments. If you also sell in person, see our guide to Raast dynamic QR in billing, POS and ERP.
How a payment flow works, step by step
A well-built integration usually follows this sequence:
- The order is created first. Your system saves it as “pending payment” with a unique reference.
- The customer pays on the gateway’s hosted page or a secure component inside your site or app.
- The customer returns to a “thank you” or “payment failed” page.
- Your server is notified. The gateway sends a separate server-to-server message (often called a callback, webhook or IPN) with the final status.
- Your server verifies the signature or asks the gateway’s API for the status, and checks the amount.
- Records update once: the order is marked paid, a receipt is issued and stock is reserved.
A common mistake is treating step 3 as proof of payment. Customers close browsers or lose signal. The server notification should be the source of truth.
Design decisions that matter
Hosted checkout or API integration
With a hosted checkout, the customer enters payment details on the gateway’s page, which keeps sensitive details away from your servers. A deeper API integration gives more control over the look and flow but puts more security responsibility on your system.
Order states and duplicate protection
Plan clear states such as pending, paid, failed, expired and refunded. Make your notification handler safe to run twice, because the same message may arrive more than once. One payment must never create two orders.
Refunds and reconciliation
Refunds should start from your admin panel and link to the original transaction. Each day, your system should match the gateway’s settlement report against paid orders so finance can spot gaps quickly. In ERP and POS software, each payment should post to the right customer and ledger automatically.
Security and PCI DSS
PCI DSS is the card industry’s security standard. The PCI Security Standards Council describes it as a baseline of technical and operational requirements to protect payment account data. It applies to entities that store, process or transmit cardholder data, including merchants. The simplest way to reduce exposure is not to store card data at all. Use hosted pages or secure components, keep API keys on the server, never in the app, and serve every page over HTTPS.
Websites and mobile apps
For a web application, the main work is the checkout, the callback endpoint and admin tools. In mobile apps, the app should ask your server to create the payment, and the server should confirm the result. Never trust the app to report its own success.
Testing before going live
Test every outcome in the provider’s test environment: success, failure, cancellation, timeout, duplicate notification and refund. Then run a few small live payments. Keep masked logs of every request and notification.
What is coming next
SBP has released draft Open Banking Regulations for public consultation. Dawn reported that the draft would allow payments to be initiated through authorised third-party providers and would facilitate business-to-business and consumer-to-business payments. The rules are still a draft, but a payment layer built on clear states and server-side verification will adapt more easily. Read more on open banking in Pakistan.
Frequently asked questions
What is payment gateway integration?
It is the work of connecting your website, app or business software to a payment gateway so customers can pay online and your system records results, issues receipts and handles refunds.
What is a payment gateway API?
It is the set of secure requests your server uses to create payments, check status, receive notifications and issue refunds. Providers share documentation and test credentials after onboarding.
How to get a payment gateway in Pakistan?
You apply to a bank or an SBP-authorised payment service provider and sign a merchant agreement. SBP publishes the list of authorised PSOs and PSPs and the stage each approval is at.
Is PCI DSS compliance needed in Pakistan?
PCI DSS applies to any business that stores, processes or transmits cardholder data. Using a hosted checkout and never storing card details reduces how much of your system handles card data.
If you are planning online payments for a website, app or ERP, contact Software Craft.
Planning a software project?
Tell us what you want to build and our team will suggest the right web, mobile, ERP or AI solution.


