Choose how the checkout appears to your customers. Each mode has different trade-offs for user experience and implementation complexity.Documentation Index
Fetch the complete documentation index at: https://docs.ozura.com/llms.txt
Use this file to discover all available pages before exploring further.
Quick Comparison
| Mode | What Happens | Customer Experience | Code Complexity |
|---|---|---|---|
| Redirect | Browser navigates away to checkout | Leaves your site, returns after payment | Simplest |
| Popup | Checkout opens in a small popup window | Stays on your site, popup in front | Medium |
| Iframe | Checkout embedded directly in your page | Never leaves your site | Medium |
| New Tab | Checkout opens in a new browser tab | Your site stays open in original tab | Simple |
Domain registration: Popup and iframe modes require your domain to be registered with Ozura. Redirect and new tab modes work without registration.
Redirect Mode (Default)
What Happens
- Customer clicks “Pay” on your site
- Their browser leaves your website and goes to the Ozura checkout page
- After payment, they’re redirected back to your
successUrl,cancelUrl, orerrorUrl
When to Use
- Mobile apps (popups often blocked on mobile)
- Simple websites without JavaScript
- Email payment links
- When you want the simplest possible integration
Implementation
Step 1: Create Session (SERVER CODE)Popup Mode
What Happens
- Customer clicks “Pay” on your site
- A small popup window opens with the checkout
- Customer completes payment in the popup
- Your site receives a
postMessageevent when payment completes - You close the popup and update your page
When to Use
- Desktop websites where you want customers to stay on your page
- Single-page applications (SPAs)
- When you want to update your page without a full reload
Implementation
Step 1: Create Session withembedMode: "popup"
Iframe Mode
What Happens
- The Ozura checkout form appears embedded directly in your page
- Customer fills out payment info without ever leaving your site
- Your page receives a
postMessageevent when payment completes
When to Use
- When you want checkout to feel like part of your site
- Checkout pages where you show order summary alongside payment form
- Single-page applications (SPAs)
Implementation
Step 1: Create Session withembedMode: "iframe"
New Tab Mode
What Happens
- A new browser tab opens with the checkout
- Your original site stays open in the first tab
- After payment, the new tab redirects to your
successUrl - If customer cancels, the tab closes automatically
When to Use
- When popups are blocked (some browsers block popups but allow new tabs)
- When you want your site to stay open while customer pays
Implementation
PostMessage Events Reference
For popup, iframe, and new_tab modes, the checkout sends these events to your page:| Event | When It’s Sent | Payload |
|---|---|---|
CHECKOUT_READY | Checkout page has fully loaded | { type, sessionId } |
PAYMENT_SUCCESS | Payment completed successfully | { type, sessionId, paymentData } |
PAYMENT_ERROR | Payment failed (card declined, processor error, etc.) | { type, sessionId, error } |
CHECKOUT_CANCELLED | Customer clicked “Cancel and Return” | { type, sessionId, reason: 'user_cancelled' } |
CHECKOUT_ERROR | An unrecoverable error occurred | { type, sessionId, error } |
CHECKOUT_EXPIRED | Session was expired | { type, sessionId, error } |
In addition to sending
PAYMENT_SUCCESS via postMessage, the checkout page also navigates to your successUrl with transaction details as query parameters. For popup and iframe integrations, listen for the PAYMENT_SUCCESS event to update your parent page immediately.Which Mode Should I Use?
| If you want… | Use | Why |
|---|---|---|
| Simplest possible integration | Redirect | No JavaScript needed |
| Customer to stay on your site (desktop) | Popup | Your page stays visible |
| Checkout to feel built into your page | Iframe | Seamless experience |
| Avoid popup blockers | New Tab | Less likely to be blocked |
| Mobile-friendly | Redirect | Popups often blocked on mobile |