Documentation ¶
Overview ¶
Package coupon provides the /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)
- func (c Client) Get(id string, params *stripe.CouponParams) (*stripe.Coupon, error)
- func (c Client) List(listParams *stripe.CouponListParams) *Iter
- func (c Client) New(params *stripe.CouponParams) (*stripe.Coupon, error)
- func (c Client) Update(id string, params *stripe.CouponParams) (*stripe.Coupon, error)
- 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 /coupons APIs.
func (Client) 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 (Client) List ¶
func (c Client) List(listParams *stripe.CouponListParams) *Iter
Returns a list of your coupons.
func (Client) New ¶
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.
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.