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.
// Verify that target element existsconst target = document.getElementById('payment-container');if (!target) { console.error('Payment container not found');}// Check console for CSP errors// Add to your HTML if needed:// <meta http-equiv="Content-Security-Policy" // content="frame-src https://secure.payviox.com;">
Iframe height not adjusting
Solution: Set a fixed minimum height or use viewport units:
Solution: Ensure you’re listening before creating the session:
Copy
// First configure the listenerwindow.addEventListener('message', handlePaymentMessage);// Then create the sessionawait payviox.createSession(params, iframeConfig);