For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
RegisterLoginSandbox Login
GuidesRecipesAPI Reference
GuidesRecipesAPI Reference
  • Recipes
    • Add 3DS Challenge (Angular)
    • Add Dynamic Height to Coinflow UI Component
    • Add Dynamic Height to Apple Pay Button
    • Add Dynamic Height to Coinflow iframe
    • Add Dynamic Loading to Coinflow iframe
    • Apple Pay Payouts API Implementation
    • Complete Checkout with 3DS Challenge (React)
    • Listen for Purchase Events
    • Listen for Successful Account Link Messages
    • Listen to Client-Side Messages on Swift iOS
    • Listen to Payment Success Messages
    • PCI Compliant Card Tokenization
    • Tokenize Card Data via API for Checkout
    • Tokenize Card Data via API for Debit Card Payouts
    • Tokenize Cards for Saved Card Checkout (Vue)
    • Tokenize Debit Cards for Withdraws
    • Upload files to Coinflow storage
LogoLogo
RegisterLoginSandbox Login
On this page
  • Embed in iframe
  • Listen for a postMessage event
Recipes

Listen to Payment Success Messages

Was this page helpful?
Previous

PCI Compliant Card Tokenization

Next
Built with
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.