Coupon
class Coupon extends Resource implements CouponInterface
A coupon contains information about a percent-off or amount-off discount you might want to apply to a customer. Coupons may be applied to invoices or orders.
Coupons do not work with conventional one-off charges, but you can implement a custom coupon system in your application.
Traits
Properties
string | $id | A unique identifier for the resource. | from Resource |
protected mixed | $response | A response from Stripe. | from Resource |
Methods
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.
No description
Details
in Resource at line 29
string
getId()
Returns the unique identifier for this resource.
in Resource at line 39
mixed
getResponse()
Returns the raw Stripe response.
in Resource at line 47
protected void
setProperties()
Set the response data as properties on the class.
in ListAll at line 21
ListAll
listAll(array $arguments = [])
List all the resources.
This will list all of the resources from which this trait belongs to. It will then return itself, so you can method chain it, or reuse the same instantiation.
in Delete at line 21
Delete
delete(string $id)
Delete a resource.
Delete a resource associated with the class this trait is being used. You must pass in the ID of the resource that you wish to delete. Then it will return the same instance of the class from which it was called.
at line 43
CouponInterface
create(DurationTypeInterface $duration, CouponTypeInterface $type, array $arguments = [], string $key = null)
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 20000 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 20000 is applied to it.