Payments: Stripe processing, e-transfer/comp overrides & receipts #7

Closed
opened 2026-06-05 12:57:38 +00:00 by thatguygriff · 1 comment
Owner

Take payment at registration. Default rail is credit card via Stripe; studio admin can set a student to e-transfer (recorded, marked paid manually) or comp (no charge). Single bookings charged once; weekly/group charged full-term upfront. Numbered receipt emailed automatically on payment.

Spec: docs/features/payments.md

Scope

  • Stripe creds as WP options on a Studio Settings page (manage_billing): publishable/secret key, mode, currency
  • Per-student method via user meta us_payment_method (card/etransfer/comp), default card
  • New table {prefix}us_payments (amount, currency, method, status, stripe_payment_intent_id, receipt_number, receipt_sent_at, paid_at, polymorphic registration ref)
  • Domain package src/Payment/: Payment, PaymentRepository, StripeGateway, ReceiptMailer, StudioSettings, PaymentEndpoint
  • REST: POST /payments/intent (book_lesson), POST /payments/webhook (Stripe signature verified), PATCH /payments/{id} (manage_billing)
  • On transition to paid: confirm linked registration, assign receipt number, email receipt

Acceptance

  • Card charge + webhook confirmation works; e-transfer manual mark-paid works; comp skips charge; receipts sent once; tests under tests/Unit/Payment/ passing
Take payment at registration. Default rail is credit card via Stripe; studio admin can set a student to e-transfer (recorded, marked paid manually) or comp (no charge). Single bookings charged once; weekly/group charged full-term upfront. Numbered receipt emailed automatically on payment. **Spec:** `docs/features/payments.md` ## Scope - Stripe creds as WP options on a **Studio Settings** page (`manage_billing`): publishable/secret key, mode, currency - Per-student method via user meta `us_payment_method` (`card`/`etransfer`/`comp`), default `card` - New table `{prefix}us_payments` (amount, currency, method, status, stripe_payment_intent_id, receipt_number, receipt_sent_at, paid_at, polymorphic registration ref) - Domain package `src/Payment/`: `Payment`, `PaymentRepository`, `StripeGateway`, `ReceiptMailer`, `StudioSettings`, `PaymentEndpoint` - REST: `POST /payments/intent` (`book_lesson`), `POST /payments/webhook` (Stripe signature verified), `PATCH /payments/{id}` (`manage_billing`) - On transition to `paid`: confirm linked registration, assign receipt number, email receipt ## Acceptance - Card charge + webhook confirmation works; e-transfer manual mark-paid works; comp skips charge; receipts sent once; tests under `tests/Unit/Payment/` passing
thatguygriff added the paymentsfeature labels 2026-06-05 12:57:38 +00:00
Author
Owner

Closing as complete. Implemented and merged across PR #25 (foundation: e-transfer/comp, config, receipts) and PR #28 (live Stripe card charges + webhook).

Closing as complete. Implemented and merged across PR #25 (foundation: e-transfer/comp, config, receipts) and PR #28 (live Stripe card charges + webhook).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Unsupervised/unsupervised-scheduler#7