Class: WhopSDK::Models::Payment::PromoCode
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- WhopSDK::Models::Payment::PromoCode
- Defined in:
- lib/whop_sdk/models/payment.rb,
sig/whop_sdk/models/payment.rbs
Overview
Instance Attribute Summary collapse
-
#amount_off ⇒ Float
The discount amount.
-
#base_currency ⇒ Symbol, WhopSDK::Models::Currency
The monetary currency of the promo code.
-
#code ⇒ String?
The specific code used to apply the promo at checkout.
-
#id ⇒ String
The unique identifier for the promo code.
-
#number_of_intervals ⇒ Integer?
The number of months the promo is applied for.
-
#promo_type ⇒ Symbol, WhopSDK::Models::PromoType
The type (% or flat amount) of the promo.
Instance Method Summary collapse
- #initialize ⇒ Object constructor
- #to_hash ⇒ {
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 ⇒ Object
716 |
# File 'sig/whop_sdk/models/payment.rbs', line 716
def initialize: (
|
Instance Attribute Details
#amount_off ⇒ Float
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).
1002 |
# File 'lib/whop_sdk/models/payment.rb', line 1002 required :amount_off, Float |
#base_currency ⇒ Symbol, WhopSDK::Models::Currency
The monetary currency of the promo code.
1008 |
# File 'lib/whop_sdk/models/payment.rb', line 1008 required :base_currency, enum: -> { WhopSDK::Currency } |
#code ⇒ String?
The specific code used to apply the promo at checkout.
1014 |
# File 'lib/whop_sdk/models/payment.rb', line 1014 required :code, String, nil?: true |
#id ⇒ String
The unique identifier for the promo code.
994 |
# File 'lib/whop_sdk/models/payment.rb', line 994 required :id, String |
#number_of_intervals ⇒ Integer?
The number of months the promo is applied for.
1020 |
# File 'lib/whop_sdk/models/payment.rb', line 1020 required :number_of_intervals, Integer, nil?: true |
#promo_type ⇒ Symbol, WhopSDK::Models::PromoType
The type (% or flat amount) of the promo.
1026 |
# File 'lib/whop_sdk/models/payment.rb', line 1026 required :promo_type, enum: -> { WhopSDK::PromoType } |
Instance Method Details
#to_hash ⇒ {
725 |
# File 'sig/whop_sdk/models/payment.rbs', line 725
def to_hash: -> {
|