Listen to Payment Success Messages

Shell
$<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)
> }
> }
> });
> }}
>/>
Response Example
1{"success":true}

Embed in iframe

Embed Coinflow checkout link in an iframe.

Listen for a postMessage event

Listen for a postMessage event from the checkout iframe and log the paymentId when a payment is successful.