Documentation
¶
Overview ¶
Package coupon provides the /v1/coupons APIs
Index ¶
- func Del(id string, params *stripe.CouponParams) (*stripe.Coupon, error)
- func Get(id string, params *stripe.CouponParams) (*stripe.Coupon, error)
- func New(params *stripe.CouponParams) (*stripe.Coupon, error)
- func Update(id string, params *stripe.CouponParams) (*stripe.Coupon, error)
- type Client
- func (c Client) Del(id string, params *stripe.CouponParams) (*stripe.Coupon, error)deprecated
- func (c Client) Get(id string, params *stripe.CouponParams) (*stripe.Coupon, error)deprecated
- func (c Client) List(listParams *stripe.CouponListParams) *Iterdeprecated
- func (c Client) New(params *stripe.CouponParams) (*stripe.Coupon, error)deprecated
- func (c Client) Update(id string, params *stripe.CouponParams) (*stripe.Coupon, error)deprecated
- type Iter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Del ¶
You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API.
func New ¶
func New(params *stripe.CouponParams) (*stripe.Coupon, error)
You can create coupons easily via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly.
A coupon has either a percent_off or an amount_off and currency. If you set an amount_off, that amount will be subtracted from any invoice's subtotal. For example, an invoice with a subtotal of 100 will have a final total of 0 if a coupon with an amount_off of 200 is applied to it and an invoice with a subtotal of 300 will have a final total of 100 if a coupon with an amount_off of 200 is applied to it.
Types ¶
type Client ¶
Client is used to invoke /v1/coupons APIs. Deprecated: Use stripe.Client instead. See the migration guide for more info.
func (Client) Del
deprecated
You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API.
Deprecated: Client methods are deprecated. This should be accessed instead through stripe.Client. See the migration guide for more info.
func (Client) Get
deprecated
Retrieves the coupon with the given ID.
Deprecated: Client methods are deprecated. This should be accessed instead through stripe.Client. See the migration guide for more info.
func (Client) List
deprecated
func (c Client) List(listParams *stripe.CouponListParams) *Iter
Returns a list of your coupons.
Deprecated: Client methods are deprecated. This should be accessed instead through stripe.Client. See the migration guide for more info.
func (Client) New
deprecated
You can create coupons easily via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly.
A coupon has either a percent_off or an amount_off and currency. If you set an amount_off, that amount will be subtracted from any invoice's subtotal. For example, an invoice with a subtotal of 100 will have a final total of 0 if a coupon with an amount_off of 200 is applied to it and an invoice with a subtotal of 300 will have a final total of 100 if a coupon with an amount_off of 200 is applied to it.
Deprecated: Client methods are deprecated. This should be accessed instead through stripe.Client. See the migration guide for more info.
func (Client) Update
deprecated
Updates the metadata of a coupon. Other coupon details (currency, duration, amount_off) are, by design, not editable.
Deprecated: Client methods are deprecated. This should be accessed instead through stripe.Client. See the migration guide for more info.
type Iter ¶
Iter is an iterator for coupons.
func (*Iter) CouponList ¶
func (i *Iter) CouponList() *stripe.CouponList
CouponList returns the current list object which the iterator is currently using. List objects will change as new API calls are made to continue pagination.