Repository navigation
Payments Architecture
How money moves — and deliberately does not move through the platform. The decision is ADR-0002; implementation plans are in Plans - Payments and Currency.
Yosemite Crew is "software and governance only." It is not a payment facilitator and never holds clinic funds:
- Each clinic connects a Stripe Standard Connect account.
- Charges are direct charges created on the clinic's connected account (
stripeAccount: organisation.stripeAccountId), not on the platform account. - The clinic bears processing fees, disputes, and refund liability directly with Stripe. The platform takes no platform fee / application fee.
This keeps the platform out of payment-facilitator / money-transmitter regulatory scope and lets clinics keep their own Stripe dashboard and portable payment history. Full rationale and trade-offs (Connect KYC onboarding required, less platform control over the flow): ADR-0002. The Standard Connect + direct-charges model shipped via PR #1680.
flowchart LR
OWNER[Pet owner] -->|pays| STRIPE[Stripe<br/>clinic's connected account]
CLINIC[Clinic] -->|owns| STRIPE
API[apps/backend] -->|creates PaymentIntent<br/>on connected account| STRIPE
STRIPE -->|funds settle to| CLINIC
API -.no fee, no custody.-> PLATFORM[Yosemite Crew platform]
Stripe is one implementation behind a PaymentProviderPort interface (the "agnostic payments" principle) rather than hard-wired throughout the backend. This is the seam for adding new providers without touching call sites. As of ADR-0002 the port is in progress and not fully merged — until it lands, some Stripe-specific code sits directly in services.
Adyen for Platforms was evaluated and dropped: it requires the platform to act as the regulatory principal for sub-merchants, which conflicts with the merchant-of-record-is-the-clinic principle. For clinics that need point-of-care lending, the platform integrates CareCredit and Scratchpay instead — financing partners with a direct clinic-to-provider relationship. See the payment-gateway abstraction epic #1659.
Clinics operate in different currencies, so money is currency-aware end to end:
-
Currency is chosen at org onboarding and immutable afterward (
localeFinalizedlocks it). Amounts are stored in minor units (cents) with an ISO 4217 currency code. - A single presentation system formats EUR / USD / GBP consistently across invoices, payments, inventory, expenses, and subscriptions — on web, mobile, and backend.
The rollout is documented across three implementation guides (backend + Stripe, web, mobile) collected in Plans - Payments and Currency.
Invoices, subscriptions, expenses, treatment-plan estimates, deposits, and refunds are modeled in Postgres and reconciled against Stripe events. The per-subsystem detail lives in Backend: Billing, Invoices, Subscriptions.
A billing-correctness pass landed across 2026-08: invoices now settle only once Stripe reports the funds actually arrived, zero-decimal currencies are honoured in amount handling, the appointment billing lock is enforced server-side rather than trusted to the client, an approved estimate converts directly into an invoice (PR #2429), superseded Stripe artifacts are expired when billing state changes, and a booking invoice is bound to its Stripe payment intent (PR #2477).
Home · Architecture · ADRs · Plans · Roadmap · Contributing · Main repo · DeepWiki · Discord
Yosemite Crew is a product of DuneXploration UG (haftungsbeschränkt). This wiki mirrors the repository; where a page and the repo disagree, the repo wins. See the Wiki Style Guide.
Product & Domain
Architecture
Applications
- Backend — Overview
- Frontend / PIMS Web — Overview
- Mobile — Overview
- Desktop PIMS Shell
- Developer Portal
- SuperAdmin
Design & Accessibility
Engineering Handbook
Decisions (ADRs)
Design Docs & Plans
Meta
Canonical code & docs: main repo · Auto-generated companion: DeepWiki