Class: WhopSDK::Models::Plan
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- WhopSDK::Models::Plan
- Defined in:
- lib/whop_sdk/models/plan.rb
Defined Under Namespace
Modules: ThreeDSLevel Classes: Company, CustomField, Invoice, PaymentMethodConfiguration, Product
Instance Attribute Summary collapse
-
#adaptive_pricing_enabled ⇒ Boolean
Whether the creator has turned on adaptive pricing for this plan.
-
#billing_period ⇒ Integer?
The number of days between each recurring charge.
-
#collect_tax ⇒ Boolean
Whether tax is collected on purchases of this plan, based on the company’s tax configuration.
-
#company ⇒ WhopSDK::Models::Plan::Company?
The company that sells this plan.
-
#created_at ⇒ Time
The datetime the plan was created.
-
#currency ⇒ Symbol, WhopSDK::Models::Currency
The currency used for all prices on this plan (e.g., ‘usd’, ‘eur’).
-
#custom_fields ⇒ Array<WhopSDK::Models::Plan::CustomField>
Custom input fields displayed on the checkout form that collect additional information from the buyer.
-
#description ⇒ String?
A text description of the plan visible to customers.
-
#expiration_days ⇒ Integer?
The number of days until the membership expires (for expiration-based plans).
-
#id ⇒ String
The unique identifier for the plan.
-
#initial_price ⇒ Float
The initial purchase price in the plan’s base_currency (e.g., 49.99 for $49.99).
-
#internal_notes ⇒ String?
Private notes visible only to the company owner and team members.
-
#invoice ⇒ WhopSDK::Models::Plan::Invoice?
The invoice this plan was generated for.
-
#member_count ⇒ Integer?
The number of users who currently hold an active membership through this plan.
-
#metadata ⇒ Hash{Symbol=>Object}?
Custom key-value pairs stored on the plan.
-
#payment_method_configuration ⇒ WhopSDK::Models::Plan::PaymentMethodConfiguration?
The explicit payment method configuration specifying which payment methods are enabled or disabled for this plan.
-
#plan_type ⇒ Symbol, WhopSDK::Models::PlanType
The billing model for this plan: ‘renewal’ for recurring subscriptions or ‘one_time’ for single payments.
-
#product ⇒ WhopSDK::Models::Plan::Product?
The product that this plan belongs to.
-
#purchase_url ⇒ String
The full URL where customers can purchase this plan directly, bypassing the product page.
-
#release_method ⇒ Symbol, WhopSDK::Models::ReleaseMethod
The method used to sell this plan: ‘buy_now’ for immediate purchase or ‘waitlist’ for waitlist-based access.
-
#renewal_price ⇒ Float
The recurring price charged every billing_period in the plan’s base_currency (e.g., 9.99 for $9.99/period).
-
#split_pay_required_payments ⇒ Integer?
The total number of installment payments required before the subscription pauses.
-
#stock ⇒ Integer?
The number of units available for purchase.
-
#tax_type ⇒ Symbol, WhopSDK::Models::TaxType
How tax is handled for this plan: ‘inclusive’ (tax included in price), ‘exclusive’ (tax added at checkout), or ‘unspecified’ (tax not configured).
-
#three_ds_level ⇒ Symbol, ...
The 3D Secure behavior for a plan.
-
#title ⇒ String?
The display name of the plan shown to customers on the product page and at checkout.
-
#trial_period_days ⇒ Integer?
The number of free trial days before the first charge on a renewal plan.
-
#unlimited_stock ⇒ Boolean
When true, the plan has unlimited stock (stock field is ignored).
-
#updated_at ⇒ Time
The datetime the plan was last updated.
-
#visibility ⇒ Symbol, WhopSDK::Models::Visibility
Controls whether the plan is visible to customers.
Instance Method Summary collapse
-
#initialize(id:, title:) ⇒ Object
constructor
Some parameter documentations has been truncated, see Product for more details.
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:, title:) ⇒ Object
Some parameter documentations has been truncated, see Product for more details.
The product that this plan belongs to. Null for standalone one-off purchases not linked to a product.
|
|
# File 'lib/whop_sdk/models/plan.rb', line 214
|
Instance Attribute Details
#adaptive_pricing_enabled ⇒ Boolean
Whether the creator has turned on adaptive pricing for this plan. Raw setting —does not check processor compatibility or feature flags.
17 |
# File 'lib/whop_sdk/models/plan.rb', line 17 required :adaptive_pricing_enabled, WhopSDK::Internal::Type::Boolean |
#billing_period ⇒ Integer?
The number of days between each recurring charge. Null for one-time plans. For example, 30 for monthly or 365 for annual billing.
24 |
# File 'lib/whop_sdk/models/plan.rb', line 24 required :billing_period, Integer, nil?: true |
#collect_tax ⇒ Boolean
Whether tax is collected on purchases of this plan, based on the company’s tax configuration.
31 |
# File 'lib/whop_sdk/models/plan.rb', line 31 required :collect_tax, WhopSDK::Internal::Type::Boolean |
#company ⇒ WhopSDK::Models::Plan::Company?
The company that sells this plan. Null for standalone invoice plans not linked to a company.
38 |
# File 'lib/whop_sdk/models/plan.rb', line 38 required :company, -> { WhopSDK::Plan::Company }, nil?: true |
#created_at ⇒ Time
The datetime the plan was created.
44 |
# File 'lib/whop_sdk/models/plan.rb', line 44 required :created_at, Time |
#currency ⇒ Symbol, WhopSDK::Models::Currency
The currency used for all prices on this plan (e.g., ‘usd’, ‘eur’). All monetary amounts on the plan are denominated in this currency.
51 |
# File 'lib/whop_sdk/models/plan.rb', line 51 required :currency, enum: -> { WhopSDK::Currency } |
#custom_fields ⇒ Array<WhopSDK::Models::Plan::CustomField>
Custom input fields displayed on the checkout form that collect additional information from the buyer.
58 |
# File 'lib/whop_sdk/models/plan.rb', line 58 required :custom_fields, -> { WhopSDK::Internal::Type::ArrayOf[WhopSDK::Plan::CustomField] } |
#description ⇒ String?
A text description of the plan visible to customers. Maximum 1000 characters. Null if no description is set.
65 |
# File 'lib/whop_sdk/models/plan.rb', line 65 required :description, String, nil?: true |
#expiration_days ⇒ Integer?
The number of days until the membership expires (for expiration-based plans). For example, 365 for a one-year access pass.
72 |
# File 'lib/whop_sdk/models/plan.rb', line 72 required :expiration_days, Integer, nil?: true |
#id ⇒ String
The unique identifier for the plan.
10 |
# File 'lib/whop_sdk/models/plan.rb', line 10 required :id, String |
#initial_price ⇒ Float
The initial purchase price in the plan’s base_currency (e.g., 49.99 for $49.99). For one-time plans, this is the full price. For renewal plans, this is charged on top of the first renewal_price.
80 |
# File 'lib/whop_sdk/models/plan.rb', line 80 required :initial_price, Float |
#internal_notes ⇒ String?
Private notes visible only to the company owner and team members. Not shown to customers. Null if no notes have been added.
87 |
# File 'lib/whop_sdk/models/plan.rb', line 87 required :internal_notes, String, nil?: true |
#invoice ⇒ WhopSDK::Models::Plan::Invoice?
The invoice this plan was generated for. Null if the plan was not created for a specific invoice.
94 |
# File 'lib/whop_sdk/models/plan.rb', line 94 required :invoice, -> { WhopSDK::Plan::Invoice }, nil?: true |
#member_count ⇒ Integer?
The number of users who currently hold an active membership through this plan. Only visible to authorized team members.
101 |
# File 'lib/whop_sdk/models/plan.rb', line 101 required :member_count, Integer, nil?: true |
#metadata ⇒ Hash{Symbol=>Object}?
Custom key-value pairs stored on the plan. Included in webhook payloads for payment and membership events.
108 |
# File 'lib/whop_sdk/models/plan.rb', line 108 required :metadata, WhopSDK::Internal::Type::HashOf[WhopSDK::Internal::Type::Unknown], nil?: true |
#payment_method_configuration ⇒ WhopSDK::Models::Plan::PaymentMethodConfiguration?
The explicit payment method configuration specifying which payment methods are enabled or disabled for this plan. Null if the plan uses default settings.
115 |
# File 'lib/whop_sdk/models/plan.rb', line 115 required :payment_method_configuration, -> { WhopSDK::Plan::PaymentMethodConfiguration }, nil?: true |
#plan_type ⇒ Symbol, WhopSDK::Models::PlanType
The billing model for this plan: ‘renewal’ for recurring subscriptions or ‘one_time’ for single payments.
122 |
# File 'lib/whop_sdk/models/plan.rb', line 122 required :plan_type, enum: -> { WhopSDK::PlanType } |
#product ⇒ WhopSDK::Models::Plan::Product?
The product that this plan belongs to. Null for standalone one-off purchases not linked to a product.
129 |
# File 'lib/whop_sdk/models/plan.rb', line 129 required :product, -> { WhopSDK::Plan::Product }, nil?: true |
#purchase_url ⇒ String
The full URL where customers can purchase this plan directly, bypassing the product page.
136 |
# File 'lib/whop_sdk/models/plan.rb', line 136 required :purchase_url, String |
#release_method ⇒ Symbol, WhopSDK::Models::ReleaseMethod
The method used to sell this plan: ‘buy_now’ for immediate purchase or ‘waitlist’ for waitlist-based access.
143 |
# File 'lib/whop_sdk/models/plan.rb', line 143 required :release_method, enum: -> { WhopSDK::ReleaseMethod } |
#renewal_price ⇒ Float
The recurring price charged every billing_period in the plan’s base_currency (e.g., 9.99 for $9.99/period). Zero for one-time plans.
150 |
# File 'lib/whop_sdk/models/plan.rb', line 150 required :renewal_price, Float |
#split_pay_required_payments ⇒ Integer?
The total number of installment payments required before the subscription pauses. Null if split pay is not configured. Must be greater than 1.
157 |
# File 'lib/whop_sdk/models/plan.rb', line 157 required :split_pay_required_payments, Integer, nil?: true |
#stock ⇒ Integer?
The number of units available for purchase. Only visible to authorized team members. Null if the requester lacks permission.
164 |
# File 'lib/whop_sdk/models/plan.rb', line 164 required :stock, Integer, nil?: true |
#tax_type ⇒ Symbol, WhopSDK::Models::TaxType
How tax is handled for this plan: ‘inclusive’ (tax included in price), ‘exclusive’ (tax added at checkout), or ‘unspecified’ (tax not configured).
171 |
# File 'lib/whop_sdk/models/plan.rb', line 171 required :tax_type, enum: -> { WhopSDK::TaxType } |
#three_ds_level ⇒ Symbol, ...
The 3D Secure behavior for a plan.
177 |
# File 'lib/whop_sdk/models/plan.rb', line 177 required :three_ds_level, enum: -> { WhopSDK::Plan::ThreeDSLevel }, nil?: true |
#title ⇒ String?
The display name of the plan shown to customers on the product page and at checkout. Maximum 30 characters. Null if no title has been set.
184 |
# File 'lib/whop_sdk/models/plan.rb', line 184 required :title, String, nil?: true |
#trial_period_days ⇒ Integer?
The number of free trial days before the first charge on a renewal plan. Null if no trial is configured or the current user has already used a trial for this plan.
192 |
# File 'lib/whop_sdk/models/plan.rb', line 192 required :trial_period_days, Integer, nil?: true |
#unlimited_stock ⇒ Boolean
When true, the plan has unlimited stock (stock field is ignored). When false, purchases are limited by the stock field.
199 |
# File 'lib/whop_sdk/models/plan.rb', line 199 required :unlimited_stock, WhopSDK::Internal::Type::Boolean |
#updated_at ⇒ Time
The datetime the plan was last updated.
205 |
# File 'lib/whop_sdk/models/plan.rb', line 205 required :updated_at, Time |
#visibility ⇒ Symbol, WhopSDK::Models::Visibility
Controls whether the plan is visible to customers. When set to ‘hidden’, the plan is only accessible via direct link.
212 |
# File 'lib/whop_sdk/models/plan.rb', line 212 required :visibility, enum: -> { WhopSDK::Visibility } |