helpers

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: 11 Imported by: 0

Documentation

Index

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

func NewCustomer(sql g.SQL, stripe gateways.Stripe, tc t.TownCenterI) *Customer

NewCustomer initializes a Customer with the given gateways

func (*Customer) AddSource

func (c *Customer) AddSource(customer *models.Customer, token string) (*models.Customer, error)

AddSource creates a new stripe source and sets it as default for the

given customer

func (*Customer) Delete

func (c *Customer) Delete(id uuid.UUID) error

Delete removes a customer from strip and the db

func (*Customer) Get

func (c *Customer) Get(id uuid.UUID) (*models.Customer, error)

Get returns a customer associated with the given UserID

func (*Customer) GetByCustomerID

func (c *Customer) GetByCustomerID(id string) (*models.Customer, error)

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

func (c *Customer) Insert(req *models.CustomerRequest) (*models.Customer, error)

Insert creates a new stripe customer with the given id and token, inserting a record

into the db

func (*Customer) InsertSubscribed

func (c *Customer) InsertSubscribed(customerID, connectedID, stripeSubId string, roasterID uuid.UUID) error

func (*Customer) Subscribe

func (c *Customer) Subscribe(id uuid.UUID, roaster *models.Roaster, plan *models.Plan, freq models.Frequency, quantity uint64) error

Subscribe creates a new subscription to the provided plan at the given Frequency in stripe

type Event

type Event interface {
	Send(*stripe.Event) error
}

Event helps with manipulating roaster properties

func NewEvent

func NewEvent(rabbit g.RabbitI) Event

NewEvent initializes and returns a roaster with the given gateways

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 NewPlan

func NewPlan(sql g.SQL, stripe gateways.Stripe, warehouse w.Warehouse) *Plan

NewPlan initializes and returns a plan with the given gateways

func (*Plan) Delete

func (p *Plan) Delete(id, planID string) error

Delete is not implemented

func (*Plan) Get

func (p *Plan) Get(roaster *models.Roaster, itemID uuid.UUID) (*models.Plan, error)

Get returns a plan associated with a roaster and itemid

func (*Plan) GetByRoaster

func (p *Plan) GetByRoaster(roaster *models.Roaster, offset int, limit int) ([]*models.Plan, error)

GetByRoaster returns all plans associated with a roaster

func (*Plan) Insert

func (p *Plan) Insert(roaster *models.Roaster, req *models.PlanRequest) (*models.Plan, error)

Insert creates a new roaster plan in stripe and adds a record to the db

func (*Plan) Update

func (p *Plan) Update(id string, itemID uuid.UUID) (*models.Plan, error)

Update is not implemented

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) Get

func (r *Roaster) Get(id uuid.UUID) (*models.Roaster, error)

Get returns the roaster account associated with the given id

func (*Roaster) GetByAccountID

func (r *Roaster) GetByAccountID(id string) (*models.Roaster, error)

func (*Roaster) GetByUserID

func (r *Roaster) GetByUserID(id uuid.UUID) (*models.Roaster, error)

GetByUserID returns the roaster account associated with a user id

func (*Roaster) Insert

func (r *Roaster) Insert(req *models.RoasterRequest) (*models.Roaster, error)

Insert creates a new roaster's stripe information and adds a record to the db

Jump to

Keyboard shortcuts

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