Class: Dodopayments::Models::UpdateSubscriptionPlanReq

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/dodopayments/models/update_subscription_plan_req.rb

Defined Under Namespace

Modules: EffectiveAt, OnPaymentFailure, ProrationBillingMode

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

Parameters:



# File 'lib/dodopayments/models/update_subscription_plan_req.rb', line 71

Instance Attribute Details

#addonsArray<Dodopayments::Models::AttachAddon>?

Addons for the new plan. Note : Leaving this empty would remove any existing addons

Returns:



30
# File 'lib/dodopayments/models/update_subscription_plan_req.rb', line 30

optional :addons, -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::AttachAddon] }, nil?: true

#discount_codeString?

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

Returns:

  • (String, nil)


39
# File 'lib/dodopayments/models/update_subscription_plan_req.rb', line 39

optional :discount_code, String, nil?: true

#effective_atSymbol, ...

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 }

#metadataHash{Symbol=>String}?

Metadata for the payment. If not passed, the metadata of the subscription will be taken

Returns:

  • (Hash{Symbol=>String}, nil)


55
# File 'lib/dodopayments/models/update_subscription_plan_req.rb', line 55

optional :metadata, Dodopayments::Internal::Type::HashOf[String], nil?: true

#on_payment_failureSymbol, ...

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_idString

Unique identifier of the product to subscribe to

Returns:

  • (String)


10
# File 'lib/dodopayments/models/update_subscription_plan_req.rb', line 10

required :product_id, String

#proration_billing_modeSymbol, 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 }

#quantityInteger

Number of units to subscribe for. Must be at least 1.

Returns:

  • (Integer)


23
# File 'lib/dodopayments/models/update_subscription_plan_req.rb', line 23

required :quantity, Integer

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/dodopayments/models/update_subscription_plan_req.rb', line 102