How to Integrate JazzCash & easypaisa Payments: A Developer Guide
If you’re a developer integrating JazzCash or easypaisa payments for a Pakistani business, the right payment gateway can help simplify the process of accepting mobile wallet payments. Instead of maintaining separate integrations for every payment method, you may be able to manage multiple methods through a single payment provider.
This guide explains the typical integration workflow, server-side payment requests, checkout redirects, webhook security, sandbox testing, and the steps to consider before going live with DeltaPay Global.
Important: The exact API endpoints, authentication method, supported payment methods, webhook format, and sandbox credentials depend on DeltaPay Global’s current integration documentation. Confirm these details with the DeltaPay team before using the illustrative code below in production.
The integration flow at a glance
A unified payment integration generally follows this pattern:
- Your backend creates a payment request containing the amount, currency, customer details, and selected payment methods.
- The payment provider returns a checkout URL or another response specified in its API documentation.
- The customer selects an available method, such as JazzCash or easypaisa, and completes the payment through the applicable payment flow.
- The provider notifies your application of the transaction status through a webhook, if supported.
- Your backend validates the notification, updates the order, and fulfils it only after confirming the payment.
The goal is to keep payment processing on the server, handle asynchronous transaction updates securely, and avoid treating a browser redirect as proof of successful payment.
Before you write any code
Before starting development with DeltaPay Global, confirm the following with its team:
- Merchant onboarding: Ask about the application process, business verification, and any required documents.
- API documentation: Obtain the current API reference, including authentication requirements, request schemas, response formats, and error codes.
- Sandbox access: Confirm whether a test environment and test credentials are available.
- Supported payment methods: Verify whether JazzCash, easypaisa, cards, Raast, or other methods are available for your merchant account.
- Webhook configuration: Confirm whether webhooks are supported and how event authenticity should be verified.
- Production access: Ask about live credentials, transaction limits, settlement arrangements, and go-live requirements.
You can contact DeltaPay Global through its website: https://deltapay.pk/
Step 1 — Create a payment request on the server
Your backend should initiate the payment using the endpoint and authentication method specified in DeltaPay Global’s API documentation.
Never expose secret API credentials in browser-side JavaScript, a public mobile application, or a publicly accessible repository.
Illustrative Node.js example
The following example demonstrates the general structure of a server-side payment request. The endpoint, field names, authentication header, and response properties are placeholders, not verified DeltaPay Global API specifications.
const response = await fetch(
process.env.DELTAPAY_PAYMENT_ENDPOINT,
{
method: "POST",
headers: {
"Authorization":
`Bearer ${process.env.DELTAPAY_SECRET_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": order.id
},
body: JSON.stringify({
amount: 4250,
currency: "PKR",
customer: {
phone: "+923XXXXXXXXX"
},
return_url:
`https://yourstore.pk/order/${order.id}`
})
}
);
if (!response.ok) {
throw new Error(
`Payment request failed: ${response.status}`
);
}
const payment = await response.json();
// Use the actual response fields documented by DeltaPay.
// Redirect only if the provider returns a valid checkout URL.
Before implementing this example, confirm whether DeltaPay expects amounts in rupees or paisa, which customer fields are mandatory, whether an idempotency header is supported, and how the checkout URL is returned.
PHP integration
The same principles apply to PHP applications. Use your chosen HTTP client to send the payment request from your server, store the provider’s transaction reference, and handle unsuccessful responses safely.
<?php
$payload = [
'amount' => 4250,
'currency' => 'PKR',
'customer' => [
'phone' => '+923XXXXXXXXX',
],
'return_url' =>
'https://yourstore.pk/order/' . $order->id,
];
// Illustrative only:
// Add the endpoint, authentication headers,
// required fields, and request format specified
// in DeltaPay Global's official API documentation.
Do not deploy either example until you have replaced the illustrative fields with the provider’s documented requirements.
Step 2 — Redirect the customer to checkout
If DeltaPay Global provides a hosted checkout flow, your application can redirect the customer to the checkout URL returned by the payment API.
A typical flow looks like this:
- The customer places an order on your website.
- Your backend creates a payment request.
- The application receives the provider’s checkout URL.
- The customer completes the payment using an available payment method.
- The application receives a redirect or payment-status notification.
Confirm which payment methods are available for your account and whether checkout can be hosted, embedded, or integrated directly into your website.
Using a hosted checkout may reduce the amount of payment-related data your application handles. However, it does not automatically remove all security or compliance obligations. Your implementation must follow the provider’s requirements and the rules applicable to your business.
Step 3 — Handle payment notifications securely
A successful redirect to your order page does not necessarily mean that the payment has settled. Customers may close the browser, lose connectivity, or return before the final transaction status is available.
If DeltaPay Global supports webhooks, configure your endpoint according to its documentation and use it to receive payment-status updates.
Your webhook implementation should:
- Verify the authenticity of each notification using the provider’s documented verification mechanism.
- Reject invalid or unauthenticated notifications.
- Check the transaction reference, amount, currency, and order association.
- Process successful events idempotently so repeated notifications do not fulfil an order twice.
- Return the expected HTTP response within the provider’s required time limit.
- Record transaction events for troubleshooting and reconciliation.
Illustrative webhook handler (Node.js)
The following is a structural example only. It does not specify DeltaPay Global’s actual webhook header, signature algorithm, event names, or payload format.
app.post(
"/webhooks/deltapay",
express.raw({ type: "application/json" }),
async (req, res) => {
// Verify the request using the exact mechanism
// specified in DeltaPay Global's documentation.
const isAuthentic =
await verifyDeltaPayWebhook(req);
if (!isAuthentic) {
return res.status(401).end();
}
const event = JSON.parse(req.body.toString());
// Confirm the event structure and status against
// the official API documentation.
// Check the transaction and order before fulfilment.
// Make processing idempotent.
return res.sendStatus(200);
}
);
Do not copy a signature header or HMAC verification method from another payment provider and assume it will work with DeltaPay Global. Obtain the correct verification instructions before enabling live transactions.
Step 4 — Test before going live
A structured test plan can help uncover integration errors before customers use your checkout.
- Verify your credentials. Confirm that your API credentials belong to the intended environment.
- Test successful payments. Use the provider’s documented sandbox scenarios or test credentials.
- Test failed payments. Check how your application handles declined, cancelled, and incomplete transactions.
- Test duplicate requests. Confirm that repeated submissions do not create duplicate orders or unintended charges.
- Test webhook delivery. Verify authentication, event processing, duplicate-event handling, and recovery after temporary failures.
- Test customer redirects. Make sure the order page displays an accurate status even if the customer returns before the final payment notification.
- Check reconciliation. Compare your application records with the provider’s transaction records.
- Complete production onboarding. Follow DeltaPay Global’s requirements for activating live credentials and processing real payments.
Use only test phone numbers, test payment details, and scenarios explicitly provided by the payment provider. Do not assume that a particular phone number automatically succeeds or fails unless the official sandbox documentation confirms it.
Before processing a live payment, verify the applicable fees, transaction limits, settlement schedule, refund process, and support arrangements.
Common integration mistakes
Exposing secret keys
Keep credentials in server-side environment variables or a suitable secrets manager. Never place secret keys in frontend code or commit them to a public repository.
Assuming all payment methods use the same flow
JazzCash, easypaisa, cards, and Raast may have different authorization, redirect, confirmation, and refund requirements. Follow the integration documentation for each supported method.
Trusting the redirect alone
Use a verified server-side transaction status or authenticated webhook, where supported, before marking an order as paid.
Ignoring duplicate requests
Use idempotency features when the provider supports them. Your order-processing logic should also prevent duplicate fulfilment.
Assuming amount formats
Confirm whether the API accepts whole rupees, paisa, or another format. Incorrect amount units can cause payment errors.
Hard-coding settlement times
Settlement timing may depend on the payment method, provider agreement, business days, and bank processing. Confirm the applicable schedule with DeltaPay Global.
Failing to reconcile transactions
Keep records of order IDs, provider transaction references, amounts, statuses, refunds, and timestamps. Reconciliation helps identify discrepancies between your website and payment records.
No-code options for WordPress and Shopify
If your business runs on WordPress, WooCommerce, or Shopify, a supported plugin or prebuilt integration may reduce the amount of custom development required.
Before choosing this route, ask DeltaPay Global whether it currently provides an official integration for your platform, which payment methods that integration supports, and whether it requires API credentials or additional merchant configuration.
If a suitable integration is available, test the complete checkout flow in a non-production environment before accepting live payments.
Get started with DeltaPay Global
A reliable payment integration starts with clear documentation, secure credential handling, thorough testing, and a verified process for confirming transaction status.
Contact DeltaPay Global to ask about merchant onboarding, available payment methods, API documentation, sandbox access, webhook support, and production activation.
Visit https://deltapay.pk/ to get in touch and confirm the integration options available for your business.