Class: Dodopayments::Models::Price::OneTimePrice

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



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

def initialize: (

Instance Attribute Details

#currencySymbol, Dodopayments::Models::Currency

The currency in which the payment is made.

Parameters:

  • value (Dodopayments::Models::currency)

Returns:



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

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

#discountInteger

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

Parameters:

  • value (Integer)

Returns:

  • (Integer)


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

required :discount, Integer

#pay_what_you_wantBoolean?

Indicates whether the customer can pay any amount they choose. If set to true, the price field is the minimum amount.

Parameters:

  • (Boolean)

Returns:

  • (Boolean, nil)


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

optional :pay_what_you_want, Dodopayments::Internal::Type::Boolean

#priceInteger

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

If pay_what_you_want is set to true, this field represents the minimum amount the customer must pay.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


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

required :price, Integer

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


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

required :purchasing_power_parity, Dodopayments::Internal::Type::Boolean

#suggested_priceInteger?

A suggested price for the user to pay. This value is only considered if pay_what_you_want is true. Otherwise, it is ignored.

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


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

optional :suggested_price, Integer, nil?: true

#tax_inclusiveBoolean?

Indicates if the price is tax inclusive.

Parameters:

  • value (Boolean, nil)

Returns:

  • (Boolean, nil)


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

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

#typeSymbol, :one_time_price

Parameters:

  • value (:one_time_price)

Returns:

  • (Symbol, :one_time_price)


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

required :type, const: :one_time_price

Instance Method Details

#to_hash{

Returns:

  • ({)


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

def to_hash: -> {