Class: Dodopayments::Models::Price::UsageBasedPrice

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/dodopayments/models/price.rb,
sig/dodopayments/models/price.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(currency:, fixed_price:, payment_frequency_count:, payment_frequency_interval:, subscription_period_count:, subscription_period_interval:, discount: nil, discount_bps: nil, meters: nil, purchasing_power_parity: nil, tax_inclusive: nil, type: :usage_based_price) ⇒ Object

Some parameter documentations has been truncated, see Dodopayments::Models::Price::UsageBasedPrice for more details.

Usage Based price details.



# File 'lib/dodopayments/models/price.rb', line 359

Instance Attribute Details

#currencySymbol, Dodopayments::Models::Currency

The currency in which the payment is made.



274
# File 'lib/dodopayments/models/price.rb', line 274

required :currency, enum: -> { Dodopayments::Currency }

#discountInteger?

Deprecated.

Deprecated: use discount_bps instead.

Discount applied to the price, represented as a percentage (0 to 100). A response rounds this value to the nearest whole percent. Defaults to 0.



323
# File 'lib/dodopayments/models/price.rb', line 323

optional :discount, Integer

#discount_bpsInteger?

Discount applied to the price, in basis points. 100 basis points make one percent, so 1250 is a discount of 12.5%.

Use this field for a discount with a fraction of a percent. A request that sends this field ignores discount. A value of 0 gives no discount.



333
# File 'lib/dodopayments/models/price.rb', line 333

optional :discount_bps, Integer, nil?: true

#fixed_priceInteger

The fixed payment amount. Represented in the lowest denomination of the currency (e.g., cents for USD). For example, to charge $1.00, pass 100.



281
# File 'lib/dodopayments/models/price.rb', line 281

required :fixed_price, Integer

#metersArray<Dodopayments::Models::AddMeterToPrice>?



338
339
340
341
342
# File 'lib/dodopayments/models/price.rb', line 338

optional :meters,
-> {
  Dodopayments::Internal::Type::ArrayOf[Dodopayments::AddMeterToPrice]
},
nil?: true

#payment_frequency_countInteger

Number of units for the payment frequency. For example, a value of 1 with a payment_frequency_interval of month represents monthly payments.



288
# File 'lib/dodopayments/models/price.rb', line 288

required :payment_frequency_count, Integer

#payment_frequency_intervalSymbol, Dodopayments::Models::TimeInterval

The time interval for the payment frequency (e.g., day, month, year).



294
# File 'lib/dodopayments/models/price.rb', line 294

required :payment_frequency_interval, enum: -> { Dodopayments::TimeInterval }

#purchasing_power_parityBoolean?

Opts this price in to purchasing power parity. The business must also enable purchasing power parity. The discount percentage per country is always business-wide. Applies to the fixed fee only, never to metered usage. Defaults to false.



351
# File 'lib/dodopayments/models/price.rb', line 351

optional :purchasing_power_parity, Dodopayments::Internal::Type::Boolean

#subscription_period_countInteger

Number of units for the subscription period. For example, a value of 12 with a subscription_period_interval of month represents a one-year subscription.



301
# File 'lib/dodopayments/models/price.rb', line 301

required :subscription_period_count, Integer

#subscription_period_intervalSymbol, Dodopayments::Models::TimeInterval

The time interval for the subscription period (e.g., day, month, year).



307
# File 'lib/dodopayments/models/price.rb', line 307

required :subscription_period_interval, enum: -> { Dodopayments::TimeInterval }

#tax_inclusiveBoolean?

Indicates if the price is tax inclusive



357
# File 'lib/dodopayments/models/price.rb', line 357

optional :tax_inclusive, Dodopayments::Internal::Type::Boolean, nil?: true

#typeSymbol, :usage_based_price



312
# File 'lib/dodopayments/models/price.rb', line 312

required :type, const: :usage_based_price

Instance Method Details

#to_hash{



236
# File 'sig/dodopayments/models/price.rbs', line 236

def to_hash: -> {