Class: Dodopayments::Models::CheckoutSessionRequest

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

Direct Known Subclasses

CheckoutSessionCreateParams

Defined Under Namespace

Classes: BillingAddress, Customization, FeatureFlags, ProductCart, SubscriptionData

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(allow_currency_selection: nil, allow_customer_editing_city: nil, allow_customer_editing_country: nil, allow_customer_editing_email: nil, allow_customer_editing_name: nil, allow_customer_editing_state: nil, allow_customer_editing_street: nil, allow_customer_editing_zipcode: nil, allow_discount_code: nil, allow_phone_number_collection: nil, allow_tax_id: nil, always_create_new_customer: nil) ⇒ Object

Some parameter documentations has been truncated, see FeatureFlags for more details.

Parameters:

  • allow_currency_selection (Boolean) (defaults to: nil)

    if customer is allowed to change currency, set it to true

  • allow_customer_editing_city (Boolean) (defaults to: nil)
  • allow_customer_editing_country (Boolean) (defaults to: nil)
  • allow_customer_editing_email (Boolean) (defaults to: nil)
  • allow_customer_editing_name (Boolean) (defaults to: nil)
  • allow_customer_editing_state (Boolean) (defaults to: nil)
  • allow_customer_editing_street (Boolean) (defaults to: nil)
  • allow_customer_editing_zipcode (Boolean) (defaults to: nil)
  • allow_discount_code (Boolean) (defaults to: nil)

    If the customer is allowed to apply discount code, set it to true.

  • allow_phone_number_collection (Boolean) (defaults to: nil)

    If phone number is collected from customer, set it to rue

  • allow_tax_id (Boolean) (defaults to: nil)

    If the customer is allowed to add tax id, set it to true

  • always_create_new_customer (Boolean) (defaults to: nil)

    Set to true if a new customer object should be created.



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

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:



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

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

#billing_addressDodopayments::Models::CheckoutSessionRequest::BillingAddress?

Billing address information for the session



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

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

#billing_currencySymbol, ...

This field is ingored if adaptive pricing is disabled

Returns:



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

optional :billing_currency, enum: -> { Dodopayments::Currency }, 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)


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

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

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

Customer details for the session



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

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

#customizationDodopayments::Models::CheckoutSessionRequest::Customization?

Customization for the checkout session page



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

optional :customization, -> { Dodopayments::CheckoutSessionRequest::Customization }

#discount_codeString?

Returns:

  • (String, nil)


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

optional :discount_code, String, nil?: true

#feature_flagsDodopayments::Models::CheckoutSessionRequest::FeatureFlags?



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

optional :feature_flags, -> { Dodopayments::CheckoutSessionRequest::FeatureFlags }

#force_3dsBoolean?

Override merchant default 3DS behaviour for this session

Returns:

  • (Boolean, nil)


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

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)


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

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

#product_cartArray<Dodopayments::Models::CheckoutSessionRequest::ProductCart>



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

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

#return_urlString?

The url to redirect after payment failure or success.

Returns:

  • (String, nil)


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

optional :return_url, String, nil?: true

#show_saved_payment_methodsBoolean?

Display saved payment methods of a returning customer False by default

Returns:

  • (Boolean, nil)


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

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

#subscription_dataDodopayments::Models::CheckoutSessionRequest::SubscriptionData?



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

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

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


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