Skip to content
This repository has been archived by the owner on Apr 4, 2022. It is now read-only.

Check sponsorship tiers #3

Open
driesvints opened this issue Aug 21, 2021 · 0 comments
Open

Check sponsorship tiers #3

driesvints opened this issue Aug 21, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@driesvints
Copy link
Owner

driesvints commented Aug 21, 2021

With this library it should be possible to check if users are sponsoring through specific tiers. This will allow for even more fine-graned ACL capabilities and perk-granting.

The API would look as something like below. The used token is that of the "driesvints" GitHub account.

// Check if nunomaduro is sponsoring driesvints on the "$5 a month" tier:
$client->hasTier('nunomaduro', '$5 a month');

// Through the Sponsorable trait...
$user->hasTier('$5 a month');

// If the Sponsorable has its own token set and wants to check if they are sponsoring on a specific account:
$user->hasTierOn('$5 a month', 'nunomaduro');

These requests would always need to be made from the viewer's standpoint so the used token will need to be properly set. These API's probably need to be fleshed out some more.

GraphQL field of "tier":

tier {
    closestLesserValueTier {
        name
    }
    createdAt
    isCustomAmount
    isOneTime
    monthlyPriceInCents
    monthlyPriceInDollars
    name
    updatedAt
}

All tiers also have internal ID's on their node through their GraphQL field. But these aren't surfaced in the UI of GitHub Sponsors.

@driesvints driesvints added the enhancement New feature or request label Aug 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant