Record payment dialog
Logs a payment received off-platform against an invoice: amount (checked to be more than zero), date, reference and notes.
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/ar-record-payment-dialogAlso installs: button, dialog, input, label, textarea, base-money, ui-ar-record-payment-dialog.
Usage
import { RecordPaymentDialog } from "@/components/dolfin/ar/record-payment-dialog";
// Place it anywhere inside your <DolfinProvider>.
<RecordPaymentDialog invoice={invoice} 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 |
|---|---|---|
invoice required | Pick<{ id?: string; organisationId?: string; customerId?: string; documentNumber?: null | string; currency: string; issueDate?: string; dueD… | |
open required | boolean | |
onOpenChange required | (open: boolean) => void | |
onRecorded | () => void | Called once the payment was recorded. |
onSubmit | (payment: InvoicePaymentInput) => Promise<unknown> | void | Records it yourself instead of the SDK; the dialog closes once it resolves. |
submitting | boolean | Your own save is running. |
Customisation
Without editing the source, you can change:
- Messages
ar.invoice.recordPayment
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.
useInvoiceActionsuseMessagesFiles
Written to your app by the install command:
components/dolfin/ar/record-payment-dialog.tsx94 lines