(function () { 'use strict'; window.addEventListener('message', (event) => { // Verify the origin of the message for security // Uncomment and set your checkout page URL to enhance security // if (event.origin !== "https://your-checkout-page-url.com") return; if (event.data.type === 'bitPaymentRedirect') { const { url, deviceType } = event.data; window.location.href = url; } }); })();