Class: Dodopayments::Models::Discount::CurrencyOption

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/dodopayments/models/discount.rb,
sig/dodopayments/models/discount.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:, is_default:, minimum_subtotal:, max_amount_possible: nil) ⇒ Object

Some parameter documentations has been truncated, see Dodopayments::Models::Discount::CurrencyOption for more details.

A per-currency discount option (response shape). max_amount_possible mirrors the DB column of the same name.

Parameters:

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

    The currency this option applies to.

  • is_default (Boolean)

    Whether this is the default row FX conversions pivot from.

  • minimum_subtotal (Integer)

    Eligible-cart threshold in this currency's subunits (0 = no minimum).

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

    The most this code discounts in this currency's subunits (flat deduction



# File 'lib/dodopayments/models/discount.rb', line 202

Instance Attribute Details

#currencySymbol, Dodopayments::Models::Currency

The currency this option applies to.

Parameters:

  • value (Dodopayments::Models::currency)

Returns:



181
# File 'lib/dodopayments/models/discount.rb', line 181

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

#is_defaultBoolean

Whether this is the default row FX conversions pivot from.

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


187
# File 'lib/dodopayments/models/discount.rb', line 187

required :is_default, Dodopayments::Internal::Type::Boolean

#max_amount_possibleInteger?

The most this code discounts in this currency's subunits (flat deduction or percentage cap).

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


200
# File 'lib/dodopayments/models/discount.rb', line 200

optional :max_amount_possible, Integer, nil?: true

#minimum_subtotalInteger

Eligible-cart threshold in this currency's subunits (0 = no minimum).

Parameters:

  • value (Integer)

Returns:

  • (Integer)


193
# File 'lib/dodopayments/models/discount.rb', line 193

required :minimum_subtotal, Integer

Instance Method Details

#to_hash{

Returns:

  • ({)


145
# File 'sig/dodopayments/models/discount.rbs', line 145

def to_hash: -> {