billing

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2019 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a billing client wrapper for Stripe

func NewClient

func NewClient() *Client

NewClient creates a new billing client

func (*Client) CancelSubscription

func (c *Client) CancelSubscription() error

CancelSubscription from current tenant on Stripe

func (*Client) ClearPaymentInfo

func (c *Client) ClearPaymentInfo() error

ClearPaymentInfo removes all payment information from stripe

func (*Client) CreateCustomer

func (c *Client) CreateCustomer(email string) (string, error)

CreateCustomer on Stripe

func (*Client) DeleteCustomer

func (c *Client) DeleteCustomer() error

DeleteCustomer on Stripe

func (*Client) GetPaymentInfo

func (c *Client) GetPaymentInfo() (*models.PaymentInfo, error)

GetPaymentInfo from a stripe card

func (*Client) GetPlanByID

func (c *Client) GetPlanByID(countryCode, planID string) (*models.BillingPlan, error)

GetPlanByID return a plan by its ID

func (*Client) GetUpcomingInvoice

func (c *Client) GetUpcomingInvoice() (*models.UpcomingInvoice, error)

GetUpcomingInvoice returns the next due invoice for current tenant

func (*Client) ListPlans

func (c *Client) ListPlans(countryCode string) ([]*models.BillingPlan, error)

ListPlans on Stripe

func (*Client) SetCurrentTenant

func (c *Client) SetCurrentTenant(tenant *models.Tenant)

SetCurrentTenant to current context

func (*Client) SetCurrentUser

func (c *Client) SetCurrentUser(user *models.User)

SetCurrentUser to current context

func (*Client) Subscribe

func (c *Client) Subscribe(planID string) error

Subscribe current tenant to given plan on Stripe

func (*Client) UpdatePaymentInfo

func (c *Client) UpdatePaymentInfo(input *models.CreateEditBillingPaymentInfo) error

UpdatePaymentInfo creates or updates customer payment info on Stripe

Jump to

Keyboard shortcuts

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