Documentation ¶
Index ¶
Constants ¶
View Source
const ( INVALID = "INVALID" WEEKLY = "WEEKLY" BIWEEKLY = "BIWEEKLY" TRIWEEKLY = "TRIWEEKLY" MONTHLY = "MONTHLY" )
Allowed Frequencies
Variables ¶
Frequencies are the string representations of Frequency
Functions ¶
Types ¶
type Customer ¶
type Customer struct { UserID uuid.UUID `json:"userId"` CustomerID string `json:"stripeCustomerId"` }
Customer is the stripe customer data connected to a userID
func CustomersFromSQL ¶
CustomersFromSQL returns a customer model slice from sql rows
type CustomerRequest ¶
type CustomerRequest struct { UserID uuid.UUID `json:"userId" binding:"required"` Token string `json:"token" binding:"required"` }
CustomerRequest is the information needed to create/update a stripe customer
type Frequency ¶
type Frequency string
Frequency is an enum type wrapping string representations
of the frequency of subscriptions
type Plan ¶
type Plan struct { RoasterID uuid.UUID `json:"roasterId"` ItemID uuid.UUID `json:"itemId"` PlanIDs []string `json:"planIds"` }
Plan stores stripe information for a roaster's items
type Roaster ¶
type Roaster struct { //ID is the roaster ID in towncenter ID uuid.UUID `json:"id"` AccountID string `json:"stripeAccountId"` Secret string `json:"secret"` Publishable string `json:"publishable"` }
Roaster has information retrieved from stripe and the db
about billing for roaster entities
func NewRoaster ¶
NewRoaster initialized and returns a roaster model
type RoasterRequest ¶
RoasterRequest has information used in creating a roaster
managed account in stripe
type SubscribeRequest ¶
type SubscribeRequest struct { RoasterID uuid.UUID `json:"roasterId" binding:"required"` ItemID uuid.UUID `json:"itemId" binding:"required"` Frequency Frequency `json:"frequency" binding:"required"` Quantity uint64 `json:"quantity" binding:"required"` }
SubscribeRequest is the information needed to subscribe a customer
to a roaster plan
func NewSubscribeRequest ¶
func NewSubscribeRequest(roasterID uuid.UUID, itemID uuid.UUID, frequency Frequency, quantity uint64) *SubscribeRequest
NewSubscribeRequest creates a new SubscribeRequest
type Subscribed ¶
type Subscribed struct { CustomerID string `json:"stripeCustomerId"` ConnectedID string `json:"connectedId"` RoasterID uuid.UUID `json:"roasterId"` StripeSubID string `json:"stripeSubId"` }
func NewSubscribed ¶
func NewSubscribed(customerID, connectedID, stripeSubID string, roasterID uuid.UUID) *Subscribed
func SubscribedFromSQL ¶
func SubscribedFromSQL(rows *sql.Rows) []*Subscribed
Click to show internal directories.
Click to hide internal directories.