implement core foundation
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package billing
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
)
|
||||
|
||||
// Noop returns a billing service for binaries that depend on network.Service
|
||||
// but never mutate membership (jobs, pusher). Stripe isn't configured.
|
||||
func Noop() Service { return noopService{} }
|
||||
|
||||
type noopService struct{}
|
||||
|
||||
var errNoopBilling = errors.New("billing: not configured in this process")
|
||||
|
||||
func (noopService) GetStatus(context.Context, string) (*Status, error) {
|
||||
return nil, errNoopBilling
|
||||
}
|
||||
func (noopService) CreateCheckoutSession(context.Context, CheckoutParams) (string, error) {
|
||||
return "", errNoopBilling
|
||||
}
|
||||
func (noopService) CreatePortalSession(context.Context, string) (string, error) {
|
||||
return "", errNoopBilling
|
||||
}
|
||||
func (noopService) SyncSeats(context.Context, string, int) error { return nil }
|
||||
func (noopService) HandleWebhook(context.Context, []byte, string) error { return errNoopBilling }
|
||||
Reference in New Issue
Block a user