Payments and integrations

Card payments, the processor webhook, model providers and the regulatory files.

Payment adapters

features/integrations/payment puts three providers behind one interface:

ProviderWhat it does
manualCash, check, ACH, insurer and financing payments recorded by hand.
stripeCard payments over the Stripe API. The mode follows the key: a test key charges Stripe's test network, a live key charges for real.
terminalA card reader. The interface exists and takes manual tender only until a reader is attached.

Every call that moves money carries an idempotency key, so asking again can never charge or refund twice. A network failure is unknown, never failed, and is resolved by asking the processor (payment.check_status).

Cards on file and autopay

card.setup creates the Stripe customer and SetupIntent, the browser confirms it with Stripe Elements, and card.save reads it back from Stripe and stores the payment method id, never the number. Stored cards are charged with the Charge stored cards button after the month-end close, and are never retried automatically.

Webhook

/api/payments/webhook receives payment_intent.succeeded, payment_intent.payment_failed and charge.refunded. The signature is checked first, and each event is recorded once by its id, so a replay changes nothing.

Model providers

The workflow builder and AI drafts call models only through one gateway. It checks the operator's inference policy before any network call, validates the output against a schema, and records each call with digests and token counts, never prompt or response text. Adapters are self_hosted_openai_compat, azure_openai, bedrock (refuses until it is configured) and builtin_rules.

Regulatory files

FileHow it moves
837I claimsExported as a file. A person marks it submitted after uploading the exact file they downloaded.
999, 277CA and 835Parsed from a staff upload. 835 posting is idempotent on payer and trace number.
MDS submissionThe iQIES ZIP from /api/mds/submission, for a staff upload.
PBJThe quarter export for a staff upload.
NHSNThe weekly respiratory vaccination and case CSV.

On this page