sub

package
v16.8.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package sub provides the /subscriptions APIs

Index

Constants

View Source
const (
	Trialing stripe.SubStatus = "trialing"
	Active   stripe.SubStatus = "active"
	PastDue  stripe.SubStatus = "past_due"
	Canceled stripe.SubStatus = "canceled"
	Unpaid   stripe.SubStatus = "unpaid"
)

Variables

This section is empty.

Functions

func Cancel

func Cancel(id string, params *stripe.SubParams) (*stripe.Sub, error)

Cancel removes a subscription. For more details see https://stripe.com/docs/api#cancel_subscription.

func Get

func Get(id string, params *stripe.SubParams) (*stripe.Sub, error)

Get returns the details of a subscription. For more details see https://stripe.com/docs/api#retrieve_subscription.

func New

func New(params *stripe.SubParams) (*stripe.Sub, error)

New POSTS a new subscription for a customer. For more details see https://stripe.com/docs/api#create_subscription.

func Update

func Update(id string, params *stripe.SubParams) (*stripe.Sub, error)

Update updates a subscription's properties. For more details see https://stripe.com/docs/api#update_subscription.

Types

type Client

type Client struct {
	B   stripe.Backend
	Key string
}

Client is used to invoke /subscriptions APIs.

func (Client) Cancel

func (c Client) Cancel(id string, params *stripe.SubParams) (*stripe.Sub, error)

func (Client) Get

func (c Client) Get(id string, params *stripe.SubParams) (*stripe.Sub, error)

func (Client) List

func (c Client) List(params *stripe.SubListParams) *Iter

func (Client) New

func (c Client) New(params *stripe.SubParams) (*stripe.Sub, error)

func (Client) Update

func (c Client) Update(id string, params *stripe.SubParams) (*stripe.Sub, error)

type Iter

type Iter struct {
	*stripe.Iter
}

Iter is an iterator for lists of Subs. The embedded Iter carries methods with it; see its documentation for details.

func List

func List(params *stripe.SubListParams) *Iter

List returns a list of subscriptions. For more details see https://stripe.com/docs/api#list_subscriptions.

func (*Iter) Sub

func (i *Iter) Sub() *stripe.Sub

Sub returns the most recent Sub visited by a call to Next.

Jump to

Keyboard shortcuts

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