Class: Stripe::V2::Billing::ContractCreateParams::PricingOverride::OverwritePrice

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/params/v2/billing/contract_create_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.



675
676
677
678
679
680
# File 'lib/stripe/params/v2/billing/contract_create_params.rb', line 675

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.



667
668
669
# File 'lib/stripe/params/v2/billing/contract_create_params.rb', line 667

def price
  @price
end

#tiering_modeObject

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



669
670
671
# File 'lib/stripe/params/v2/billing/contract_create_params.rb', line 669

def tiering_mode
  @tiering_mode
end

#tiersObject

Each element represents a pricing tier.



671
672
673
# File 'lib/stripe/params/v2/billing/contract_create_params.rb', line 671

def tiers
  @tiers
end

#unit_amountObject

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



673
674
675
# File 'lib/stripe/params/v2/billing/contract_create_params.rb', line 673

def unit_amount
  @unit_amount
end

Class Method Details

.field_encodingsObject



682
683
684
685
686
687
688
689
# File 'lib/stripe/params/v2/billing/contract_create_params.rb', line 682

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