Skip to content

Buy Foundations through RevenueCat, and let entitlement expire - #602

Open
maximsan wants to merge 1 commit into
mainfrom
feat/revenuecat-purchase
Open

Buy Foundations through RevenueCat, and let entitlement expire#602
maximsan wants to merge 1 commit into
mainfrom
feat/revenuecat-purchase

Conversation

@maximsan

Copy link
Copy Markdown
Owner

Why

The app could not take money. This builds the store behind all three pricing
arms — #421, which stays open until the sandbox criteria can actually be run.
The ruling is ADR-0024,
which supersedes ADR-0003.

Watch for

  • None of this has met a real store. It is written against the
    purchases_flutter API and compiles, but no call has run against RevenueCat
    or StoreKit. Every judgement below is unverified until the account work in
    docs/10-payments.md is done.
  • An owner who restarts reads as a one-time buyer. purchasedTerm is
    session-only, so a yearly subscriber returning to Settings → Purchases sees
    Owned · Nothing renews and no Manage subscription row. Wrong for them,
    and I'd rather you rule on the fix than pick one — needs either persisting
    the term or asking the store what is active.
  • purchaseUpdates is gone, replaced by entitlementChanges. It had no
    consumer anywhere in lib/; the stream that was actually needed is the one
    that reports a lapse.
  • The Purchases body lives in features/monetization/, not profile/.
    The payments seam guard forbids anything outside the paywall layer reading
    which arm a learner is on, and this screen's copy changes per arm. The
    Settings file is the frame only.
  • Offline falls back to the last known answer. RevenueCat serves cached
    customer info, so a throw means it has never answered; guessing false
    there would lock out a paying learner.
  • GRANT_COURSE wins over REVENUECAT_KEY when both are passed, so a
    development build that asked for the owned state still gets it.

Not here

Checks

  • flutter test — 3193 pass, 11 new.
  • The expiry test was checked against a deliberately broken build first: with
    the change-stream watch removed it fails Expected: false, Actual: true.
  • Metrics, format, comment cap, guard tests and the changelog check all ran in
    the pre-push hook.
  • SPM resolves purchases-ios-spm 5.88.0, so the Podfile-free iOS setup
    survives the new dependency.

Implements the store behind all three pricing arms (#421). RevenueCat holds
the entitlement, prices the plans and says which arm a learner is on;
offeringFor stays the one home for what each arm sells.

Entitlement stops being a one-shot answer: courseEntitlement watches the
store's own change stream, so a subscription that lapses, is refunded or
fails to renew locks the course with no restart.

Settings -> Purchases becomes real: what you own and how it is billed, or
the arm's offer, Restore, and a link out to Apple for a renewing plan.

ADR-0024 supersedes ADR-0003. A build reaches a store only when given
REVENUECAT_KEY, so the shipped app stays free by construction.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant