dolfindevelopers

Record payment dialog

DialogReceivablesSDK + UI

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

Choose your integration

Ready to connect to Dolfin. Loads data through SDK hooks, with appearance and behaviour you can customise. Requires DolfinProvider.

Loading preview…

Installation

Needs the Dolfin registry token. The CLI copies the source into your app.

Terminal
bunx --bun shadcn@4.23.0 add @dolfin/ar-record-payment-dialog

Also installs: button, dialog, input, label, textarea, base-money, ui-ar-record-payment-dialog.

Usage

screen.tsx
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

PropTypeDescription
invoice requiredPick<{ id?: string; organisationId?: string; customerId?: string; documentNumber?: null | string; currency: string; issueDate?: string; dueD…
open requiredboolean
onOpenChange required(open: boolean) => void
onRecorded() => voidCalled once the payment was recorded.
onSubmit(payment: InvoicePaymentInput) => Promise<unknown> | voidRecords it yourself instead of the SDK; the dialog closes once it resolves.
submittingbooleanYour 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.

useInvoiceActionsuseMessages

Files

Written to your app by the install command:

  • components/dolfin/ar/record-payment-dialog.tsx 94 lines