Class: Stripe::Checkout::SessionCreateParams::Discount::CouponData
- Inherits:
-
RequestParams
- Object
- RequestParams
- Stripe::Checkout::SessionCreateParams::Discount::CouponData
- Defined in:
- lib/stripe/params/checkout/session_create_params.rb
Instance Attribute Summary collapse
-
#amount_off ⇒ Object
A positive integer representing the amount to subtract from an invoice total (required if
percent_offis not passed). -
#currency ⇒ Object
Three-letter ISO code for the currency of the
amount_offparameter (required ifamount_offis passed). -
#duration ⇒ Object
Specifies how long the discount will be in effect if used on a subscription.
-
#metadata ⇒ Object
Set of key-value pairs 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_offis 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
attr_accessor, coerce_params, coerce_value, field_encodings, new, #to_h
Constructor Details
#initialize(amount_off: nil, currency: nil, duration: nil, metadata: nil, name: nil, percent_off: nil) ⇒ CouponData
Returns a new instance of CouponData.
440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 |
# File 'lib/stripe/params/checkout/session_create_params.rb', line 440 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).
428 429 430 |
# File 'lib/stripe/params/checkout/session_create_params.rb', line 428 def amount_off @amount_off end |
#currency ⇒ Object
Three-letter ISO code for the currency of the amount_off parameter (required if amount_off is passed).
430 431 432 |
# File 'lib/stripe/params/checkout/session_create_params.rb', line 430 def currency @currency end |
#duration ⇒ Object
Specifies how long the discount will be in effect if used on a subscription. Defaults to once.
432 433 434 |
# File 'lib/stripe/params/checkout/session_create_params.rb', line 432 def duration @duration end |
#metadata ⇒ Object
Set of key-value pairs 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.
434 435 436 |
# File 'lib/stripe/params/checkout/session_create_params.rb', line 434 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.
436 437 438 |
# File 'lib/stripe/params/checkout/session_create_params.rb', line 436 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).
438 439 440 |
# File 'lib/stripe/params/checkout/session_create_params.rb', line 438 def percent_off @percent_off end |