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

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

Overview

See Also:

  • WhopSDK::Models::Payment#promo_code

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



716
# File 'sig/whop_sdk/models/payment.rbs', line 716

def initialize: (

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

Parameters:

  • value (Float)

Returns:

  • (Float)


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

required :amount_off, Float

#base_currencySymbol, WhopSDK::Models::Currency

The monetary currency of the promo code.

Parameters:

  • value (WhopSDK::Models::currency)

Returns:



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

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

#codeString?

The specific code used to apply the promo at checkout.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

required :code, String, nil?: true

#idString

The unique identifier for the promo code.

Parameters:

  • value (String)

Returns:

  • (String)


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

required :id, String

#number_of_intervalsInteger?

The number of months the promo is applied for.

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


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

required :number_of_intervals, Integer, nil?: true

#promo_typeSymbol, WhopSDK::Models::PromoType

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

Parameters:

  • value (WhopSDK::Models::promo_type)

Returns:



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

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

Instance Method Details

#to_hash{

Returns:

  • ({)


725
# File 'sig/whop_sdk/models/payment.rbs', line 725

def to_hash: -> {