Class: Dodopayments::Models::PaymentCreateParams

Inherits:
Internal::Type::BaseModel show all
Extended by:
Internal::Type::RequestParameters::Converter
Includes:
Internal::Type::RequestParameters
Defined in:
lib/dodopayments/models/payment_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_cart:, adaptive_currency_fees_inclusive: nil, allowed_payment_method_types: nil, billing_currency: nil, discount_code: nil, force_3ds: nil, metadata: nil, payment_link: nil, payment_method_id: nil, redirect_immediately: nil, require_phone_number: nil, return_url: nil, short_link: nil, show_saved_payment_methods: nil, tax_id: nil, request_options: {}) ⇒ Object

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

Parameters:

  • billing (Dodopayments::Models::BillingAddress)

    Billing address details for the payment

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

    Customer information for the payment

  • product_cart (Array<Dodopayments::Models::OneTimeProductCartItem>)

    List of products in the cart. Must contain at least 1 and at most 100 items.

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

    Whether adaptive currency fees should be included in the price (true) or added o

  • 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 transaction

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

    Override merchant default 3DS behaviour for this payment

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

    Additional metadata associated with the payment.

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

    Whether to generate a payment link. Defaults to false if not specified.

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

    Optional payment method ID to use for this payment.

  • redirect_immediately (Boolean) (defaults to: nil)

    If true, redirects the customer immediately after payment completion

  • require_phone_number (Boolean) (defaults to: nil)

    If true, the customer’s phone number is required to create this payment.

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

    Optional URL to redirect the customer after payment.

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

    If true, returns a shortened payment link.

  • 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

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


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

Instance Attribute Details

#adaptive_currency_fees_inclusiveBoolean?

Whether adaptive currency fees should be included in the price (true) or added on top (false). If not specified, defaults to the business-level setting.

Returns:

  • (Boolean, nil)


33
# File 'lib/dodopayments/models/payment_create_params.rb', line 33

optional :adaptive_currency_fees_inclusive, Dodopayments::Internal::Type::Boolean, 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:



44
45
46
# File 'lib/dodopayments/models/payment_create_params.rb', line 44

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

#billingDodopayments::Models::BillingAddress

Billing address details for the payment



14
# File 'lib/dodopayments/models/payment_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:



53
# File 'lib/dodopayments/models/payment_create_params.rb', line 53

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

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

Customer information for the payment



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

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

#discount_codeString?

Discount Code to apply to the transaction

Returns:

  • (String, nil)


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

optional :discount_code, String, nil?: true

#force_3dsBoolean?

Override merchant default 3DS behaviour for this payment

Returns:

  • (Boolean, nil)


65
# File 'lib/dodopayments/models/payment_create_params.rb', line 65

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)


72
# File 'lib/dodopayments/models/payment_create_params.rb', line 72

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

Whether to generate a payment link. Defaults to false if not specified.

Returns:

  • (Boolean, nil)


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

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

#payment_method_idString?

Optional payment method ID to use for this payment. If provided, customer_id must also be provided. The payment method will be validated for eligibility with the payment’s currency.

Returns:

  • (String, nil)


86
# File 'lib/dodopayments/models/payment_create_params.rb', line 86

optional :payment_method_id, String, nil?: true

#product_cartArray<Dodopayments::Models::OneTimeProductCartItem>

List of products in the cart. Must contain at least 1 and at most 100 items.



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

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

#redirect_immediatelyBoolean?

If true, redirects the customer immediately after payment completion False by default

Returns:

  • (Boolean, nil)


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

optional :redirect_immediately, Dodopayments::Internal::Type::Boolean

#require_phone_numberBoolean?

If true, the customer’s phone number is required to create this payment. Typically set alongside ‘payment_link=true` so merchants can enforce phone collection on the hosted payment page. Defaults to false.

Returns:

  • (Boolean, nil)


101
# File 'lib/dodopayments/models/payment_create_params.rb', line 101

optional :require_phone_number, Dodopayments::Internal::Type::Boolean

#return_urlString?

Optional URL to redirect the customer after payment. Must be a valid URL if provided.

Returns:

  • (String, nil)


108
# File 'lib/dodopayments/models/payment_create_params.rb', line 108

optional :return_url, String, nil?: true

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

Returns:

  • (Boolean, nil)


114
# File 'lib/dodopayments/models/payment_create_params.rb', line 114

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

#show_saved_payment_methodsBoolean?

Display saved payment methods of a returning customer False by default

Returns:

  • (Boolean, nil)


120
# File 'lib/dodopayments/models/payment_create_params.rb', line 120

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)


127
# File 'lib/dodopayments/models/payment_create_params.rb', line 127

optional :tax_id, String, nil?: true