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.Domain whitelisting required: Your domain must be whitelisted in your Payviox dashboard settings to use iframe mode.
How it works
1
Create payment session
Your application creates a payment session with iframe mode enabled.
2
Embed iframe
The SDK automatically creates and embeds an iframe in your specified target element.
3
Customer completes payment
Customer interacts with the payment form inside the iframe without leaving your page.
4
Handle completion
Listen for completion events via postMessage API to handle successful payments.
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.
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
Recommended practices for iframe integration:
- Provide visual feedback: Show loading states while the iframe loads
- Handle errors gracefully: Display user-friendly messages for errors
- Mobile optimization: Test on various screen sizes
- Accessibility: Ensure keyboard navigation works properly
- Performance: Initialize iframes only when needed (lazy loading)