Class: Stripe::Checkout::SessionService::UpdateParams::Discount::CouponData
- Inherits:
-
RequestParams
- Object
- RequestParams
- Stripe::Checkout::SessionService::UpdateParams::Discount::CouponData
- Defined in:
- lib/stripe/services/checkout/session_service.rb
Instance Attribute Summary collapse
-
#amount_off ⇒ Object
A positive integer representing the amount to subtract from an invoice total (required if ‘percent_off` is not passed).
-
#currency ⇒ Object
Three-letter [ISO code for the currency](stripe.com/docs/currencies) of the ‘amount_off` parameter (required if `amount_off` is passed).
-
#duration ⇒ Object
Specifies how long the discount will be in effect if used on a subscription.
-
#metadata ⇒ Object
Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object.
-
#name ⇒ Object
Name of the coupon displayed to customers on, for instance invoices, or receipts.
-
#percent_off ⇒ Object
A positive float larger than 0, and smaller or equal to 100, that represents the discount the coupon will apply (required if ‘amount_off` is not passed).
Instance Method Summary collapse
-
#initialize(amount_off: nil, currency: nil, duration: nil, metadata: nil, name: nil, percent_off: nil) ⇒ CouponData
constructor
A new instance of CouponData.
Methods inherited from RequestParams
Constructor Details
#initialize(amount_off: nil, currency: nil, duration: nil, metadata: nil, name: nil, percent_off: nil) ⇒ CouponData
Returns a new instance of CouponData.
2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 |
# File 'lib/stripe/services/checkout/session_service.rb', line 2660 def initialize( amount_off: nil, currency: nil, duration: nil, metadata: nil, name: nil, percent_off: nil ) @amount_off = amount_off @currency = currency @duration = duration @metadata = @name = name @percent_off = percent_off end |
Instance Attribute Details
#amount_off ⇒ Object
A positive integer representing the amount to subtract from an invoice total (required if ‘percent_off` is not passed).
2648 2649 2650 |
# File 'lib/stripe/services/checkout/session_service.rb', line 2648 def amount_off @amount_off end |
#currency ⇒ Object
Three-letter [ISO code for the currency](stripe.com/docs/currencies) of the ‘amount_off` parameter (required if `amount_off` is passed).
2650 2651 2652 |
# File 'lib/stripe/services/checkout/session_service.rb', line 2650 def currency @currency end |
#duration ⇒ Object
Specifies how long the discount will be in effect if used on a subscription. Defaults to ‘once`.
2652 2653 2654 |
# File 'lib/stripe/services/checkout/session_service.rb', line 2652 def duration @duration end |
#metadata ⇒ Object
Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to ‘metadata`.
2654 2655 2656 |
# File 'lib/stripe/services/checkout/session_service.rb', line 2654 def @metadata end |
#name ⇒ Object
Name of the coupon displayed to customers on, for instance invoices, or receipts. By default the ‘id` is shown if `name` is not set.
2656 2657 2658 |
# File 'lib/stripe/services/checkout/session_service.rb', line 2656 def name @name end |
#percent_off ⇒ Object
A positive float larger than 0, and smaller or equal to 100, that represents the discount the coupon will apply (required if ‘amount_off` is not passed).
2658 2659 2660 |
# File 'lib/stripe/services/checkout/session_service.rb', line 2658 def percent_off @percent_off end |