Class: Stripe::V2::Billing::ContractUpdateParams::PricingOverrideAction::Add::OverwritePrice

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/params/v2/billing/contract_update_params.rb

Defined Under Namespace

Classes: Tier

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

attr_accessor, coerce_params, coerce_value, new, #to_h

Constructor Details

#initialize(price: nil, tiering_mode: nil, tiers: nil, unit_amount: nil) ⇒ OverwritePrice

Returns a new instance of OverwritePrice.



315
316
317
318
319
320
# File 'lib/stripe/params/v2/billing/contract_update_params.rb', line 315

def initialize(price: nil, tiering_mode: nil, tiers: nil, unit_amount: nil)
  @price = price
  @tiering_mode = tiering_mode
  @tiers = tiers
  @unit_amount = unit_amount
end

Instance Attribute Details

#priceObject

The ID of the V1 price to overwrite.



307
308
309
# File 'lib/stripe/params/v2/billing/contract_update_params.rb', line 307

def price
  @price
end

#tiering_modeObject

Defines whether the tiered price should be graduated or volume-based.



309
310
311
# File 'lib/stripe/params/v2/billing/contract_update_params.rb', line 309

def tiering_mode
  @tiering_mode
end

#tiersObject

Each element represents a pricing tier.



311
312
313
# File 'lib/stripe/params/v2/billing/contract_update_params.rb', line 311

def tiers
  @tiers
end

#unit_amountObject

The per-unit amount to be charged, represented as a decimal string in minor currency units.



313
314
315
# File 'lib/stripe/params/v2/billing/contract_update_params.rb', line 313

def unit_amount
  @unit_amount
end

Class Method Details

.field_encodingsObject



322
323
324
325
326
327
328
329
# File 'lib/stripe/params/v2/billing/contract_update_params.rb', line 322

def self.field_encodings
  @field_encodings = {
    tiers: {
      kind: :array,
      element: { kind: :object, fields: { up_to_decimal: :decimal_string } },
    },
  }
end