Commit Graph

2 Commits

Author SHA1 Message Date
Jeff Emmett b80386e85c feat(rpayments): extract QR payment app from rCart into its own rApp
- New modules/rpayments/ with routes, schemas, components, landing, recurring-executor
- Doc ID pattern {space}:payments:{paymentId}; one-time migration from {space}:cart:payments:*
- Cross-module hook onPaymentPaid() — rCart registers handler in onInit to auto-record
  contributions on linked shopping carts when a contribute-pay payment settles
- rCart: drop all /api/payments/*, /payments, /request, /pay/:id, /subscriptions, email
  scheduler, and the inline payments tab in folk-cart-shop; contribute-pay now mints
  via imported rpayments schemas and returns /rpayments/pay/ links
- server/index.ts: register paymentsModule, flip public-endpoint matcher to /rpayments
- Display: rPayments (💳) added to module-display, rstack-app-switcher (Commerce),
  rstack-tab-bar (Funding & Commerce), e2e/fixtures/module-list
- Vite: 3 payment component build entries + payments.css repointed to modules/rpayments
2026-04-18 14:21:11 -04:00
Jeff Emmett 97a077b256 feat(rcart): Layer 3 — automated recurring payment execution via ERC-20 allowance
Recurring Executor (new module):
- Server-managed relayer keypair derived deterministically via HKDF
- Checks on-chain ERC-20 allowance before pulling funds
- Executes transferFrom when subscriptions are due
- Supports Base, Base Sepolia, and Ethereum mainnet

New API Endpoints:
- GET /api/payments/:id/subscription-info — returns relayer address and
  approve calldata for the client to authorize recurring pulls
- POST /api/payments/:id/subscribe — registers a subscription after
  payer approves on-chain allowance, verifies allowance exists

Scheduler Upgrade:
- Attempts automated pull first for subscriptions with approved allowance
- Falls back to email reminder if auto-pull fails or is not configured
- Sends branded receipt email after successful automated payments
- Extracted email templates into reusable helper functions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 21:32:13 +00:00