Class: Dodopayments::Models::Payment::FailureDetails

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/dodopayments/models/payment.rb,
sig/dodopayments/models/payment.rbs

Overview

See Also:

  • Dodopayments::Models::Payment#failure_details

Defined Under Namespace

Modules: CustomerCta, CustomerTemplate, DeclineType

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(code:, customer_cta:, customer_fixable:, customer_message:, customer_template:, decline_type:, merchant_message:) ⇒ Object

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

Purpose-built failure messaging for the merchant and the customer, derived from error_code. Present whenever error_code is set, regardless of payment status; unrecognised codes still resolve via a generic fallback rather than being omitted. The customer copy is always generic for fraud-sensitive declines (lost/stolen/pickup/fraudulent) so the true reason is never leaked.

Parameters:



# File 'lib/dodopayments/models/payment.rb', line 434

Instance Attribute Details

#codeString

The unified error code (echoes error_code).

Parameters:

  • value (String)

Returns:

  • (String)


395
# File 'lib/dodopayments/models/payment.rb', line 395

required :code, String

#customer_ctaSymbol, Dodopayments::Models::Payment::FailureDetails::CustomerCta

The primary CTA to show the customer.

Parameters:

  • value (Dodopayments::Models::Payment::FailureDetails::customer_cta)

Returns:



401
# File 'lib/dodopayments/models/payment.rb', line 401

required :customer_cta, enum: -> { Dodopayments::Payment::FailureDetails::CustomerCta }

#customer_fixableBoolean

Whether the customer can resolve this themselves (e.g. fix CVC).

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


407
# File 'lib/dodopayments/models/payment.rb', line 407

required :customer_fixable, Dodopayments::Internal::Type::Boolean

#customer_messageString

The customer-facing string. Always generic (C11) for the fraud-4.

Parameters:

  • value (String)

Returns:

  • (String)


413
# File 'lib/dodopayments/models/payment.rb', line 413

required :customer_message, String

#customer_templateSymbol, Dodopayments::Models::Payment::FailureDetails::CustomerTemplate

The customer message template identifier (C1..C20).

Parameters:

  • value (Dodopayments::Models::Payment::FailureDetails::customer_template)

Returns:



419
# File 'lib/dodopayments/models/payment.rb', line 419

required :customer_template, enum: -> { Dodopayments::Payment::FailureDetails::CustomerTemplate }

#decline_typeSymbol, Dodopayments::Models::Payment::FailureDetails::DeclineType

Soft or hard decline.

Parameters:

  • value (Dodopayments::Models::Payment::FailureDetails::decline_type)

Returns:



425
# File 'lib/dodopayments/models/payment.rb', line 425

required :decline_type, enum: -> { Dodopayments::Payment::FailureDetails::DeclineType }

#merchant_messageString

Merchant-facing headline + recommended action (Payment Details). For the fraud-4 this includes the operator "do not reveal" warning.

Parameters:

  • value (String)

Returns:

  • (String)


432
# File 'lib/dodopayments/models/payment.rb', line 432

required :merchant_message, String

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


# File 'lib/dodopayments/models/payment.rb', line 472

Instance Method Details

#to_hash{

Returns:

  • ({)


272
# File 'sig/dodopayments/models/payment.rbs', line 272

def to_hash: -> {