Confirm bank details dialog
Confirm a supplier's bank account for pay-by-bank. Shows the account and echoes exactly those details back, so a confirmation is refused if the account changed in the meantime.
Dialog: a modal you open from your own screen. You control when it opens with its props. Pages vs components
Ready to connect to Dolfin. Loads data through SDK hooks, with appearance and behaviour you can customise. Requires DolfinProvider.
Installation
Needs the Dolfin registry token. The CLI copies the source into your app.
bunx --bun shadcn@4.23.0 add @dolfin/ap-confirm-bank-details-dialogAlso installs: button, dialog, base-theme, ap-supplier-details, ui-ap-confirm-bank-details-dialog.
Usage
import { ApConfirmBankDetailsDialog } from "@/components/dolfin/ap/confirm-bank-details-dialog";
// Place it anywhere inside your <DolfinProvider>.
<ApConfirmBankDetailsDialog supplier={supplier} open={open} onOpenChange={handleOpenChange} />Renders inside DolfinProvider (set it up once). By default it loads its own data through the SDK. Supplied-data examples show how to override that behavior.
API reference
| Prop | Type | Description |
|---|---|---|
supplier required | { id?: string; organisationId?: string; name: string; email?: null | string; phone?: null | string; website?: null | string; taxNumber?: nul… | |
open required | boolean | |
onOpenChange required | (open: boolean) => void | |
onConfirmed | (supplier: Supplier) => void | After the confirmation was saved; the dialog has closed. |
onConfirm | (bankDetails: NonNullable<Supplier["bankDetails"]> | null) => void | Promise<unknown> | Confirms the account yourself, with the details exactly as the dialog showed them. Resolve to close the dialog; reject (or set `error`) to keep it open. |
submitting | boolean | |
error | Error | Why the confirmation failed (a `DolfinError` reads as the API's message). |
stale | boolean | The account changed since the dialog opened: confirming is refused. |
className | string |
Customisation
Without editing the source, you can change:
- Class names
className- Messages
ap.supplierscore.errors
Or edit the installed file directly: it is your code. See theming for colours and fonts.
Hooks
The SDK hooks this dialog uses. Use them directly from @dolfinai/react to build your own version.
useMessagesuseSupplierMutationsFiles
Written to your app by the install command:
components/dolfin/ap/confirm-bank-details-dialog.tsx140 lines