Repository navigation
feat(payments): let clients see their subscription tier - #926
Conversation
Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
🦋 Changeset detectedLatest commit: 9233875 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
[Medium impact] The PR appears safe to merge; no new actionable issues were found.
|
Coverage Report for CI Build 40761863761Warning No base build found for commit Coverage: 76.545%Details
Uncovered Changes
Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats💛 - Coveralls |
…e not 32 bytes Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
|
@Priyanshubhartistm Let's please fix the issue flagged by Greptile |
…f the status Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
Dismissed because a newer commit was pushed; Greptile will re-review the current head.
Description
Builds on the subscription lifecycle (#909). Nothing changes unless
payments.enabledis true andpayments.subscriptionPlansis non-empty.fees.subscription, one entry per plan withamountin msats,unit, andperiodin seconds (the standard NIP-11 shape), plusid, which is what a client sends asplanIdtoPOST /invoices, anddescriptionwhen the plan has one.limitation.restricted_writesis now true when plans are in use, since a subscription is what lets a pubkey write even without an admission fee.GET /subscriptions/status?pubkey=<hex or npub>returns the pubkey'splanId,status,active,currentPeriodEndandaccessEndsAt(ISO dates, null when it never ends).activeis judged from the dates, as the write gate does, so grace counts and a lapsed subscription the sweep has not reached yet does not. A pubkey with no subscription gets nulls andactive: false. It answers 400 for an invalid pubkey and 404 while plans are off, and is counted againstlimits.invoice.rateLimitsunder its own key.CONFIGURATION.mddescribes both.Related Issue
Closes #925
Motivation and Context
The endpoint is public, like
/admissions/check/:pubkey, and only reports what the relay already enforces for that pubkey.