plan

package
v79.6.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: MIT Imports: 3 Imported by: 1

Documentation

Overview

Package plan provides the /plans APIs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Del

func Del(id string, params *stripe.PlanParams) (*stripe.Plan, error)

Deleting plans means new subscribers can't be added. Existing subscribers aren't affected.

func Get

func Get(id string, params *stripe.PlanParams) (*stripe.Plan, error)

Retrieves the plan with the given ID.

func New

func New(params *stripe.PlanParams) (*stripe.Plan, error)

You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration.

func Update

func Update(id string, params *stripe.PlanParams) (*stripe.Plan, error)

Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan's ID, amount, currency, or billing cycle.

Types

type Client

type Client struct {
	B   stripe.Backend
	Key string
}

Client is used to invoke /plans APIs.

func (Client) Del

func (c Client) Del(id string, params *stripe.PlanParams) (*stripe.Plan, error)

Deleting plans means new subscribers can't be added. Existing subscribers aren't affected.

func (Client) Get

func (c Client) Get(id string, params *stripe.PlanParams) (*stripe.Plan, error)

Retrieves the plan with the given ID.

func (Client) List

func (c Client) List(listParams *stripe.PlanListParams) *Iter

Returns a list of your plans.

func (Client) New

func (c Client) New(params *stripe.PlanParams) (*stripe.Plan, error)

You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration.

func (Client) Update

func (c Client) Update(id string, params *stripe.PlanParams) (*stripe.Plan, error)

Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan's ID, amount, currency, or billing cycle.

type Iter

type Iter struct {
	*stripe.Iter
}

Iter is an iterator for plans.

func List

func List(params *stripe.PlanListParams) *Iter

Returns a list of your plans.

func (*Iter) Plan

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

Plan returns the plan which the iterator is currently pointing to.

func (*Iter) PlanList

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

PlanList returns the current list object which the iterator is currently using. List objects will change as new API calls are made to continue pagination.

Jump to

Keyboard shortcuts

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