SUQODocs
User GuideAPI ReferenceSDKs

Debug with events

The onEvent stream and the unavailable event in the SUQO Flutter SDK.

onEvent is a debug stream

Pass onEvent to SuqoCheckout.open or to SuqoProvider to see what the screen is doing. It is not a payment signal — the awaited outcome is that.

Every SuqoEvent carries sessionId and a type; the other fields are null unless the row below names them.

typeWhen
openopen was called and the screen is about to show.
aliveThe document loaded and ran scripts.
readyThe payment block is on screen.
resizeheight — reported, but nothing here is sized by it.
gatewayThe page is navigating this WebView to a gateway.
handoffscheme — a bank/wallet deeplink was handed to the OS.
handoff_failedscheme — the OS had nothing registered to open it. intent for an Android intent URI — declare its scheme= target, not intent.
load_timeoutstage ('alive' or 'ready') — a load deadline elapsed.
load_errorThe WebView itself failed to load the page.
unavailablereason — the session cannot be paid at all. See below.
settledoutcome — the screen's one outcome, mirroring what open completed with.

Events are delivered after the frame that mounts the screen, never during it, so a handler that calls setState is safe.

Events handed to you carry the real sessionId, since it is your own identifier. Redaction applies to what this package prints itself: with debug: true, its log output scrubs session ids, URLs and gateway params.

unavailable is an event, not a callback

When the session cannot be paid at all, the page renders its own explanation and the buyer dismisses, which completes as SuqoClosed. The unavailable event is how you find out why:

await SuqoCheckout.open(
  context,
  sessionId: sessionId,
  onEvent: (event) {
    if (event.type == 'unavailable') {
      debugPrint('session not payable: ${event.reason!.name}');
    }
  },
);
SuqoUnavailableReasonMeans
notFoundNo such session at this origin (often the wrong environment).
expiredThe session's window has passed.
spentIt has already been paid.
noCustomerIt was created without a customer assigned.
noMethodsThe seller has no payment method the buyer can use.
loadFailedThe block could not load its own data.

It is usually a sign your own integration created the session wrong — most often an expired or already-used id, a sandbox session opened in live mode, or noCustomer, which this package has no field to supply after the fact.

On this page