commit e5fd0754f46cbbe3e1c13ffea2b8a57dc0391940 Spenser Truex <truex@equwal.com> 2026-09-22 16:10:51 -0700 Merge pull request #6 from equwal/caption-hours Sell hours of cloud captions for Subrep
backend/accounts.py | 3 + backend/captions.py | 253 +++++++++++++++++++++++++++++++++++++++++++++++++ backend/main.py | 2 + backend/payments.py | 6 +- backend/settings.py | 9 ++ tests/test_captions.py | 223 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 495 insertions(+), 1 deletion(-)
diff --cc backend/payments.py index a4790db,6653225..26d4953 --- a/backend/payments.py +++ b/backend/payments.py @@@ -229,10 -222,9 +232,11 @@@ def fulfil(session: Session, checkout: if checkout.get("customer") and not account.stripe_customer_id: account.stripe_customer_id = checkout["customer"] - if plan.credits: + # A pack adds credits that never expire. A monthly plan adds none here: + # its books come from the subscription, month by month. + if plan.credits and not plan.recurring: account.purchased_credits += plan.credits + captions.fulfil(session, account, plan) session.commit() if checkout.get("subscription"):