// After importing via the script tag, Subotiz is automatically attached to the window objectconst { Subotiz} = window;// Create an SDK instanceconst subotiz = Subotiz();// Initialize checkoutconst checkout = await subotiz.initEmbeddedCheckout({ fetchSessionUrl: async() => { // Fetch the sessionUrl from your server const response = await fetch('/api/session'); const data = await response.json(); return data.sessionUrl; }, environment: 'SANDBOX', // 'SANDBOX' | 'PRODUCTION' // The callback function when the payment completed only triggers when `redirect_on_completion` is set to `if_required` during Checkout session creation onComplete: () => { console.log('Payment completed!'); }});// Mount to the pagecheckout.mount('#checkout-container');