Skip to content
Get started
Menu
Get started

Status and receipt

Try the Checkout and Recovery block for a runnable mobile journey from review through an unknown result to a confirmed receipt. The Manual VA transfer block shows an issued virtual account whose deadline never decides the payment. The QRIS checkout block uses the same status flow with a host-issued QR image instead of a virtual account. The Wallet handoff block uses it to recover the same payment after switching apps. The Payment and refund detail block keeps the original payment intact beside its refund.

Renders one payment attempt from host-authoritative data. It never infers success, never polls, and never offers paying again while the outcome is unresolved.

Your app supplies the status snapshots, polling, the virtual account and its expiry, cancellation and refunds, and the share and clipboard implementations.

Unknown outcome: hatched band, Result not confirmed yet, amount, Don't pay again, Check status, payment reference.Unknown outcome: hatched band, Result not confirmed yet, amount, Don't pay again, Check status, payment reference.
Unknown outcome
Pending in Indonesian: solid amber band, Menunggu, amount and explanation, the payment reference, and Cek status pinned at the bottom.
Pending (Indonesian)
Virtual account instructions in Indonesian inside the status view: monospace number with copy, amount, countdown, folded steps.Virtual account instructions in Indonesian inside the status view: monospace number with copy, amount, countdown, folded steps.
PaymentInstructions in the instructions slot (Indonesian)
Receipt in Indonesian with a green success band, merchant, amount, date, line items, total, masked method and pinned Selesai and Lihat detail actions.Receipt in Indonesian with a green success band, merchant, amount, date, line items, total, masked method and pinned Selesai and Lihat detail actions.
PaymentReceipt (Indonesian)
final va = attempt.snapshot?.instructions;
PaymentStatusView(
attempt: attempt,
amount: quote.total,
busyAction: checking ? PaymentAction.checkStatus : null,
instructions: va == null
? null
: PaymentInstructions(
instructions: va,
clock: host.clock,
onCopyNumber: copyToClipboard, // Future<bool> Function(String)
onElapsed: refreshStatus,
),
onAction: (action) => switch (action) {
PaymentAction.checkStatus => refreshStatus(),
PaymentAction.viewReceipt => openReceipt(),
_ => host.handle(attempt.attemptId, action),
},
);
RefundSection(refund: snapshot.refund, paidAmount: quote.total);
// A screen's body: the receipt scrolls and Done pins to the footer (D62).
PaymentFullPageView(
title: 'Receipt',
primaryAction: PaymentButton(label: 'Done', onPressed: finish),
secondaryAction: PaymentButton(
label: 'View details',
variant: PaymentButtonVariant.quiet,
onPressed: openDetail,
),
child: PaymentReceipt(
data: receiptData, // only for a payment your host confirmed as succeeded
onShare: (share) => host.share(share.title, share.text), // Future<ShareOutcome>
onCopyTransactionId: copyToClipboard,
),
);

The full sequence, including PaymentAttempt and reconcile, is in the Quick start.

  • Pinned action. Given a bounded height, for example as a Scaffold body, the status scrolls and the first action pins to a footer at the bottom. Under it goes one quiet action: your secondaryAction (such as “Done” once the attempt is final), otherwise “Contact support”. The other actions stay in the content as hug buttons, after the instructions. Pass a banner, such as “Cancellation requested”, as header so it scrolls with the status. Inside a scroll view every action follows the status as before.
  • Actions come only from attempt.availableActions. While the outcome is unknown that is checkStatus alone. startNewAttempt appears only when your host allows it and the previous attempt is final and not a success.
  • Unknown reads “Don’t pay again.” first, with a hatched band. The “last updated” row appears only once a host snapshot exists.
  • Instructions sit after the explanation and before the actions, so the account to pay into comes before Check status. Above 1.5× text, when the actions are inline, they move after the actions; with a pinned footer they keep their place. They are not shown while the outcome is unknown, where an account to pay into would read as an invitation to pay again.
  • Countdown uses the host clock and stops at zero; the widget only reports onElapsed and keeps the status check available. The virtual account number is set in the reference (monospace) font and steps fold under “How to pay”.
  • Refunds appear in RefundSection, beside the original payment, never instead of it. A refund above paidAmount is treated as invalid host data.
  • Receipt sharing hands your callback only ReceiptShareData: merchant, transaction ID, time, total and the masked method. Line items and account identifiers are excluded. A failed or dismissed share never changes the receipt or the payment.

The local example’s example/lib/compositions/host_payment_recovery.dart combines the existing status and receipt patterns without DemoCoordinator. Copy it into the host alongside your product theme, such as ProductLooks in host_checkout.dart. It is example source, not an exported package API or an installed block system.

Pass the restored PaymentAttempt, amount and optional host-loaded receipt. onAction(attemptId, action) returns the host operation’s future: a status check reconciles that same attempt, never submits a new payment. Rebuild with the updated attempt; use Observation.unavailable while retaining its last trusted snapshot when refresh fails. Persistence, reconciliation ordering, retries, networking and routing stay with the host.

Receipt rendering requires an accepted attempt with a succeeded host snapshot and a receipt whose transactionId matches attempt.serverReference. Early data, another transaction’s receipt and an official correction away from success remain on the status view. The host must validate the full receipt payload; matching an identifier is only a presentation guard. While loading or retrying a receipt, pass busyAction and a safe notice through header; keep returning the callback future for local repeat protection. Share and copy callbacks use the existing allowlist and feedback behavior.

Try Host payment recovery in the gallery’s Status & receipt section. Unknown offers a status check for the restored reference; the synthetic host returns a confirmed success fixture. Offline pending keeps the last known payment, and Receipt shows the confirmed result. These fixtures make no payment or platform call.

Host recovery shows an unknown payment outcome and Check status without an action to pay again.Host recovery shows an unknown payment outcome and Check status without an action to pay again.
Restored host attempt with unknown outcome, no pay-again action and a status check.
Host recovery retains pending and shows a failed refresh notice above the status action.Host recovery retains pending and shows a failed refresh notice above the status action.
Last-known pending payment retained after an unavailable status refresh.
A matching host-confirmed receipt shows the payment breakdown and Done action.A matching host-confirmed receipt shows the payment breakdown and Done action.
Host-confirmed receipt matched to the restored payment transaction.

PaymentStatusView

class PaymentStatusView extends StatelessWidget · lib/src/payment/payment_status.dart

Renders an attempt from host-authoritative data.

The view never infers success, never polls and never offers paying again while the outcome is unresolved. Actions come from PaymentAttempt.availableActions.

Given a bounded height, e.g. as a screen's body, the status scrolls and the first action pins to a footer at the bottom, with secondaryAction or the quiet contact-support under it; other actions stay in the content as hug buttons (D62). Inside a scroll view all actions follow the status, as before.

ParameterTypeDefaultDescription
attempt:requiredPaymentAttempt——
onAction:requiredFutureOr<void> Function(PaymentAction action)——
amount:Money?——
busyAction:PaymentAction?—Action whose host call is running, shown as busy.
instructions:Widget?—Manual payment instructions, shown after the explanation and before the actions, so the account to pay into comes before Check status.

Above 1.5× text, inside a scroll view, they move after the actions; with a pinned footer they keep their place. Not shown while the outcome is unknown, where an account to pay into would read as an invitation to pay again.

header:Widget?—Host content shown above this widget's content, inside its scroll region (D62), e.g. a banner.
secondaryAction:PaymentButton?—One quiet host action under the primary, e.g. "Done". It takes the footer's quiet slot; contact support then stays in the content.

PaymentInstructions

class PaymentInstructions extends StatelessWidget · lib/src/payment/payment_status.dart

Manual transfer instructions (for example a virtual account).

The countdown uses the host clock and stops at zero. Reaching zero is not proof the customer did not pay, so the widget only reports onElapsed and keeps the status check available.

ParameterTypeDefaultDescription
instructions:requiredVirtualAccountInstructions——
clock:requiredDateTime Function()——
onCopyNumber:Future<bool> Function(String value)?—Host clipboard; returns false when copying failed.
onElapsed:VoidCallback?——

VirtualAccountInstructions

class VirtualAccountInstructions · lib/src/payment/payment_models.dart

ParameterTypeDefaultDescription
providerLabel:requiredString——
accountNumber:requiredString——
amount:requiredMoney——
expiresAt:requiredDateTime——
steps:List<String>const []—

RefundSection

class RefundSection extends StatelessWidget · lib/src/payment/payment_status.dart

Refund lifecycle shown beside, never instead of, the original payment.

ParameterTypeDefaultDescription
refund:requiredRefundInfo——
paidAmount:Money?—Original amount; a refund above it is treated as invalid host data.

PaymentReceipt

class PaymentReceipt extends StatefulWidget · lib/src/receipt/payment_receipt.dart

Receipt for a payment the host confirmed as succeeded.

Sharing hands the host only ReceiptShareData built from an allowlist. A failed or dismissed share never changes the receipt or the payment.

ParameterTypeDefaultDescription
data:requiredPaymentReceiptData——
onShare:Future<ShareOutcome> Function(ReceiptShareData data)?——
onCopyTransactionId:Future<bool> Function(String transactionId)?——

PaymentReceiptData

class PaymentReceiptData · lib/src/receipt/receipt_models.dart

Receipt detail for a payment the host has confirmed as succeeded.

Contains no KYC data, credentials or raw provider payload.

ParameterTypeDefaultDescription
transactionId:requiredString——
merchantName:requiredString——
paidAt:requiredDateTime——
lines:requiredList<QuoteLine>——
total:requiredMoney——
methodLabel:requiredString—Already masked by the host, e.g. "Saldo •••• 2190".
refund:RefundInfoconst RefundInfo(status: RefundStatus.none)—

ReceiptShareData

class ReceiptShareData · lib/src/receipt/receipt_models.dart

The only fields that leave the app when a receipt is shared.

ParameterTypeDefaultDescription
title:requiredString——
text:requiredString——
fields:requiredMap<String, String>——

ReceiptShareData.fromReceipt(…) — Builds the allowlisted share payload. Line items, account identifiers and anything not listed here are deliberately excluded.

ParameterTypeDefaultDescription
receiptrequiredpositionalPaymentReceiptData——
title:requiredString——
labels:requiredMap<String, String>——
moneyFormat:requiredMoneyFormat——
formatDate:requiredString Function(DateTime)——

ShareOutcome

enum ShareOutcome · lib/src/receipt/receipt_models.dart

Result reported by the host's share or clipboard implementation.

ValueDescription
shared—
dismissed—
failed—

PaymentAttempt, PaymentStatusSnapshot and the status enums are on Payment attempt and status.

Copy confirms inline beside the value with a temporary check. A failure stays beside the ID. Receipt banners report share feedback only.

The virtual account uses PaymentCode: a muted tag, reference face, grouped numeric speech and host copy feedback.

Use Property list for grouped payment facts and Table for fee schedules.

Button group now composes related status and dialog actions. Overflow menus wrap long labels at large text.

Use the Checkout and recovery block for a complete host composition from checkout through status and receipt.