Class: Stripe::V2::Billing::RateCards::RateService::CreateParams
- Inherits:
-
RequestParams
- Object
- RequestParams
- Stripe::V2::Billing::RateCards::RateService::CreateParams
- Defined in:
- lib/stripe/services/v2/billing/rate_cards/rate_service.rb
Defined Under Namespace
Classes: CustomPricingUnitAmount, Tier, TransformQuantity
Instance Attribute Summary collapse
-
#custom_pricing_unit_amount ⇒ Object
The custom pricing unit that this rate binds to.
-
#metadata ⇒ Object
Set of [key-value pairs](/docs/api/metadata) that you can attach to an object.
-
#metered_item ⇒ Object
The Metered Item that this rate binds to.
-
#price ⇒ Object
The ID of the price object to take price information from.
-
#tiering_mode ⇒ Object
Defines whether the tiered price should be graduated or volume-based.
-
#tiers ⇒ Object
Each element represents a pricing tier.
-
#transform_quantity ⇒ Object
Apply a transformation to the reported usage or set quantity before computing the amount billed.
-
#unit_amount ⇒ Object
The per-unit amount to be charged, represented as a decimal string in minor currency units with at most 12 decimal places.
Instance Method Summary collapse
-
#initialize(custom_pricing_unit_amount: nil, metadata: nil, metered_item: nil, price: nil, tiering_mode: nil, tiers: nil, transform_quantity: nil, unit_amount: nil) ⇒ CreateParams
constructor
A new instance of CreateParams.
Methods inherited from RequestParams
Constructor Details
#initialize(custom_pricing_unit_amount: nil, metadata: nil, metered_item: nil, price: nil, tiering_mode: nil, tiers: nil, transform_quantity: nil, unit_amount: nil) ⇒ CreateParams
Returns a new instance of CreateParams.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/stripe/services/v2/billing/rate_cards/rate_service.rb', line 89 def initialize( custom_pricing_unit_amount: nil, metadata: nil, metered_item: nil, price: nil, tiering_mode: nil, tiers: nil, transform_quantity: nil, unit_amount: nil ) @custom_pricing_unit_amount = custom_pricing_unit_amount @metadata = @metered_item = metered_item @price = price @tiering_mode = tiering_mode @tiers = tiers @transform_quantity = transform_quantity @unit_amount = unit_amount end |
Instance Attribute Details
#custom_pricing_unit_amount ⇒ Object
The custom pricing unit that this rate binds to.
69 70 71 |
# File 'lib/stripe/services/v2/billing/rate_cards/rate_service.rb', line 69 def custom_pricing_unit_amount @custom_pricing_unit_amount end |
#metadata ⇒ Object
Set of [key-value pairs](/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.
71 72 73 |
# File 'lib/stripe/services/v2/billing/rate_cards/rate_service.rb', line 71 def @metadata end |
#metered_item ⇒ Object
The Metered Item that this rate binds to.
73 74 75 |
# File 'lib/stripe/services/v2/billing/rate_cards/rate_service.rb', line 73 def metered_item @metered_item end |
#price ⇒ Object
The ID of the price object to take price information from. The price must have the same interval as the rate card. Updates to the Price will not be reflected in the Rate Card or its rates.
76 77 78 |
# File 'lib/stripe/services/v2/billing/rate_cards/rate_service.rb', line 76 def price @price end |
#tiering_mode ⇒ Object
Defines whether the tiered price should be graduated or volume-based. In volume-based tiering, the maximum quantity within a period determines the per-unit price. In graduated tiering, the pricing changes as the quantity grows into new tiers. Can only be set if ‘tiers` is set.
80 81 82 |
# File 'lib/stripe/services/v2/billing/rate_cards/rate_service.rb', line 80 def tiering_mode @tiering_mode end |
#tiers ⇒ Object
Each element represents a pricing tier. Cannot be set if ‘unit_amount` is provided.
82 83 84 |
# File 'lib/stripe/services/v2/billing/rate_cards/rate_service.rb', line 82 def tiers @tiers end |
#transform_quantity ⇒ Object
Apply a transformation to the reported usage or set quantity before computing the amount billed.
84 85 86 |
# File 'lib/stripe/services/v2/billing/rate_cards/rate_service.rb', line 84 def transform_quantity @transform_quantity end |
#unit_amount ⇒ Object
The per-unit amount to be charged, represented as a decimal string in minor currency units with at most 12 decimal places. Cannot be set if ‘tiers` is provided.
87 88 89 |
# File 'lib/stripe/services/v2/billing/rate_cards/rate_service.rb', line 87 def unit_amount @unit_amount end |