product

package
v78.8.0 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package product provides the /products APIs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Del

func Del(id string, params *stripe.ProductParams) (*stripe.Product, error)

Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it.

func Get

func Get(id string, params *stripe.ProductParams) (*stripe.Product, error)

Retrieves the details of an existing product. Supply the unique product ID from either a product creation request or the product list, and Stripe will return the corresponding product information.

func New

func New(params *stripe.ProductParams) (*stripe.Product, error)

Creates a new product object.

func Update

func Update(id string, params *stripe.ProductParams) (*stripe.Product, error)

Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

Types

type Client

type Client struct {
	B   stripe.Backend
	Key string
}

Client is used to invoke /products APIs.

func (Client) Del

func (c Client) Del(id string, params *stripe.ProductParams) (*stripe.Product, error)

Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it.

func (Client) Get

func (c Client) Get(id string, params *stripe.ProductParams) (*stripe.Product, error)

Retrieves the details of an existing product. Supply the unique product ID from either a product creation request or the product list, and Stripe will return the corresponding product information.

func (Client) List

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

Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first.

func (Client) New

func (c Client) New(params *stripe.ProductParams) (*stripe.Product, error)

Creates a new product object.

func (Client) Search

func (c Client) Search(params *stripe.ProductSearchParams) *SearchIter

Search for products you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India.

func (Client) Update

func (c Client) Update(id string, params *stripe.ProductParams) (*stripe.Product, error)

Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

type Iter

type Iter struct {
	*stripe.Iter
}

Iter is an iterator for products.

func List

func List(params *stripe.ProductListParams) *Iter

Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first.

func (*Iter) Product

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

Product returns the product which the iterator is currently pointing to.

func (*Iter) ProductList

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

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

type SearchIter

type SearchIter struct {
	*stripe.SearchIter
}

SearchIter is an iterator for products.

func Search(params *stripe.ProductSearchParams) *SearchIter

Search for products you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India.

func (*SearchIter) Product

func (i *SearchIter) Product() *stripe.Product

Product returns the product which the iterator is currently pointing to.

func (*SearchIter) ProductSearchResult

func (i *SearchIter) ProductSearchResult() *stripe.ProductSearchResult

ProductSearchResult 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