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:, discount:, fixed_price:, payment_frequency_count:, payment_frequency_interval:, purchasing_power_parity:, subscription_period_count:, subscription_period_interval:, meters: 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.

Parameters:

  • currency (Symbol, Dodopayments::Models::Currency)

    The currency in which the payment is made.

  • discount (Integer)

    Discount applied to the price, represented as a percentage (0 to 100).

  • fixed_price (Integer)

    The fixed payment amount. Represented in the lowest denomination of the currency

  • payment_frequency_count (Integer)

    Number of units for the payment frequency.

  • payment_frequency_interval (Symbol, Dodopayments::Models::TimeInterval)

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

  • purchasing_power_parity (Boolean)

    Indicates if purchasing power parity adjustments are applied to the price.

  • subscription_period_count (Integer)

    Number of units for the subscription period.

  • subscription_period_interval (Symbol, Dodopayments::Models::TimeInterval)

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

  • meters (Array<Dodopayments::Models::AddMeterToPrice>, nil) (defaults to: nil)
  • tax_inclusive (Boolean, nil) (defaults to: nil)

    Indicates if the price is tax inclusive

  • type (Symbol, :usage_based_price) (defaults to: :usage_based_price)


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

Instance Attribute Details

#currencySymbol, Dodopayments::Models::Currency

The currency in which the payment is made.

Parameters:

  • value (Dodopayments::Models::currency)

Returns:



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

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

#discountInteger

Discount applied to the price, represented as a percentage (0 to 100).

Parameters:

  • value (Integer)

Returns:

  • (Integer)


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

required :discount, Integer

#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.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


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

required :fixed_price, Integer

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

Parameters:

Returns:



259
260
261
262
263
# File 'lib/dodopayments/models/price.rb', line 259

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.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


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

required :payment_frequency_count, Integer

#payment_frequency_intervalSymbol, Dodopayments::Models::TimeInterval

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

Parameters:

  • value (Dodopayments::Models::time_interval)

Returns:



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

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

#purchasing_power_parityBoolean

Indicates if purchasing power parity adjustments are applied to the price. Purchasing power parity feature is not available as of now

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


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

required :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.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


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

required :subscription_period_count, Integer

#subscription_period_intervalSymbol, Dodopayments::Models::TimeInterval

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

Parameters:

  • value (Dodopayments::Models::time_interval)

Returns:



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

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

#tax_inclusiveBoolean?

Indicates if the price is tax inclusive

Parameters:

  • value (Boolean, nil)

Returns:

  • (Boolean, nil)


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

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

#typeSymbol, :usage_based_price

Parameters:

  • value (:usage_based_price)

Returns:

  • (Symbol, :usage_based_price)


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

required :type, const: :usage_based_price

Instance Method Details

#to_hash{

Returns:

  • ({)


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

def to_hash: -> {