$<iframe$ allow="payment"$ src="COINFLOW_CHECKOUT_URL"$ onLoad={() => {> window.addEventListener('message', event => {> if (typeof event.data === 'string' ) {> const data = JSON.parse(event.data);>> if (data.data === 'success') {> console.log('payment id', data.info.paymentId)> }> }> });> }}$/>
1{"success":true}
Embed Coinflow checkout link in an iframe.
Listen for a postMessage event from the checkout iframe and log the paymentId when a payment is successful.