Class: Dodopayments::Models::CheckoutSessionRequest

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

Instance Attribute 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_cart:, allowed_payment_method_types: nil, billing_address: nil, billing_currency: nil, cancel_url: nil, confirm: nil, custom_fields: nil, customer: nil, customization: nil, discount_code: nil, feature_flags: nil, force_3ds: nil, metadata: nil, minimal_address: nil, payment_method_id: nil, product_collection_id: nil, return_url: nil, short_link: nil, show_saved_payment_methods: nil, subscription_data: nil, tax_id: nil) ⇒ Object

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

Parameters:

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

    Customers will never see payment methods that are not in this list.

  • billing_address (Dodopayments::Models::CheckoutSessionBillingAddress, nil) (defaults to: nil)

    Billing address information for the session

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

    This field is ingored if adaptive pricing is disabled

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

    The URL to redirect the customer if they cancel or go back from the checkout.

  • confirm (Boolean) (defaults to: nil)

    If confirm is true, all the details will be finalized. If required data is missi

  • custom_fields (Array<Dodopayments::Models::CustomField>, nil) (defaults to: nil)

    Custom fields to collect from customer during checkout (max 5 fields)

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

    Customer details for the session

  • customization (Dodopayments::Models::CheckoutSessionCustomization) (defaults to: nil)

    Customization for the checkout session page

  • discount_code (String, nil) (defaults to: nil)
  • feature_flags (Dodopayments::Models::CheckoutSessionFlags) (defaults to: nil)
  • force_3ds (Boolean, nil) (defaults to: nil)

    Override merchant default 3DS behaviour for this session

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

    Additional metadata associated with the payment. Defaults to empty if not provid

  • minimal_address (Boolean) (defaults to: nil)

    If true, only zipcode is required when confirm is true; other address fields rem

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

    Optional payment method ID to use for this checkout session.

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

    Product collection ID for collection-based checkout flow

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

    The url to redirect after payment failure or success.

  • short_link (Boolean) (defaults to: nil)

    If true, returns a shortened checkout URL.

  • show_saved_payment_methods (Boolean) (defaults to: nil)

    Display saved payment methods of a returning customer False by default

  • subscription_data (Dodopayments::Models::SubscriptionData, nil) (defaults to: nil)
  • tax_id (String, nil) (defaults to: nil)

    Tax ID for the customer (e.g. VAT number). Requires billing_address with country



# File 'lib/dodopayments/models/checkout_session_request.rb', line 143

Instance Attribute Details

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

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

Disclaimar: Always provide ‘credit’ and ‘debit’ as a fallback. If all payment methods are unavailable, checkout session will fail.

Returns:



20
21
22
# File 'lib/dodopayments/models/checkout_session_request.rb', line 20

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

#billing_addressDodopayments::Models::CheckoutSessionBillingAddress?

Billing address information for the session



28
# File 'lib/dodopayments/models/checkout_session_request.rb', line 28

optional :billing_address, -> { Dodopayments::CheckoutSessionBillingAddress }, nil?: true

#billing_currencySymbol, ...

This field is ingored if adaptive pricing is disabled

Returns:



34
# File 'lib/dodopayments/models/checkout_session_request.rb', line 34

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

#cancel_urlString?

The URL to redirect the customer if they cancel or go back from the checkout. If not provided, the back button will not be displayed.

Returns:

  • (String, nil)


41
# File 'lib/dodopayments/models/checkout_session_request.rb', line 41

optional :cancel_url, String, nil?: true

#confirmBoolean?

If confirm is true, all the details will be finalized. If required data is missing, an API error is thrown.

Returns:

  • (Boolean, nil)


48
# File 'lib/dodopayments/models/checkout_session_request.rb', line 48

optional :confirm, Dodopayments::Internal::Type::Boolean

#custom_fieldsArray<Dodopayments::Models::CustomField>?

Custom fields to collect from customer during checkout (max 5 fields)

Returns:



54
55
56
# File 'lib/dodopayments/models/checkout_session_request.rb', line 54

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

#customerDodopayments::Models::AttachExistingCustomer, ...

Customer details for the session



62
# File 'lib/dodopayments/models/checkout_session_request.rb', line 62

optional :customer, union: -> { Dodopayments::CustomerRequest }, nil?: true

#customizationDodopayments::Models::CheckoutSessionCustomization?

Customization for the checkout session page



68
# File 'lib/dodopayments/models/checkout_session_request.rb', line 68

optional :customization, -> { Dodopayments::CheckoutSessionCustomization }

#discount_codeString?

Returns:

  • (String, nil)


73
# File 'lib/dodopayments/models/checkout_session_request.rb', line 73

optional :discount_code, String, nil?: true

#feature_flagsDodopayments::Models::CheckoutSessionFlags?



78
# File 'lib/dodopayments/models/checkout_session_request.rb', line 78

optional :feature_flags, -> { Dodopayments::CheckoutSessionFlags }

#force_3dsBoolean?

Override merchant default 3DS behaviour for this session

Returns:

  • (Boolean, nil)


84
# File 'lib/dodopayments/models/checkout_session_request.rb', line 84

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

#metadataHash{Symbol=>String}?

Additional metadata associated with the payment. Defaults to empty if not provided.

Returns:

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


91
# File 'lib/dodopayments/models/checkout_session_request.rb', line 91

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

#minimal_addressBoolean?

If true, only zipcode is required when confirm is true; other address fields remain optional

Returns:

  • (Boolean, nil)


98
# File 'lib/dodopayments/models/checkout_session_request.rb', line 98

optional :minimal_address, Dodopayments::Internal::Type::Boolean

#payment_method_idString?

Optional payment method ID to use for this checkout session. Only allowed when ‘confirm` is true. If provided, existing customer id must also be provided.

Returns:

  • (String, nil)


105
# File 'lib/dodopayments/models/checkout_session_request.rb', line 105

optional :payment_method_id, String, nil?: true

#product_cartArray<Dodopayments::Models::ProductItemReq>



9
# File 'lib/dodopayments/models/checkout_session_request.rb', line 9

required :product_cart, -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::ProductItemReq] }

#product_collection_idString?

Product collection ID for collection-based checkout flow

Returns:

  • (String, nil)


111
# File 'lib/dodopayments/models/checkout_session_request.rb', line 111

optional :product_collection_id, String, nil?: true

#return_urlString?

The url to redirect after payment failure or success.

Returns:

  • (String, nil)


117
# File 'lib/dodopayments/models/checkout_session_request.rb', line 117

optional :return_url, String, nil?: true

If true, returns a shortened checkout URL. Defaults to false if not specified.

Returns:

  • (Boolean, nil)


123
# File 'lib/dodopayments/models/checkout_session_request.rb', line 123

optional :short_link, Dodopayments::Internal::Type::Boolean

#show_saved_payment_methodsBoolean?

Display saved payment methods of a returning customer False by default

Returns:

  • (Boolean, nil)


129
# File 'lib/dodopayments/models/checkout_session_request.rb', line 129

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

#subscription_dataDodopayments::Models::SubscriptionData?



134
# File 'lib/dodopayments/models/checkout_session_request.rb', line 134

optional :subscription_data, -> { Dodopayments::SubscriptionData }, nil?: true

#tax_idString?

Tax ID for the customer (e.g. VAT number). Requires billing_address with country.

Returns:

  • (String, nil)


141
# File 'lib/dodopayments/models/checkout_session_request.rb', line 141

optional :tax_id, String, nil?: true