The Wayback Machine - https://web.archive.org/web/20221116061057/https://github.com/netlify/gojoin
Skip to content
This repository has been archived by the owner. It is now read-only.

netlify/gojoin

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

GoJoin

This acts as a proxy to Stripe. It exposes a very simple way to call Stripe's subscription endpoints.

GoJoin is released under the MIT License. Please make sure you understand its implications and guarantees.

authentication

All of the endpoints rely on a JWT token. We will use the user ID set in that token for the user information to Stripe.

The API as is:

GET /subscriptions -- list all the subscriptions for the user

This endpoint will return a list of subscriptions, but also a JWT token that has been decorated with an app_metadata.subscriptions property which is a map of the users subscriptions.

These endpoints are all grouped by a type of subscription. For instance if you have a membership type with plan levels gold, silver, and bronze.

GET /subscriptions/:type
POST /subscriptions/:type
DELETE /subscriptions/:type

The POST endpoint takes a payload like so

    {
        "stripe_key": "xxxxx",
        "plan": "silver"
    }

Using this endpoint will create the plan if it doesn't exist, otherwise it will change the subscription to that plan. The other responses are defined in api/subscriptions.go.

About

Mini API wrapping Stripes Subscriptions for Single Page Aps and JAMstack sites

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published