Documentation
¶
Index ¶
- type Customer
- func (c *Customer) AddSource(customer *models.Customer, token string) (*models.Customer, error)
- func (c *Customer) Delete(id uuid.UUID) error
- func (c *Customer) Get(id uuid.UUID) (*models.Customer, error)
- func (c *Customer) GetByCustomerID(id string) (*models.Customer, error)
- func (c *Customer) GetSubscribed(customerID string) (*models.Subscribed, error)
- func (c *Customer) GetSubscribedFromConnected(connectedID string) (*models.Subscribed, error)
- func (c *Customer) Insert(req *models.CustomerRequest) (*models.Customer, error)
- func (c *Customer) InsertSubscribed(customerID, connectedID, stripeSubId string, roasterID uuid.UUID) error
- func (c *Customer) Subscribe(id uuid.UUID, roaster *models.Roaster, plan *models.Plan, ...) error
- type Event
- type Plan
- func (p *Plan) Delete(id, planID string) error
- func (p *Plan) Get(roaster *models.Roaster, itemID uuid.UUID) (*models.Plan, error)
- func (p *Plan) GetByRoaster(roaster *models.Roaster, offset int, limit int) ([]*models.Plan, error)
- func (p *Plan) Insert(roaster *models.Roaster, req *models.PlanRequest) (*models.Plan, error)
- func (p *Plan) Update(id string, itemID uuid.UUID) (*models.Plan, error)
- type Roaster
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Customer ¶
type Customer struct { Stripe gateways.Stripe TC t.TownCenterI // contains filtered or unexported fields }
Customer helps with creating and manipulating stripe customers
func NewCustomer ¶
NewCustomer initializes a Customer with the given gateways
func (*Customer) AddSource ¶
AddSource creates a new stripe source and sets it as default for the
given customer
func (*Customer) GetByCustomerID ¶
func (*Customer) GetSubscribed ¶
func (c *Customer) GetSubscribed(customerID string) (*models.Subscribed, error)
func (*Customer) GetSubscribedFromConnected ¶
func (c *Customer) GetSubscribedFromConnected(connectedID string) (*models.Subscribed, error)
func (*Customer) Insert ¶
Insert creates a new stripe customer with the given id and token, inserting a record
into the db
func (*Customer) InsertSubscribed ¶
type Event ¶
type Event interface {
Send(*stripe.Event) error
}
Event helps with manipulating roaster properties
type Plan ¶
type Plan struct { Stripe gateways.Stripe Warehouse w.Warehouse // contains filtered or unexported fields }
Plan manages retrieval and manipulating roaster plan information
func (*Plan) GetByRoaster ¶
GetByRoaster returns all plans associated with a roaster
type Roaster ¶
type Roaster struct { Stripe gateways.Stripe TC towncenter.TownCenterI // contains filtered or unexported fields }
Roaster helps with manipulating roaster properties
func NewRoaster ¶
func NewRoaster(sql g.SQL, stripe gateways.Stripe, towncenter towncenter.TownCenterI) *Roaster
NewRoaster initializes and returns a roaster with the given gateways
func (*Roaster) GetByAccountID ¶
func (*Roaster) GetByUserID ¶
GetByUserID returns the roaster account associated with a user id