Class: WhopSDK::Models::Payment::PromoCode

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/whop_sdk/models/payment.rb

Overview

See Also:

Instance Attribute Summary collapse

Method Summary

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, #initialize, 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

This class inherits a constructor from WhopSDK::Internal::Type::BaseModel

Instance Attribute Details

#amount_offFloat

The discount amount. Interpretation depends on promo_type: if ‘percentage’, this is the percentage (e.g., 20 means 20% off); if ‘flat_amount’, this is dollars off (e.g., 10.00 means $10.00 off).

Returns:

  • (Float)


892
# File 'lib/whop_sdk/models/payment.rb', line 892

required :amount_off, Float

#base_currencySymbol, WhopSDK::Models::Currency

The monetary currency of the promo code.

Returns:



898
# File 'lib/whop_sdk/models/payment.rb', line 898

required :base_currency, enum: -> { WhopSDK::Currency }

#codeString?

The specific code used to apply the promo at checkout.

Returns:

  • (String, nil)


904
# File 'lib/whop_sdk/models/payment.rb', line 904

required :code, String, nil?: true

#idString

The unique identifier for the promo code.

Returns:

  • (String)


884
# File 'lib/whop_sdk/models/payment.rb', line 884

required :id, String

#number_of_intervalsInteger?

The number of months the promo is applied for.

Returns:

  • (Integer, nil)


910
# File 'lib/whop_sdk/models/payment.rb', line 910

required :number_of_intervals, Integer, nil?: true

#promo_typeSymbol, WhopSDK::Models::PromoType

The type (% or flat amount) of the promo.

Returns:



916
# File 'lib/whop_sdk/models/payment.rb', line 916

required :promo_type, enum: -> { WhopSDK::PromoType }