Repository navigation
feat(payments): let clients see their subscription tier - #926
Open
Priyanshubhartistm wants to merge 2 commits into
Open
Priyanshubhartistm wants to merge 2 commits into
Priyanshubhartistm wants to merge 2 commits into
Conversation
Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
🦋 Changeset detectedLatest commit: 0aa7c8c 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.
|
Collaborator
Coverage Report for CI Build 39727008160Coverage increased (+0.2%) to 73.985%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
…e not 32 bytes Signed-off-by: Priyanshubhartistm <bhartipriyanshustm@gmail.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.