gateways

package
v0.0.0-...-aa999d4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2017 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Coinage

type Coinage interface {
	NewRoaster(*models.RoasterRequest) (*models.Roaster, error)
	Roaster(uuid.UUID) (*models.Roaster, error)
	DeleteRoaster(uuid.UUID) error
	Plans(uuid.UUID) ([]*models.Plan, error)
	NewPlan(uuid.UUID, *models.PlanRequest) (*models.Plan, error)
	Plan(uuid.UUID, uuid.UUID) (*models.Plan, error)
	DeletePlan(uuid.UUID, uuid.UUID) error
	AddOrUpdateCustomer(*models.CustomerRequest) (*models.Customer, error)
	Customers(int, int) ([]*models.Customer, error)
	Customer(uuid.UUID) (*models.Customer, error)
	NewSubscription(uuid.UUID, *models.SubscribeRequest) error
	DeleteSubscription(uuid.UUID, string) error
	DeleteCustomer(uuid.UUID) error
}

Coinage wraps all API calls to the coinage service

func NewCoinage

func NewCoinage(config config.Coinage) Coinage

NewCoinage initializes and returns a Coinage gateway pointing at the host and

port provided

type Stripe

type Stripe interface {
	NewCustomer(token, userID string) (string, error)
	GetCustomer(id string) (*stripe.Customer, error)
	DeleteCustomer(id string) error
	AddSource(id, token string) (*stripe.Customer, error)
	NewAccount(user *tmodels.User, roaster *tmodels.Roaster) (*stripe.Account, error)
	NewPlan(secret string, item *item.Item, freq models.Frequency) (*stripe.Plan, error)
	GetPlan(secret, pid string) (*stripe.Plan, error)
	ApplicationFee() float64
	FeePercent() float64
	Subscribe(roaster *models.Roaster, id, planID string, quantity uint64) (string, *stripe.Sub, error)
}

Stripe wraps the stripe-go api for coinage use

func NewStripe

func NewStripe(config config.Stripe) Stripe

NewStripe initializes and returns a new Stripe implementation configured

by the provided config

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL