https://github.com/netlify/gojoin
Mini API wrapping Stripes Subscriptions for Single Page Aps and JAMstack sites
https://github.com/netlify/gojoin
Last synced: about 2 months ago
JSON representation
Mini API wrapping Stripes Subscriptions for Single Page Aps and JAMstack sites
- Host: GitHub
- URL: https://github.com/netlify/gojoin
- Owner: netlify
- License: mit
- Archived: true
- Created: 2016-10-03T18:01:59.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-08-28T15:20:08.000Z (almost 8 years ago)
- Last Synced: 2024-08-04T01:23:13.123Z (11 months ago)
- Language: Go
- Size: 63.5 KB
- Stars: 41
- Watchers: 12
- Forks: 10
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-list - gojoin
README
# 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](LICENSE).
Please make sure you understand its [implications and guarantees](https://writing.kemitchell.com/2016/09/21/MIT-License-Line-by-Line.html).## 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/:typeThe POST endpoint takes a payload like so
``` json
{
"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`.