promotioncode

package
v80.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package promotioncode provides the /promotion_codes APIs

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get

Retrieves the promotion code with the given ID. In order to retrieve a promotion code by the customer-facing code use [list](https://stripe.com/docs/api/promotion_codes/list) with the desired code.

func New

A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date.

func Update

Updates the specified promotion code by setting the values of the parameters passed. Most fields are, by design, not editable.

Types

type Client

type Client struct {
	B   stripe.Backend
	Key string
}

Client is used to invoke /promotion_codes APIs.

func (Client) Get

Retrieves the promotion code with the given ID. In order to retrieve a promotion code by the customer-facing code use [list](https://stripe.com/docs/api/promotion_codes/list) with the desired code.

func (Client) List

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

Returns a list of your promotion codes.

func (Client) New

A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date.

func (Client) Update

func (c Client) Update(id string, params *stripe.PromotionCodeParams) (*stripe.PromotionCode, error)

Updates the specified promotion code by setting the values of the parameters passed. Most fields are, by design, not editable.

type Iter

type Iter struct {
	*stripe.Iter
}

Iter is an iterator for promotion codes.

func List

func List(params *stripe.PromotionCodeListParams) *Iter

Returns a list of your promotion codes.

func (*Iter) PromotionCode

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

PromotionCode returns the promotion code which the iterator is currently pointing to.

func (*Iter) PromotionCodeList

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

PromotionCodeList 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