arch-atlas

Payment Success Dialog

views/widgets/payment_success_dialog.dart

presentation

Overview

Modal shown the moment PaymentSheet returns success, while completeCart is still in flight. Displays the (still-cart-id-shaped) order id and blocks user input until the order is finalized.

User Flow

  1. showDialog(barrierDismissible: false) is awaited via dialogFuture before the onSuccess callback fires.
  2. completeCart happens INSIDE the dialog's visible window so the user perceives instant success.
  3. Calendar provider.refresh is triggered to update any visible booking grids.

Cases & Edge Cases

  • If completeCart fails AFTER PaymentSheet success, money is captured but order is not finalized — dialog stays visible but onSuccess never fires; the snackbar 'Error: $e' surfaces underneath.
  • Cart id is shown as 'order id' to the user — the actual order id is only available after completeCart, but UX prefers an immediate ack.

Code References

  • lib/src/features/shared/checkout/views/widgets/payment_success_dialog.dart
  • lib/src/features/shared/checkout/controllers/checkout_controller.dart:378 // showDialog

API Calls

Empty — fill this in later. Open the manifest and add content here.

Notes

The dialog is dismissed by the controller's onSuccess callback, not by user tap — pulling barrierDismissible to true would break the await flow.