Class: WhopSDK::Models::Plan

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

Defined Under Namespace

Modules: Currency, PlanType, ReleaseMethod, TaxType, ThreeDSLevel, Visibility Classes: CustomField

Instance Attribute Summary collapse

Class Method 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(id:, account:, adaptive_pricing_enabled:, billing_period:, collect_tax:, created_at:, currency:, custom_fields:, description:, expiration_days:, initial_price:, internal_notes:, invoice:, member_count:, metadata:, payment_method_configuration:, plan_type:, product:, purchase_url:, release_method:, renewal_price:, split_pay_required_payments:, stock:, tax_type:, three_ds_level:, title:, trial_period_days:, unlimited_stock:, updated_at:, visibility:) ⇒ Object

Some parameter documentations has been truncated, see WhopSDK::Models::Plan for more details.

Parameters:

  • id (String)

    Plan ID, prefixed plan_.

  • account (Object, nil)

    Account that sells this plan; null for standalone invoice plans.

  • adaptive_pricing_enabled (Boolean)

    Whether this plan accepts local currency payments via adaptive pricing.

  • billing_period (Float, nil)

    Recurring billing interval in days, such as 30 for monthly or 365 for annual. `n

  • collect_tax (Boolean)

    Whether tax is collected on purchases of this plan.

  • created_at (String)

    When the plan was created, as an ISO 8601 timestamp.

  • currency (Symbol, WhopSDK::Models::Plan::Currency)

    Three-letter ISO currency code for this plan's prices.

  • custom_fields (Array<WhopSDK::Models::Plan::CustomField>)
  • description (String, nil)

    Customer-visible plan description.

  • expiration_days (Float, nil)

    Access duration in days for expiration-based plans.

  • initial_price (Float)

    Initial purchase price in plan currency.

  • internal_notes (String, nil)

    Private notes visible only to authorized team members.

  • invoice (Object, nil)

    Invoice this plan was generated for; null unless created for an invoice.

  • member_count (Float, nil)

    Active memberships through this plan, when visible to the requester.

  • metadata (Object, nil)

    Custom key-value pairs stored on the plan.

  • payment_method_configuration (Object, nil)

    Payment method configuration (enabled, disabled, include_platform_defaults

  • plan_type (Symbol, WhopSDK::Models::Plan::PlanType)

    Billing model for this plan: renewal (recurring) or one_time (single payment

  • product (Object, nil)

    Product this plan belongs to; null for standalone plans.

  • purchase_url (String)

    URL where customers can purchase this plan directly.

  • release_method (Symbol, WhopSDK::Models::Plan::ReleaseMethod)

    Sales method for this plan, such as buy_now or waitlist.

  • renewal_price (Float)

    Recurring price charged every billing period.

  • split_pay_required_payments (Float, nil)

    Installment payments required before the subscription pauses.

  • stock (Float, nil)

    Units available for purchase, when visible to the requester.

  • tax_type (Symbol, WhopSDK::Models::Plan::TaxType)

    How tax is handled for this plan.

  • three_ds_level (Symbol, WhopSDK::Models::Plan::ThreeDSLevel, nil)

    3D Secure behavior for this plan; null inherits account default.

  • title (String, nil)

    Plan display name shown to customers.

  • trial_period_days (Float, nil)

    Free trial days before the first renewal charge. null if no trial is configure

  • unlimited_stock (Boolean)

    Whether the plan has unlimited stock.

  • updated_at (String)

    When the plan was last updated, as an ISO 8601 timestamp.

  • visibility (Symbol, WhopSDK::Models::Plan::Visibility)

    Whether the plan is visible to customers or hidden from public view.



# File 'lib/whop_sdk/models/plan.rb', line 189

Instance Attribute Details

#accountObject?

Account that sells this plan; null for standalone invoice plans.

Parameters:

  • value (top, nil)

Returns:

  • (Object, nil)


16
# File 'lib/whop_sdk/models/plan.rb', line 16

required :account, WhopSDK::Internal::Type::Unknown, nil?: true

#adaptive_pricing_enabledBoolean

Whether this plan accepts local currency payments via adaptive pricing.

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


22
# File 'lib/whop_sdk/models/plan.rb', line 22

required :adaptive_pricing_enabled, WhopSDK::Internal::Type::Boolean

#billing_periodFloat?

Recurring billing interval in days, such as 30 for monthly or 365 for annual. null for one-time plans.

Parameters:

  • value (Float, nil)

Returns:

  • (Float, nil)


29
# File 'lib/whop_sdk/models/plan.rb', line 29

required :billing_period, Float, nil?: true

#collect_taxBoolean

Whether tax is collected on purchases of this plan.

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


35
# File 'lib/whop_sdk/models/plan.rb', line 35

required :collect_tax, WhopSDK::Internal::Type::Boolean

#created_atString

When the plan was created, as an ISO 8601 timestamp.

Parameters:

  • value (String)

Returns:

  • (String)


41
# File 'lib/whop_sdk/models/plan.rb', line 41

required :created_at, String

#currencySymbol, WhopSDK::Models::Plan::Currency

Three-letter ISO currency code for this plan's prices.

Parameters:

  • value (WhopSDK::Models::Plan::currency)

Returns:



47
# File 'lib/whop_sdk/models/plan.rb', line 47

required :currency, enum: -> { WhopSDK::Plan::Currency }

#custom_fieldsArray<WhopSDK::Models::Plan::CustomField>

Parameters:

  • value (::Array[WhopSDK::Plan::CustomField])

Returns:



52
# File 'lib/whop_sdk/models/plan.rb', line 52

required :custom_fields, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Plan::CustomField] }

#descriptionString?

Customer-visible plan description.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


58
# File 'lib/whop_sdk/models/plan.rb', line 58

required :description, String, nil?: true

#expiration_daysFloat?

Access duration in days for expiration-based plans.

Parameters:

  • value (Float, nil)

Returns:

  • (Float, nil)


64
# File 'lib/whop_sdk/models/plan.rb', line 64

required :expiration_days, Float, nil?: true

#idString

Plan ID, prefixed plan_.

Parameters:

  • value (String)

Returns:

  • (String)


10
# File 'lib/whop_sdk/models/plan.rb', line 10

required :id, String

#initial_priceFloat

Initial purchase price in plan currency.

Parameters:

  • value (Float)

Returns:

  • (Float)


70
# File 'lib/whop_sdk/models/plan.rb', line 70

required :initial_price, Float

#internal_notesString?

Private notes visible only to authorized team members.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


76
# File 'lib/whop_sdk/models/plan.rb', line 76

required :internal_notes, String, nil?: true

#invoiceObject?

Invoice this plan was generated for; null unless created for an invoice.

Parameters:

  • value (top, nil)

Returns:

  • (Object, nil)


82
# File 'lib/whop_sdk/models/plan.rb', line 82

required :invoice, WhopSDK::Internal::Type::Unknown, nil?: true

#member_countFloat?

Active memberships through this plan, when visible to the requester.

Parameters:

  • value (Float, nil)

Returns:

  • (Float, nil)


88
# File 'lib/whop_sdk/models/plan.rb', line 88

required :member_count, Float, nil?: true

#metadataObject?

Custom key-value pairs stored on the plan.

Parameters:

  • value (top, nil)

Returns:

  • (Object, nil)


94
# File 'lib/whop_sdk/models/plan.rb', line 94

required :metadata, WhopSDK::Internal::Type::Unknown, nil?: true

#payment_method_configurationObject?

Payment method configuration (enabled, disabled, include_platform_defaults); null when plan uses default settings.

Parameters:

  • value (top, nil)

Returns:

  • (Object, nil)


101
# File 'lib/whop_sdk/models/plan.rb', line 101

required :payment_method_configuration, WhopSDK::Internal::Type::Unknown, nil?: true

#plan_typeSymbol, WhopSDK::Models::Plan::PlanType

Billing model for this plan: renewal (recurring) or one_time (single payment).

Parameters:

  • value (WhopSDK::Models::Plan::plan_type)

Returns:



108
# File 'lib/whop_sdk/models/plan.rb', line 108

required :plan_type, enum: -> { WhopSDK::Plan::PlanType }

#productObject?

Product this plan belongs to; null for standalone plans.

Parameters:

  • value (top, nil)

Returns:

  • (Object, nil)


114
# File 'lib/whop_sdk/models/plan.rb', line 114

required :product, WhopSDK::Internal::Type::Unknown, nil?: true

#purchase_urlString

URL where customers can purchase this plan directly.

Parameters:

  • value (String)

Returns:

  • (String)


120
# File 'lib/whop_sdk/models/plan.rb', line 120

required :purchase_url, String

#release_methodSymbol, WhopSDK::Models::Plan::ReleaseMethod

Sales method for this plan, such as buy_now or waitlist.

Parameters:

  • value (WhopSDK::Models::Plan::release_method)

Returns:



126
# File 'lib/whop_sdk/models/plan.rb', line 126

required :release_method, enum: -> { WhopSDK::Plan::ReleaseMethod }

#renewal_priceFloat

Recurring price charged every billing period.

Parameters:

  • value (Float)

Returns:

  • (Float)


132
# File 'lib/whop_sdk/models/plan.rb', line 132

required :renewal_price, Float

#split_pay_required_paymentsFloat?

Installment payments required before the subscription pauses.

Parameters:

  • value (Float, nil)

Returns:

  • (Float, nil)


138
# File 'lib/whop_sdk/models/plan.rb', line 138

required :split_pay_required_payments, Float, nil?: true

#stockFloat?

Units available for purchase, when visible to the requester.

Parameters:

  • value (Float, nil)

Returns:

  • (Float, nil)


144
# File 'lib/whop_sdk/models/plan.rb', line 144

required :stock, Float, nil?: true

#tax_typeSymbol, WhopSDK::Models::Plan::TaxType

How tax is handled for this plan.

Parameters:

  • value (WhopSDK::Models::Plan::tax_type)

Returns:



150
# File 'lib/whop_sdk/models/plan.rb', line 150

required :tax_type, enum: -> { WhopSDK::Plan::TaxType }

#three_ds_levelSymbol, ...

3D Secure behavior for this plan; null inherits account default.

Parameters:

  • value (WhopSDK::Models::Plan::three_ds_level, nil)

Returns:



156
# File 'lib/whop_sdk/models/plan.rb', line 156

required :three_ds_level, enum: -> { WhopSDK::Plan::ThreeDSLevel }, nil?: true

#titleString?

Plan display name shown to customers.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


162
# File 'lib/whop_sdk/models/plan.rb', line 162

required :title, String, nil?: true

#trial_period_daysFloat?

Free trial days before the first renewal charge. null if no trial is configured or the user has already used a trial for this plan.

Parameters:

  • value (Float, nil)

Returns:

  • (Float, nil)


169
# File 'lib/whop_sdk/models/plan.rb', line 169

required :trial_period_days, Float, nil?: true

#unlimited_stockBoolean

Whether the plan has unlimited stock.

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


175
# File 'lib/whop_sdk/models/plan.rb', line 175

required :unlimited_stock, WhopSDK::Internal::Type::Boolean

#updated_atString

When the plan was last updated, as an ISO 8601 timestamp.

Parameters:

  • value (String)

Returns:

  • (String)


181
# File 'lib/whop_sdk/models/plan.rb', line 181

required :updated_at, String

#visibilitySymbol, WhopSDK::Models::Plan::Visibility

Whether the plan is visible to customers or hidden from public view.

Parameters:

  • value (WhopSDK::Models::Plan::visibility)

Returns:



187
# File 'lib/whop_sdk/models/plan.rb', line 187

required :visibility, enum: -> { WhopSDK::Plan::Visibility }

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/whop_sdk/models/plan.rb', line 350

Instance Method Details

#to_hash{

Returns:

  • ({)


131
# File 'sig/whop_sdk/models/plan.rbs', line 131

def to_hash: -> {