Class: Dodopayments::Models::UpdateSubscriptionPlanReq
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- Dodopayments::Models::UpdateSubscriptionPlanReq
- Defined in:
- lib/dodopayments/models/update_subscription_plan_req.rb
Direct Known Subclasses
SubscriptionChangePlanParams, SubscriptionPreviewChangePlanParams
Defined Under Namespace
Modules: EffectiveAt, OnPaymentFailure, ProrationBillingMode
Instance Attribute Summary collapse
-
#addons ⇒ Array<Dodopayments::Models::AttachAddon>?
Addons for the new plan.
-
#discount_code ⇒ String?
Optional discount code to apply to the new plan.
-
#effective_at ⇒ Symbol, ...
When to apply the plan change.
-
#metadata ⇒ Hash{Symbol=>String}?
Metadata for the payment.
-
#on_payment_failure ⇒ Symbol, ...
Controls behavior when the plan change payment fails.
-
#product_id ⇒ String
Unique identifier of the product to subscribe to.
-
#proration_billing_mode ⇒ Symbol, Dodopayments::Models::UpdateSubscriptionPlanReq::ProrationBillingMode
Proration Billing Mode.
-
#quantity ⇒ Integer
Number of units to subscribe for.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(product_id:, proration_billing_mode:, quantity:, addons: nil, discount_code: nil, effective_at: nil, metadata: nil, on_payment_failure: nil) ⇒ Object
constructor
Some parameter documentations has been truncated, see UpdateSubscriptionPlanReq 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(product_id:, proration_billing_mode:, quantity:, addons: nil, discount_code: nil, effective_at: nil, metadata: nil, on_payment_failure: nil) ⇒ Object
Some parameter documentations has been truncated, see Dodopayments::Models::UpdateSubscriptionPlanReq for more details.
|
|
# File 'lib/dodopayments/models/update_subscription_plan_req.rb', line 71
|
Instance Attribute Details
#addons ⇒ Array<Dodopayments::Models::AttachAddon>?
Addons for the new plan. Note : Leaving this empty would remove any existing addons
30 |
# File 'lib/dodopayments/models/update_subscription_plan_req.rb', line 30 optional :addons, -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::AttachAddon] }, nil?: true |
#discount_code ⇒ String?
Optional discount code to apply to the new plan. If provided, validates and applies the discount to the plan change. If not provided and the subscription has an existing discount with ‘preserve_on_plan_change=true`, the existing discount will be preserved (if applicable to the new product).
39 |
# File 'lib/dodopayments/models/update_subscription_plan_req.rb', line 39 optional :discount_code, String, nil?: true |
#effective_at ⇒ Symbol, ...
When to apply the plan change.
-
‘immediately` (default): Apply the plan change right away
-
‘next_billing_date`: Schedule the change for the next billing date
48 |
# File 'lib/dodopayments/models/update_subscription_plan_req.rb', line 48 optional :effective_at, enum: -> { Dodopayments::UpdateSubscriptionPlanReq::EffectiveAt } |
#metadata ⇒ Hash{Symbol=>String}?
Metadata for the payment. If not passed, the metadata of the subscription will be taken
55 |
# File 'lib/dodopayments/models/update_subscription_plan_req.rb', line 55 optional :metadata, Dodopayments::Internal::Type::HashOf[String], nil?: true |
#on_payment_failure ⇒ Symbol, ...
Controls behavior when the plan change payment fails.
-
‘prevent_change`: Keep subscription on current plan until payment succeeds
-
‘apply_change` (default): Apply plan change immediately regardless of payment outcome
If not specified, uses the business-level default setting.
67 68 69 |
# File 'lib/dodopayments/models/update_subscription_plan_req.rb', line 67 optional :on_payment_failure, enum: -> { Dodopayments::UpdateSubscriptionPlanReq::OnPaymentFailure }, nil?: true |
#product_id ⇒ String
Unique identifier of the product to subscribe to
10 |
# File 'lib/dodopayments/models/update_subscription_plan_req.rb', line 10 required :product_id, String |
#proration_billing_mode ⇒ Symbol, Dodopayments::Models::UpdateSubscriptionPlanReq::ProrationBillingMode
Proration Billing Mode
16 17 |
# File 'lib/dodopayments/models/update_subscription_plan_req.rb', line 16 required :proration_billing_mode, enum: -> { Dodopayments::UpdateSubscriptionPlanReq::ProrationBillingMode } |
#quantity ⇒ Integer
Number of units to subscribe for. Must be at least 1.
23 |
# File 'lib/dodopayments/models/update_subscription_plan_req.rb', line 23 required :quantity, Integer |
Class Method Details
.values ⇒ Array<Symbol>
|
|
# File 'lib/dodopayments/models/update_subscription_plan_req.rb', line 102
|