Class: Stripe::PriceCreateParams::Tier
- Inherits:
-
RequestParams
- Object
- RequestParams
- Stripe::PriceCreateParams::Tier
- Defined in:
- lib/stripe/params/price_create_params.rb
Instance Attribute Summary collapse
-
#flat_amount ⇒ Object
The flat billing amount for an entire tier, regardless of the number of units in the tier.
-
#flat_amount_decimal ⇒ Object
Same as
flat_amount, but accepts a decimal value representing an integer in the minor units of the currency. -
#unit_amount ⇒ Object
The per unit billing amount for each individual unit for which this tier applies.
-
#unit_amount_decimal ⇒ Object
Same as
unit_amount, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. -
#up_to ⇒ Object
Specifies the upper bound of this tier.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(flat_amount: nil, flat_amount_decimal: nil, unit_amount: nil, unit_amount_decimal: nil, up_to: nil) ⇒ Tier
constructor
A new instance of Tier.
Methods inherited from RequestParams
attr_accessor, coerce_params, coerce_value, new, #to_h
Constructor Details
#initialize(flat_amount: nil, flat_amount_decimal: nil, unit_amount: nil, unit_amount_decimal: nil, up_to: nil) ⇒ Tier
Returns a new instance of Tier.
206 207 208 209 210 211 212 213 214 215 216 217 218 |
# File 'lib/stripe/params/price_create_params.rb', line 206 def initialize( flat_amount: nil, flat_amount_decimal: nil, unit_amount: nil, unit_amount_decimal: nil, up_to: nil ) @flat_amount = flat_amount @flat_amount_decimal = flat_amount_decimal @unit_amount = unit_amount @unit_amount_decimal = unit_amount_decimal @up_to = up_to end |
Instance Attribute Details
#flat_amount ⇒ Object
The flat billing amount for an entire tier, regardless of the number of units in the tier.
196 197 198 |
# File 'lib/stripe/params/price_create_params.rb', line 196 def flat_amount @flat_amount end |
#flat_amount_decimal ⇒ Object
Same as flat_amount, but accepts a decimal value representing an integer in the minor units of the currency. Only one of flat_amount and flat_amount_decimal can be set.
198 199 200 |
# File 'lib/stripe/params/price_create_params.rb', line 198 def flat_amount_decimal @flat_amount_decimal end |
#unit_amount ⇒ Object
The per unit billing amount for each individual unit for which this tier applies.
200 201 202 |
# File 'lib/stripe/params/price_create_params.rb', line 200 def unit_amount @unit_amount end |
#unit_amount_decimal ⇒ Object
Same as unit_amount, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of unit_amount and unit_amount_decimal can be set.
202 203 204 |
# File 'lib/stripe/params/price_create_params.rb', line 202 def unit_amount_decimal @unit_amount_decimal end |
#up_to ⇒ Object
Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use inf to define a fallback tier.
204 205 206 |
# File 'lib/stripe/params/price_create_params.rb', line 204 def up_to @up_to end |
Class Method Details
.field_encodings ⇒ Object
220 221 222 223 224 225 |
# File 'lib/stripe/params/price_create_params.rb', line 220 def self.field_encodings @field_encodings = { flat_amount_decimal: :decimal_string, unit_amount_decimal: :decimal_string, } end |