Class: Dodopayments::Models::SubscriptionCreateParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/dodopayments/models/subscription_create_params.rb

Overview

Instance Attribute Summary collapse

Attributes included from Internal::Type::RequestParameters

#request_options

Instance Method Summary collapse

Methods included from Internal::Type::RequestParameters::Converter

dump_request

Methods included from Internal::Type::RequestParameters

included

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(billing: , customer: , product_id: , quantity: , addons: nil, allowed_payment_method_types: nil, billing_currency: nil, discount_code: nil, force_3ds: nil, metadata: nil, on_demand: nil, payment_link: nil, return_url: nil, show_saved_payment_methods: nil, tax_id: nil, trial_period_days: nil, request_options: {}) ⇒ Object

Some parameter documentations has been truncated, see Dodopayments::Models::SubscriptionCreateParams for more details.

Parameters:

  • billing (Dodopayments::Models::BillingAddress) (defaults to: )

    Billing address information for the subscription

  • customer (Dodopayments::Models::AttachExistingCustomer, Dodopayments::Models::NewCustomer) (defaults to: )

    Customer details for the subscription

  • product_id (String) (defaults to: )

    Unique identifier of the product to subscribe to

  • quantity (Integer) (defaults to: )

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

  • addons (Array<Dodopayments::Models::AttachAddon>, nil) (defaults to: nil)

    Attach addons to this subscription

  • allowed_payment_method_types (Array<Symbol, Dodopayments::Models::PaymentMethodTypes>, nil) (defaults to: nil)

    List of payment methods allowed during checkout.

  • billing_currency (Symbol, Dodopayments::Models::Currency, nil) (defaults to: nil)

    Fix the currency in which the end customer is billed.

  • discount_code (String, nil) (defaults to: nil)

    Discount Code to apply to the subscription

  • force_3ds (Boolean, nil) (defaults to: nil)

    Override merchant default 3DS behaviour for this subscription

  • metadata (Hash{Symbol=>String}) (defaults to: nil)

    Additional metadata for the subscription

  • on_demand (Dodopayments::Models::OnDemandSubscription, nil) (defaults to: nil)
  • payment_link (Boolean, nil) (defaults to: nil)

    If true, generates a payment link.

  • return_url (String, nil) (defaults to: nil)

    Optional URL to redirect after successful subscription creation

  • show_saved_payment_methods (Boolean) (defaults to: nil)

    Display saved payment methods of a returning customer

  • tax_id (String, nil) (defaults to: nil)

    Tax ID in case the payment is B2B. If tax id validation fails the payment creati

  • trial_period_days (Integer, nil) (defaults to: nil)

    Optional trial period in days

  • request_options (Dodopayments::RequestOptions, Hash{Symbol=>Object}) (defaults to: {})


# File 'lib/dodopayments/models/subscription_create_params.rb', line 115

Instance Attribute Details

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

Attach addons to this subscription

Returns:



38
# File 'lib/dodopayments/models/subscription_create_params.rb', line 38

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

#allowed_payment_method_typesArray<Symbol, Dodopayments::Models::PaymentMethodTypes>?

List of payment methods allowed during checkout.

Customers will never see payment methods that are not in this list. However, adding a method here **does not guarantee** customers will see it. Availability still depends on other factors (e.g., customer location, merchant settings).

Returns:



49
50
51
# File 'lib/dodopayments/models/subscription_create_params.rb', line 49

optional :allowed_payment_method_types,
-> { Dodopayments::Internal::Type::ArrayOf[enum: Dodopayments::PaymentMethodTypes] },
nil?: true

#billingDodopayments::Models::BillingAddress

Billing address information for the subscription



14
# File 'lib/dodopayments/models/subscription_create_params.rb', line 14

required :billing, -> { Dodopayments::BillingAddress }

#billing_currencySymbol, ...

Fix the currency in which the end customer is billed. If Dodo Payments cannot support that currency for this transaction, it will not proceed

Returns:



58
# File 'lib/dodopayments/models/subscription_create_params.rb', line 58

optional :billing_currency, enum: -> { Dodopayments::Currency }, nil?: true

#customerDodopayments::Models::AttachExistingCustomer, Dodopayments::Models::NewCustomer

Customer details for the subscription



20
# File 'lib/dodopayments/models/subscription_create_params.rb', line 20

required :customer, union: -> { Dodopayments::CustomerRequest }

#discount_codeString?

Discount Code to apply to the subscription

Returns:

  • (String, nil)


64
# File 'lib/dodopayments/models/subscription_create_params.rb', line 64

optional :discount_code, String, nil?: true

#force_3dsBoolean?

Override merchant default 3DS behaviour for this subscription

Returns:

  • (Boolean, nil)


70
# File 'lib/dodopayments/models/subscription_create_params.rb', line 70

optional :force_3ds, Dodopayments::Internal::Type::Boolean, nil?: true

#metadataHash{Symbol=>String}?

Additional metadata for the subscription Defaults to empty if not specified

Returns:

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


76
# File 'lib/dodopayments/models/subscription_create_params.rb', line 76

optional :metadata, Dodopayments::Internal::Type::HashOf[String]

#on_demandDodopayments::Models::OnDemandSubscription?



81
# File 'lib/dodopayments/models/subscription_create_params.rb', line 81

optional :on_demand, -> { Dodopayments::OnDemandSubscription }, nil?: true

If true, generates a payment link. Defaults to false if not specified.

Returns:

  • (Boolean, nil)


87
# File 'lib/dodopayments/models/subscription_create_params.rb', line 87

optional :payment_link, Dodopayments::Internal::Type::Boolean, nil?: true

#product_idString

Unique identifier of the product to subscribe to

Returns:

  • (String)


26
# File 'lib/dodopayments/models/subscription_create_params.rb', line 26

required :product_id, String

#quantityInteger

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

Returns:

  • (Integer)


32
# File 'lib/dodopayments/models/subscription_create_params.rb', line 32

required :quantity, Integer

#return_urlString?

Optional URL to redirect after successful subscription creation

Returns:

  • (String, nil)


93
# File 'lib/dodopayments/models/subscription_create_params.rb', line 93

optional :return_url, String, nil?: true

#show_saved_payment_methodsBoolean?

Display saved payment methods of a returning customer False by default

Returns:

  • (Boolean, nil)


99
# File 'lib/dodopayments/models/subscription_create_params.rb', line 99

optional :show_saved_payment_methods, Dodopayments::Internal::Type::Boolean

#tax_idString?

Tax ID in case the payment is B2B. If tax id validation fails the payment creation will fail

Returns:

  • (String, nil)


106
# File 'lib/dodopayments/models/subscription_create_params.rb', line 106

optional :tax_id, String, nil?: true

#trial_period_daysInteger?

Optional trial period in days If specified, this value overrides the trial period set in the product’s price Must be between 0 and 10000 days

Returns:

  • (Integer, nil)


113
# File 'lib/dodopayments/models/subscription_create_params.rb', line 113

optional :trial_period_days, Integer, nil?: true