ADR 0014: Stripe Checkout prepaid credits and Stripe Connect payouts first
Context
Real money needs two sides at once. Buyers (agent owners) need a familiar way to pay. Researchers need a way to withdraw their royalties, because earnings that can't be withdrawn are no reason to contribute. Agent-native rails (x402, MPP, stablecoins) are attractive, but today few buyers hold stablecoin wallets. They would also need rework of the owner-authorized spend-policy model.
Decision
- Buyers fund prepaid credits through Stripe Checkout (cards and wallets on a hosted page). Funds are credited only after a signed webhook, or a server-side session retrieval, confirms payment for the exact amount. A redirect alone never credits funds.
- Researchers are paid through Stripe Connect Express accounts, using separate charges and transfers: the platform receives buyer funds, the existing royalty engine allocates them internally, and settlement batches transfer per verified legal owner. Stripe-hosted onboarding collects identity, bank and tax data; DataRebel stores only the account id.
- Provider webhooks are translated into a provider-independent vocabulary (
ProviderEventView) and handled in the domain layer (payments/webhooks.py). The ledger, metering, attribution and royalties stay provider-independent. - Billing (
stripe) and payouts (stripe_connect) are separate providers with separate webhook endpoints, secrets and clearing accounts, and both are reconciled. - Everything stays behind flags that default to off. x402, MPP and stablecoin payouts follow later as additions.
Consequences
- Refunding unused credit requires unallocated funds, so owners reclaim agent budgets first.
- Refunds made in the Stripe Dashboard, and partial transfer reversals, are flagged for audited adjustment instead of being mirrored automatically.
- Contributor coverage is limited to the countries Stripe Connect supports. Stablecoin payouts are the candidate extension for the rest.
- The adapter was written without access to Stripe's docs from the development environment. The go-live
checklist in
docs/payments/stripe.mdrequires verifying it against the current docs and running it in test mode first.