Documentation Index
Fetch the complete documentation index at: https://docs.payviox.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Iframe mode allows you to embed the Payviox payment flow directly into your website, providing a seamless user experience without redirecting customers away from your page.How it works
Customer completes payment
Customer interacts with the payment form inside the iframe without leaving your page.
Basic implementation
Minimal iframe integration
The simplest iframe integration requires just a target container:The payment form will be loaded directly inside the specified container element.
Configuration options
Iframe configuration parameters
Enable iframe integration mode. Must be set to
true.Configuration object for iframe behavior and appearance.
Handling iframe events
When using iframe mode, the payment page communicates with the parent window via thepostMessage API. The SDK handles these events automatically, but you can also listen for them directly if you are embedding the iframe without the SDK.
Event types
| Event type | Description | Payload |
|---|---|---|
payviox:redirect | Payment requires a full-page redirect (to a payment provider or success/failure URL) | { type: 'payviox:redirect', redirect: 'https://...' } |
payviox:close | Customer clicked “Back to merchant” — the iframe should be removed | { type: 'payviox:close' } |
Redirect-type payments (PayPal, Pallapay, etc.) cannot be displayed inside an iframe due to security restrictions (
X-Frame-Options). When the customer selects one of these methods, the payment page sends a payviox:redirect event to navigate the full page to the provider.Standalone integration (without SDK)
If you embed the Payviox iframe manually without using the SDK, you must listen for these events yourself:Troubleshooting
Iframe not displaying
Iframe not displaying
Possible causes:
- Domain not whitelisted
- Invalid iframe target element
- Content Security Policy blocking iframe
Iframe height not adjusting
Iframe height not adjusting
Solution: Set a fixed minimum height or use viewport units:
Messages not received
Messages not received
Solution: Ensure you’re listening before creating the session:
Best practices
Next steps
Error handling
Handle payment errors gracefully
Payment methods
Discover available payment options
Testing
Test iframe integration
Webhooks
Process server-side events