Class: Dodopayments::Models::Payment

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

Overview

See Also:

  • Dodopayments::Resources::Payments#retrieve

Direct Known Subclasses

WebhookPayload::Data::Payment

Defined Under Namespace

Modules: PaymentProvider Classes: ProductCart

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(billing:, brand_id:, business_id:, created_at:, currency:, customer:, digital_products_delivered:, disputes:, metadata:, payment_id:, payment_provider:, refunds:, retry_attempt:, settlement_amount:, settlement_currency:, total_amount:, card_holder_name: nil, card_issuing_country: nil, card_last_four: nil, card_network: nil, card_type: nil, checkout_session_id: nil, custom_field_responses: nil, discount_id: nil, discounts: nil, error_code: nil, error_message: nil, invoice_id: nil, invoice_url: nil, payment_link: nil, payment_method: nil, payment_method_type: nil, product_cart: nil, refund_status: nil, settlement_tax: nil, status: nil, subscription_id: nil, tax: nil, updated_at: nil) ⇒ Object

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

Parameters:

  • billing (Dodopayments::Models::BillingAddress)

    Billing address details for payments

  • brand_id (String)

    brand id this payment belongs to

  • business_id (String)

    Identifier of the business associated with the payment

  • created_at (Time)

    Timestamp when the payment was created

  • currency (Symbol, Dodopayments::Models::Currency)

    Currency used for the payment

  • customer (Dodopayments::Models::CustomerLimitedDetails)

    Details about the customer who made the payment

  • digital_products_delivered (Boolean)

    Whether the digital products purchased in this payment have been delivered.

  • disputes (Array<Dodopayments::Models::Dispute>)

    List of disputes associated with this payment

  • metadata (Hash{Symbol=>String, Float, Boolean})

    Additional custom data associated with the payment

  • payment_id (String)

    Unique identifier for the payment

  • payment_provider (Symbol, Dodopayments::Models::Payment::PaymentProvider)

    Which processor handled this payment. stripe / adyen for BYOP routes

  • refunds (Array<Dodopayments::Models::RefundListItem>)

    List of refunds issued for this payment

  • retry_attempt (Integer)

    Retry attempt number for subscription renewal payments.

  • settlement_amount (Integer)

    The amount that will be credited to your Dodo balance after currency conversion

  • settlement_currency (Symbol, Dodopayments::Models::Currency)

    The currency in which the settlement_amount will be credited to your Dodo balanc

  • total_amount (Integer)

    Total amount charged to the customer including tax, in the currency's smallest u

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

    Cardholder name

  • card_issuing_country (Symbol, Dodopayments::Models::CountryCode, nil) (defaults to: nil)

    ISO2 country code of the card

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

    The last four digits of the card

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

    Card network like VISA, MASTERCARD etc.

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

    The type of card DEBIT or CREDIT

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

    If payment is made using a checkout session,

  • custom_field_responses (Array<Dodopayments::Models::CustomFieldResponse>, nil) (defaults to: nil)

    Customer's responses to custom fields collected during checkout

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

    DEPRECATED: Use discounts instead. Returns the first discount's ID if present.

  • discounts (Array<Dodopayments::Models::DiscountDetail>, nil) (defaults to: nil)

    All stacked discounts applied, ordered by position

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

    An error code if the payment failed

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

    An error message if the payment failed

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

    Invoice ID for this payment. Uses India-specific invoice ID if available.

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

    URL to download the invoice PDF for this payment.

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

    Checkout URL

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

    Payment method used by customer (e.g. "card", "bank_transfer")

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

    Specific type of payment method (e.g. "visa", "mastercard")

  • product_cart (Array<Dodopayments::Models::Payment::ProductCart>, nil) (defaults to: nil)

    List of products purchased in a one-time payment

  • refund_status (Symbol, Dodopayments::Models::PaymentRefundStatus, nil) (defaults to: nil)

    Summary of the refund status for this payment. None if no succeeded refunds exis

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

    This represents the portion of settlement_amount that corresponds to taxes colle

  • status (Symbol, Dodopayments::Models::IntentStatus, nil) (defaults to: nil)

    Current status of the payment intent

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

    Identifier of the subscription if payment is part of a subscription

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

    Amount of tax collected in the currency's smallest unit

  • updated_at (Time, nil) (defaults to: nil)

    Timestamp when the payment was last updated



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

Instance Attribute Details

#billingDodopayments::Models::BillingAddress

Billing address details for payments



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

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

#brand_idString

brand id this payment belongs to

Parameters:

  • value (String)

Returns:

  • (String)


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

required :brand_id, String

#business_idString

Identifier of the business associated with the payment

Parameters:

  • value (String)

Returns:

  • (String)


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

required :business_id, String

#card_holder_nameString?

Cardholder name

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

optional :card_holder_name, String, nil?: true

#card_issuing_countrySymbol, ...

ISO2 country code of the card

Parameters:

  • value (Dodopayments::Models::country_code, nil)

Returns:



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

optional :card_issuing_country, enum: -> { Dodopayments::CountryCode }, nil?: true

#card_last_fourString?

The last four digits of the card

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

optional :card_last_four, String, nil?: true

#card_networkString?

Card network like VISA, MASTERCARD etc.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

optional :card_network, String, nil?: true

#card_typeString?

The type of card DEBIT or CREDIT

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

optional :card_type, String, nil?: true

#checkout_session_idString?

If payment is made using a checkout session, this field is set to the id of the session.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

optional :checkout_session_id, String, nil?: true

#created_atTime

Timestamp when the payment was created

Parameters:

  • value (Time)

Returns:

  • (Time)


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

required :created_at, Time

#currencySymbol, Dodopayments::Models::Currency

Currency used for the payment

Parameters:

  • value (Dodopayments::Models::currency)

Returns:



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

required :currency, enum: -> { Dodopayments::Currency }

#custom_field_responsesArray<Dodopayments::Models::CustomFieldResponse>?

Customer's responses to custom fields collected during checkout

Parameters:

Returns:



153
154
155
# File 'lib/dodopayments/models/payment.rb', line 153

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

#customerDodopayments::Models::CustomerLimitedDetails

Details about the customer who made the payment



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

required :customer, -> { Dodopayments::CustomerLimitedDetails }

#digital_products_deliveredBoolean

Whether the digital products purchased in this payment have been delivered.

Parameters:

  • value (Boolean)

Returns:

  • (Boolean)


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

required :digital_products_delivered, Dodopayments::Internal::Type::Boolean

#discount_idString?

Deprecated.

Use discounts instead.

DEPRECATED: Use discounts instead. Returns the first discount's ID if present.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

optional :discount_id, String, nil?: true

#discountsArray<Dodopayments::Models::DiscountDetail>?

All stacked discounts applied, ordered by position

Parameters:

Returns:



169
170
171
# File 'lib/dodopayments/models/payment.rb', line 169

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

#disputesArray<Dodopayments::Models::Dispute>

List of disputes associated with this payment

Parameters:

Returns:



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

required :disputes, -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Dispute] }

#error_codeString?

An error code if the payment failed

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

optional :error_code, String, nil?: true

#error_messageString?

An error message if the payment failed

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

optional :error_message, String, nil?: true

#invoice_idString?

Invoice ID for this payment. Uses India-specific invoice ID if available.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

optional :invoice_id, String, nil?: true

#invoice_urlString?

URL to download the invoice PDF for this payment.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

optional :invoice_url, String, nil?: true

#metadataHash{Symbol=>String, Float, Boolean}

Additional custom data associated with the payment

Parameters:

  • value (Dodopayments::Models::metadata)

Returns:

  • (Hash{Symbol=>String, Float, Boolean})


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

required :metadata, -> { Dodopayments::Internal::Type::HashOf[union: Dodopayments::MetadataItem] }

#payment_idString

Unique identifier for the payment

Parameters:

  • value (String)

Returns:

  • (String)


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

required :payment_id, String

Checkout URL

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

optional :payment_link, String, nil?: true

#payment_methodString?

Payment method used by customer (e.g. "card", "bank_transfer")

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

optional :payment_method, String, nil?: true

#payment_method_typeString?

Specific type of payment method (e.g. "visa", "mastercard")

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

optional :payment_method_type, String, nil?: true

#payment_providerSymbol, Dodopayments::Models::Payment::PaymentProvider

Which processor handled this payment. stripe / adyen for BYOP routes (the merchant's own payment connector); dodo for everything Dodo processed itself.

Parameters:

  • value (Dodopayments::Models::Payment::payment_provider)

Returns:



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

required :payment_provider, enum: -> { Dodopayments::Payment::PaymentProvider }

#product_cartArray<Dodopayments::Models::Payment::ProductCart>?

List of products purchased in a one-time payment

Parameters:

  • value (::Array[Dodopayments::Payment::ProductCart], nil)

Returns:



219
220
221
# File 'lib/dodopayments/models/payment.rb', line 219

optional :product_cart,
-> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::Payment::ProductCart] },
nil?: true

#refund_statusSymbol, ...

Summary of the refund status for this payment. None if no succeeded refunds exist.

Parameters:

  • value (Dodopayments::Models::payment_refund_status, nil)

Returns:



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

optional :refund_status, enum: -> { Dodopayments::PaymentRefundStatus }, nil?: true

#refundsArray<Dodopayments::Models::RefundListItem>

List of refunds issued for this payment

Parameters:

Returns:



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

required :refunds, -> { Dodopayments::Internal::Type::ArrayOf[Dodopayments::RefundListItem] }

#retry_attemptInteger

Retry attempt number for subscription renewal payments. 0 for the original payment, 1+ for each scheduled off-session retry after a failed renewal. Always 0 for non-subscription payments.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


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

required :retry_attempt, Integer

#settlement_amountInteger

The amount that will be credited to your Dodo balance after currency conversion and processing. Especially relevant for adaptive pricing where the customer's payment currency differs from your settlement currency.

Parameters:

  • value (Integer)

Returns:

  • (Integer)


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

required :settlement_amount, Integer

#settlement_currencySymbol, Dodopayments::Models::Currency

The currency in which the settlement_amount will be credited to your Dodo balance. This may differ from the customer's payment currency in adaptive pricing scenarios.

Parameters:

  • value (Dodopayments::Models::currency)

Returns:



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

required :settlement_currency, enum: -> { Dodopayments::Currency }

#settlement_taxInteger?

This represents the portion of settlement_amount that corresponds to taxes collected. Especially relevant for adaptive pricing where the tax component must be tracked separately in your Dodo balance.

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


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

optional :settlement_tax, Integer, nil?: true

#statusSymbol, ...

Current status of the payment intent

Parameters:

  • value (Dodopayments::Models::intent_status, nil)

Returns:



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

optional :status, enum: -> { Dodopayments::IntentStatus }, nil?: true

#subscription_idString?

Identifier of the subscription if payment is part of a subscription

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


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

optional :subscription_id, String, nil?: true

#taxInteger?

Amount of tax collected in the currency's smallest unit (e.g. cents for USD, yen for JPY, fils for KWD)

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


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

optional :tax, Integer, nil?: true

#total_amountInteger

Total amount charged to the customer including tax, in the currency's smallest unit (e.g. cents for USD, yen for JPY, fils for KWD — see the currency's decimal places)

Parameters:

  • value (Integer)

Returns:

  • (Integer)


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

required :total_amount, Integer

#updated_atTime?

Timestamp when the payment was last updated

Parameters:

  • value (Time, nil)

Returns:

  • (Time, nil)


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

optional :updated_at, Time, nil?: true

Class Method Details

.valuesArray<Symbol>

Returns:

  • (Array<Symbol>)


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

Instance Method Details

#to_hash{

Returns:

  • ({)


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

def to_hash: -> {