Class: Dodopayments::Models::Price::RecurringPrice

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

#initializeObject



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

def initialize: (

Instance Attribute Details

#currencySymbol, Dodopayments::Models::Currency

The currency in which the payment is made.

Parameters:

  • value (Dodopayments::Models::currency)

Returns:



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

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

#discountInteger

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

Parameters:

  • value (Integer)

Returns:

  • (Integer)


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

required :discount, Integer

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


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

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:



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

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

#priceInteger

The 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)


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

required :price, Integer

#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. Defaults to false.

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


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

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.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


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

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:



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

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

#tax_inclusiveBoolean?

Indicates if the price is tax inclusive

Parameters:

  • value (Boolean, nil)

Returns:

  • (Boolean, nil)


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

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

#trial_amountInteger?

Amount charged today for a paid trial, in the price currency's minor units. Requires trial_period_days > 0. Omit or null for a free trial (the default).

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


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

optional :trial_amount, Integer, nil?: true

#trial_apply_discountsBoolean?

Whether discount codes reduce the trial charge. Defaults to false. Only meaningful when a paid trial is configured.

Parameters:

  • value (Boolean, nil)

Returns:

  • (Boolean, nil)


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

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

#trial_period_daysInteger?

Number of days for the trial period. A value of 0 indicates no trial period.

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


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

optional :trial_period_days, Integer

#typeSymbol, :recurring_price

Parameters:

  • value (:recurring_price)

Returns:

  • (Symbol, :recurring_price)


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

required :type, const: :recurring_price

Instance Method Details

#to_hash{

Returns:

  • ({)


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

def to_hash: -> {