Skip to content

togo-framework/subscriptions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

togo

togo-framework/subscriptions

marketplace pkg.go.dev MIT

Part of the togo framework.

Install

togo install togo-framework/subscriptions

togo

togo · subscriptions

Subscription management for togoplans, subscribe / cancel / change, trials, and status — built on the payment plugin. Charges are delegated to whatever PaymentProvider is registered in the kernel; with no payment provider installed it still manages subscription state.

Install

togo install togo-framework/subscriptions
# usually alongside a payment provider:
togo install togo-framework/payment-stripe

Tables (plans, subscriptions) are created on boot.

API

Method Path Description
GET /api/plans List plans
POST /api/plans Create a plan ({name, price, currency, interval, features})
GET /api/subscriptions?user_id= A user's subscriptions
POST /api/subscriptions Subscribe ({user_id, plan_id, trial_days})
POST /api/subscriptions/{id}/cancel Cancel
POST /api/subscriptions/{id}/change Upgrade/downgrade ({plan_id})

Payment integration

The plugin looks up the payment service from the kernel container and, if it satisfies the local Charger interface (CreateSubscription), creates a provider-side subscription and stores the provider_ref. No hard import on payment, so subscriptions builds and runs standalone.

MIT


Premium sponsors

ID8 Media  ·  One Studio

Support togo — become a sponsor.

About

Subscription management for togo — plans, trials, subscribe/cancel/change, over the payment plugin

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors

Languages