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

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

Defined Under Namespace

Modules: Type

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: , price: , purchasing_power_parity: , type: , pay_what_you_want: nil, suggested_price: nil, tax_inclusive: nil) ⇒ Object

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

One-time price details.

Parameters:

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

    The currency in which the payment is made.

  • discount (Integer) (defaults to: )

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

  • price (Integer) (defaults to: )

    The payment amount, in the smallest denomination of the currency (e.g., cents fo

  • purchasing_power_parity (Boolean) (defaults to: )

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

  • type (Symbol, Dodopayments::Models::Price::OneTimePrice::Type) (defaults to: )
  • pay_what_you_want (Boolean) (defaults to: nil)

    Indicates whether the customer can pay any amount they choose.

  • suggested_price (Integer, nil) (defaults to: nil)

    A suggested price for the user to pay. This value is only considered if

  • tax_inclusive (Boolean, nil) (defaults to: nil)

    Indicates if the price is tax inclusive.



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

Instance Attribute Details

#currencySymbol, Dodopayments::Models::Currency

The currency in which the payment is made.

Returns:



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

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

#discountInteger

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

Returns:

  • (Integer)


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

required :discount, Integer

#pay_what_you_wantBoolean?

Indicates whether the customer can pay any amount they choose. If set to ‘true`, the [`price`](Self::price) field is the minimum amount.

Returns:

  • (Boolean, nil)


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

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`](Self::pay_what_you_want) is set to `true`, this field represents the minimum amount the customer must pay.

Returns:

  • (Integer)


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

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.

Returns:

  • (Boolean)


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

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`](Self::pay_what_you_want) is `true`. Otherwise, it is ignored.

Returns:

  • (Integer, nil)


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

optional :suggested_price, Integer, nil?: true

#tax_inclusiveBoolean?

Indicates if the price is tax inclusive.

Returns:

  • (Boolean, nil)


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

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

#typeSymbol, Dodopayments::Models::Price::OneTimePrice::Type



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

required :type, enum: -> { Dodopayments::Price::OneTimePrice::Type }