client

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cancel

func Cancel(customer string) error

func CreateCustomer added in v0.2.1

func CreateCustomer(customer *CustomerRequest) *stripe.Customer

func Customer

func Customer(customer string) *stripe.Customer

func Downgrade

func Downgrade(customer string, plan []string) error

func Upgrade

func Upgrade(customer string, plan []string) error

Types

type CustomerList added in v0.2.2

type CustomerList struct {
	Items []*stripe.Customer
}

func Customers added in v0.2.2

func Customers() *CustomerList

type CustomerRequest added in v0.2.1

type CustomerRequest struct {
	Account  string `json:"account"`
	User     string `json:"user"`
	Email    string `json:"email"`
	Desc     string `json:"desc"`
	Token    string `json:"token"`
	Discount string `json:"discount"`
}

type InvoiceItem added in v0.2.4

type InvoiceItem struct {
	AmountDue       int64  `json:"amount_due"`
	AmountPaid      int64  `json:"amount_paid"`
	AmountRemaining int64  `json:"amount_remaining"`
	DueDate         int64  `json:"due_date"`
	ID              string `json:"id"`
	Paid            bool   `json:"paid"`
	Status          string `json:"status"`
	Total           int64  `json:"total"`
}

type PlanItem

type PlanItem struct {
	Id     string `json:"id,omitempty"`
	PlanId string `json:"plan_id"`
	Name   string `json:"nickname"`
	Amount int64  `json:"amount"`
}

type RawPlanItem

type RawPlanItem struct {
	Plans []SubscriptionItem `json:"data"`
}

type SessionItem

type SessionItem struct {
	Id         string           `json:"session_id"`
	CustomerId string           `json:"customer_id"`
	Plan       map[int]PlanItem `json:"plan"`
	Amount     int64            `json:"amount"`
}

func Session

func Session(customer string, plan []string) *SessionItem

type SubscriptionItem

type SubscriptionItem struct {
	Status           string       `json:"status"`
	CustomerStatus   string       `json:"customer_status"`
	DaysUntilDue     int          `json:"days_until_due"`
	CurrentPeriodEnd int          `json:"current_period_end"`
	Plan             PlanItem     `json:"plan,omitempty"`
	Plans            []PlanItem   `json:"plans"`
	Items            *RawPlanItem `json:"items,omitempty"`
	Cancelled        bool         `json:"cancel_at_period_end"`
	LatestInvoice    *InvoiceItem `json:"latest_invoice"`
}

func Subscription

func Subscription(customer string) []*SubscriptionItem

Jump to

Keyboard shortcuts

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