sub

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2014 License: MIT Imports: 4 Imported by: 189

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) 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) 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 {
	Iter *stripe.Iter
}

Iter is a iterator for list responses.

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

func (i *Iter) Meta() *stripe.ListMeta

Meta returns the list metadata.

func (*Iter) Next

func (i *Iter) Next() (*stripe.Sub, error)

Next returns the next value in the list.

func (*Iter) Stop

func (i *Iter) Stop() bool

Stop returns true if there are no more iterations to be performed.

Jump to

Keyboard shortcuts

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