Picking a payment provider like Stripe, Moyasar, Paymob, or Thawani is only half of your checkout architecture. The second decision—how your website or app actually talks to that gateway—determines how smooth checkout feels on mobile, how much PCI DSS security compliance lands on your shoulders, and how often orders get lost mid-redirect.
In practice, almost every online checkout falls into one of three integration models: Hosted Payment Page, Embedded Fields, or Direct API.
Quick comparison
| Model | How card entry works | PCI DSS burden | Mobile checkout UX | Engineering cost |
|---|---|---|---|---|
| Hosted / Redirect | Shopper leaves your site for the gateway’s payment page, then returns. | Lowest (typically SAQ A) | Extra page jump can cause drop-offs, though familiar locally | Lowest |
| Embedded Fields (iframes / Elements) | Secure inputs render inside your own checkout page; card data goes straight to the gateway. | Low (SAQ A / A-EP depending on setup) | Clean, on-brand, single-page flow | Moderate |
| Direct API (raw PAN on your stack) | Your UI and backend collect card numbers and forward them to the gateway API. | Highest (often full SAQ D audits) | Full custom control | Highest + ongoing audits |
For most modern ecommerce stores and SaaS products, Embedded Fields is the sweet spot. Hosted is great when speed matters or regional networks rely on redirect flows. Direct API should be treated as an enterprise compliance project—never a default starting point.
1. Hosted Payment Page (Redirect)
When the buyer clicks “Pay,” your backend creates a payment session and redirects the browser (or opens an in-app web view) to a URL hosted by the payment provider. Once the buyer finishes 3D Secure or wallet confirmation, the gateway redirects them back to your success or failure URL.
Strengths
- Fastest time to production: Little custom validation UI, no card-input styling headaches, and built-in localization or fraud widgets from the gateway.
- Minimal PCI footprint: Card details never pass through your HTML form logic or servers.
- Local familiarity in some regions: On regional integrations we ship—like Thawani in Oman or certain Paymob flows in Egypt—customers often recognize the provider’s hosted screen and feel comfortable completing OTP verification there.
Trade-offs
- Mobile context switching: Slow cellular connections or in-app browsers (such as opening a store from Instagram or WhatsApp) occasionally stall on the return redirect.
- Limited branding: You work within the provider’s layout, logo slot, and language switcher.
2. Embedded Fields (Iframes / Elements / Tokenization)
With embedded checkout (such as Stripe Elements or gateway JS tokenization SDKs), the card number, expiry, and CVV fields look like part of your own checkout form, but are actually rendered inside secure iframes hosted by the gateway. When the user submits, the SDK exchanges the card details directly for a single-use token, and your backend charges that token.
Strengths
- Higher trust and control: The shopper stays on your domain, sees your order summary, and never feels handed off to an unknown page.
- Manageable security scope: As long as you use the provider’s official hosted inputs and never capture raw card numbers yourself, your PCI burden remains lightweight.
- Built for one-page checkouts and Apple Pay / Google Pay: Pairs cleanly with express wallets and custom validation messages.
Trade-offs
- More frontend states to handle: You are responsible for loading spinners, inline validation, 3D Secure modal/redirect handling, and responsive mobile spacing.
3. Direct API (Raw Card Data on Your Stack)
Your application collects raw card numbers directly in your own inputs and sends them from your server to the gateway’s charge endpoint.
Why most teams skip this
Unless you are running custom card vaulting, multi-acquirer payment orchestration across banks, or a regulated fintech core with a dedicated security budget, raw card handling brings heavy PCI DSS SAQ D obligations—annual audits, network segmentation, penetration tests, and strict access controls.
If a contractor suggests “just build a normal form and POST the card number to our backend,” stop immediately unless you explicitly budgeted for full PCI compliance.
Why webhooks matter in every integration model
Even with embedded fields, modern payments are asynchronous—especially anywhere 3D Secure (OTP), Apple Pay, or local debit networks (like Mada or KNET) are involved.
A classic production bug happens when a store marks an order “Paid” only when the browser lands on /checkout/success. On mobile networks, customers routinely close the tab right after confirming their bank OTP—before the browser finishes returning to your site. The customer’s card was charged, yet your database still shows “Pending.”
Reliable checkouts follow three rules:
- Treat the return URL as a UI status screen only (querying the gateway or polling order status if needed).
- Listen to server-side webhooks, verify the cryptographic signature header, and check idempotency so duplicate webhook retries never double-fulfill an order.
- Reconcile failed, expired, and refunded states cleanly in your admin dashboard.
Decision checklist before writing code
- Do we need payments live within days for an MVP or campaign? Start with Hosted.
- Is checkout conversion and on-brand UX critical to revenue? Choose Embedded.
- Do local gateways dictate the flow? Check whether your target market (e.g., Mada in Saudi Arabia, KNET in Kuwait, Thawani in Oman) requires a hosted redirect or offers an embedded SDK.
- Do we need subscriptions or saved cards? Confirm tokenization works cleanly with your chosen model before building the cart UI.
- Have we tested declines, timeouts, 3DS cancellations, and partial refunds in sandbox? Test failure paths before touching production keys.
How EG Stars ships payment integrations
Across our payment gateway integration and ecommerce work—including wallet flows in ELKNZ and subscription billing in GymU—we match the setup to your market and risk profile. We use hosted redirect when launch speed or local familiarity leads, and embedded checkout when conversion and brand control matter, always backed by signed webhooks and sandbox testing.
Related reading: Stripe vs PayPal and multi-currency checkout best practices.
Frequently Asked Questions
Which payment integration type converts best for most online stores?
Embedded checkout (secure gateway iframes or Elements inside your own page) usually delivers the best balance: shoppers stay on your domain with your branding, while raw card numbers go straight to the gateway so your PCI DSS scope stays light.
When does a hosted redirect page still make sense?
Hosted pages work well for fast MVP launches, tight budgets, or markets where shoppers recognize and trust a regional provider’s checkout screen—such as Thawani hosted pay in Oman or local 3D Secure bank redirects.
Why should startups avoid Direct API card handling?
Sending raw card numbers through your own forms or servers puts you under full PCI DSS compliance (usually SAQ D), with annual audits, strict policies, and higher liability—rarely worth it unless compliance is already funded.
Why are webhooks mandatory regardless of integration type?
Users frequently close mobile tabs, lose signal during 3D Secure redirects, or hit Refresh on the thank-you page. Server-side webhooks with signature verification are the only reliable source of truth for marking an order paid.
Planning a payment integration for your website or app? Share your platform and target markets and we will outline the cleanest integration path.
