Class: Stripe::V2::Billing::RateCards::RateService::CreateParams

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/services/v2/billing/rate_cards/rate_service.rb

Defined Under Namespace

Classes: CustomPricingUnitAmount, Tier, TransformQuantity

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

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_amountObject

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

#metadataObject

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_itemObject

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

#priceObject

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_modeObject

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

#tiersObject

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_quantityObject

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_amountObject

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