Quick answer: To accept online payments in Saudi Arabia, integrate through a payment gateway licensed or authorised by SAMA (Saudi Central Bank) that supports the methods Saudi customers actually use: mada (the national debit network), Visa/Mastercard, Apple Pay, local digital wallets, SADAD for bills, and often buy-now-pay-later. Technically, use hosted checkout or tokenisation (so card data never touches your server), 3-D Secure, server-side verification via webhooks, idempotency keys, and amounts in SAR halalas as integers.
Payment methods Saudi customers expect
Method | What it is | Integration note |
|---|---|---|
mada | Saudi national debit card network | Most bank debit cards; ensure your gateway supports and correctly routes mada cards (many are co-badged with Visa/Mastercard) |
Visa / Mastercard | International credit/debit cards | Standard card flow with 3-D Secure |
Apple Pay | Wallet payments on iPhone/Safari | Requires merchant ID and domain verification with your gateway; very popular in KSA |
Local digital wallets | Mobile wallets offered by banks and telecom-backed providers | Usually via gateway redirect or SDK |
SADAD | National bill payment system | For billers (utilities, government, B2B invoices) β payments via bank channels |
BNPL | Instalment providers | Separate integration or offered through the gateway |
Choosing a gateway: compare SAMA licensing status, supported methods (mada + Apple Pay at minimum), settlement time to a Saudi bank account, fees, Arabic checkout UI, SDKs for your stack (web, iOS, Android), webhooks quality, sandbox, and support. Always confirm current licensing on SAMA's official website.
Integration options
- Hosted payment page (redirect): fastest and lowest compliance burden β the gateway hosts the card form.
- Embedded/iframe or JS fields: card fields look native but are served by the gateway; you receive a token.
- Mobile SDK: native card and Apple Pay sheets in your app.
- Direct API (server-to-server card data): requires full PCI DSS compliance β avoid unless you have a strong reason.
The standard payment flow
1. Customer clicks "Pay"
2. Your server creates an order (status = pending, amount in halalas)
3. Your server creates a payment/checkout session at the gateway
(amount, currency SAR, order ID, callback URL, idempotency key)
4. Customer enters card / chooses Apple Pay on the gateway form
5. 3-D Secure challenge (OTP from the bank) if required
6. Gateway redirects the customer to your callback URL
7. Gateway sends a WEBHOOK to your server
8. Your server VERIFIES the payment with the gateway API
(status, amount, currency, order ID) β marks order as paid
9. Issue invoice (e-invoice compliant) and send confirmationNever trust the redirect alone. Query parameters on the return URL can be tampered with. Always confirm the payment status and amount on the server via the gateway's API or a signature-verified webhook before fulfilling the order.
Example: server-side verification (pseudocode)
POST /webhooks/payments
verify signature header with webhook secret β else 401
event = parse(body)
if already_processed(event.id): return 200 // idempotent
payment = gateway.getPayment(event.payment_id)
order = orders.find(payment.metadata.order_id)
if payment.status == "paid"
and payment.amount == order.amount_halalas
and payment.currency == "SAR":
order.markPaid(payment.id)
record_processed(event.id)
return 200Engineering best practices
- Money as integers: store 150.75 SAR as 15075 halalas; never use floating point.
- Idempotency keys on payment creation and refunds to avoid double charges on retries.
- Webhooks: verify signatures, handle duplicates and out-of-order events, respond quickly and process asynchronously.
- Reconciliation job: daily, compare gateway settlement reports with your orders.
- Status machine: pending β authorised β captured β refunded/partially refunded/failed.
- Timeouts: if the customer closes the browser, rely on the webhook and a status-check job.
- Logging: log payment IDs and statuses, never full card numbers or CVV.
- Arabic and RTL checkout support and clear error messages.
Security and compliance
- PCI DSS: using hosted pages or tokenisation keeps most card data out of your scope (simpler self-assessment).
- 3-D Secure for card authentication and reduced fraud liability.
- Data protection: follow Saudi personal data protection requirements for customer data.
- E-invoicing: businesses registered for VAT must issue compliant electronic invoices β connect your payment success event to your invoicing module.
- Refunds: refund to the original payment method through the gateway; keep audit trails.
Testing checklist
- β mada card success and failure (sandbox test cards)
- β Visa/Mastercard with 3-D Secure challenge
- β Apple Pay on Safari and iOS
- β Cancelled payment and browser closed mid-payment
- β Duplicate webhook delivery
- β Amount mismatch rejected
- β Full and partial refunds
- β Arabic UI and mobile layout
Summary
- Use a SAMA-licensed/authorised gateway supporting mada and Apple Pay.
- Prefer hosted checkout or tokenisation to minimise PCI scope.
- Verify every payment server-side; never trust the redirect.
- Integers for money, idempotency keys, robust webhooks and daily reconciliation.
- Link payments to compliant e-invoicing.