Class: Pago::V2026_04::Models::Dispute

Inherits:
Model
  • Object
show all
Defined in:
lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs

Overview

Schema representing a dispute.

A dispute is a challenge raised by a customer or their bank regarding a payment.

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  created_at: "created_at",
  modified_at: "modified_at",
  id: "id",
  status: "status",
  resolved: "resolved",
  closed: "closed",
  amount: "amount",
  tax_amount: "tax_amount",
  currency: "currency",
  reason: "reason",
  evidence_due_by: "evidence_due_by",
  past_due: "past_due",
  order_id: "order_id",
  payment_id: "payment_id",
  customer: "customer",
  case_id: "case_id"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["created_at", "modified_at", "id", "status", "resolved", "closed", "amount", "tax_amount", "currency", "reason", "evidence_due_by", "past_due", "order_id", "payment_id", "customer", "case_id"].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw

Constructor Details

#initialize(created_at:, modified_at:, id:, status:, resolved:, closed:, amount:, tax_amount:, currency:, reason:, evidence_due_by:, past_due:, order_id:, payment_id:, customer:, case_id:) ⇒ Dispute

Returns a new instance of Dispute.

Parameters:

  • created_at: (String)
  • modified_at: (String, nil)
  • id: (String)
  • status: (String)
  • resolved: (Boolean)
  • closed: (Boolean)
  • amount: (Integer)
  • tax_amount: (Integer)
  • currency: (String)
  • reason: (String, nil)
  • evidence_due_by: (String, nil)
  • past_due: (Boolean)
  • order_id: (String)
  • payment_id: (String)
  • customer: (Models::DisputeCustomer)
  • case_id: (String, nil)


24215
24216
24217
24218
24219
24220
24221
24222
24223
24224
24225
24226
24227
24228
24229
24230
24231
24232
24233
24234
24235
24236
24237
24238
24239
24240
24241
24242
24243
24244
24245
24246
24247
24248
24249
24250
# File 'lib/pago/v2026_04/models.rb', line 24215

def initialize(
  created_at:,
  modified_at:,
  id:,
  status:,
  resolved:,
  closed:,
  amount:,
  tax_amount:,
  currency:,
  reason:,
  evidence_due_by:,
  past_due:,
  order_id:,
  payment_id:,
  customer:,
  case_id:
)
  super()
  assign(:created_at, created_at)
  assign(:modified_at, modified_at)
  assign(:id, id)
  assign(:status, status)
  assign(:resolved, resolved)
  assign(:closed, closed)
  assign(:amount, amount)
  assign(:tax_amount, tax_amount)
  assign(:currency, currency)
  assign(:reason, reason)
  assign(:evidence_due_by, evidence_due_by)
  assign(:past_due, past_due)
  assign(:order_id, order_id)
  assign(:payment_id, payment_id)
  assign(:customer, customer)
  assign(:case_id, case_id)
end

Instance Attribute Details

#amountInteger (readonly)

Amount in cents disputed.

Returns:

  • (Integer)


24178
24179
24180
# File 'lib/pago/v2026_04/models.rb', line 24178

def amount
  @amount
end

#case_idString? (readonly)

The ID of the support case for this dispute, if one was opened.

Returns:

  • (String, nil)


24213
24214
24215
# File 'lib/pago/v2026_04/models.rb', line 24213

def case_id
  @case_id
end

#closedBoolean (readonly)

Whether the dispute is closed (prevented, won, or lost).

Returns:

  • (Boolean)


24174
24175
24176
# File 'lib/pago/v2026_04/models.rb', line 24174

def closed
  @closed
end

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


24155
24156
24157
# File 'lib/pago/v2026_04/models.rb', line 24155

def created_at
  @created_at
end

#currencyString (readonly)

Currency code of the dispute.

Returns:

  • (String)


24186
24187
24188
# File 'lib/pago/v2026_04/models.rb', line 24186

def currency
  @currency
end

#customerModels::DisputeCustomer (readonly)



24209
24210
24211
# File 'lib/pago/v2026_04/models.rb', line 24209

def customer
  @customer
end

#evidence_due_byString? (readonly)

Deadline to submit evidence in response to the dispute. None when no response is required.

Returns:

  • (String, nil)


24194
24195
24196
# File 'lib/pago/v2026_04/models.rb', line 24194

def evidence_due_by
  @evidence_due_by
end

#idString (readonly)

The ID of the object.

Returns:

  • (String)


24163
24164
24165
# File 'lib/pago/v2026_04/models.rb', line 24163

def id
  @id
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


24159
24160
24161
# File 'lib/pago/v2026_04/models.rb', line 24159

def modified_at
  @modified_at
end

#order_idString (readonly)

The ID of the order associated with the dispute.

Returns:

  • (String)


24202
24203
24204
# File 'lib/pago/v2026_04/models.rb', line 24202

def order_id
  @order_id
end

#past_dueBoolean (readonly)

Whether the evidence submission deadline has passed.

Returns:

  • (Boolean)


24198
24199
24200
# File 'lib/pago/v2026_04/models.rb', line 24198

def past_due
  @past_due
end

#payment_idString (readonly)

The ID of the payment associated with the dispute.

Returns:

  • (String)


24206
24207
24208
# File 'lib/pago/v2026_04/models.rb', line 24206

def payment_id
  @payment_id
end

#reasonString? (readonly)

The reason for the dispute as reported by the card network (e.g. fraudulent, product_not_received). None until the processor reports it.

Returns:

  • (String, nil)


24190
24191
24192
# File 'lib/pago/v2026_04/models.rb', line 24190

def reason
  @reason
end

#resolvedBoolean (readonly)

Whether the dispute has been resolved (won or lost).

Returns:

  • (Boolean)


24170
24171
24172
# File 'lib/pago/v2026_04/models.rb', line 24170

def resolved
  @resolved
end

#statusString (readonly)

Returns:

  • (String)


24166
24167
24168
# File 'lib/pago/v2026_04/models.rb', line 24166

def status
  @status
end

#tax_amountInteger (readonly)

Tax amount in cents disputed.

Returns:

  • (Integer)


24182
24183
24184
# File 'lib/pago/v2026_04/models.rb', line 24182

def tax_amount
  @tax_amount
end

Class Method Details

.from_json(data) ⇒ Dispute?

Parameters:

  • data (Hash, String, nil)

Returns:



24254
24255
24256
24257
24258
24259
24260
24261
24262
24263
24264
24265
24266
24267
24268
24269
24270
24271
24272
24273
24274
24275
24276
24277
24278
24279
24280
# File 'lib/pago/v2026_04/models.rb', line 24254

def self.from_json(data)
  data = ::JSON.parse(data) if data.is_a?(String)
  data = ::Pago::Serde.object(data)
  return nil if data.nil?

  wrap_raw(
    new(
      created_at: (data.key?("created_at") ? data["created_at"] : ::Pago::UNSET),
      modified_at: (data.key?("modified_at") ? data["modified_at"] : ::Pago::UNSET),
      id: (data.key?("id") ? data["id"] : ::Pago::UNSET),
      status: (data.key?("status") ? data["status"] : ::Pago::UNSET),
      resolved: (data.key?("resolved") ? data["resolved"] : ::Pago::UNSET),
      closed: (data.key?("closed") ? data["closed"] : ::Pago::UNSET),
      amount: (data.key?("amount") ? data["amount"] : ::Pago::UNSET),
      tax_amount: (data.key?("tax_amount") ? data["tax_amount"] : ::Pago::UNSET),
      currency: (data.key?("currency") ? data["currency"] : ::Pago::UNSET),
      reason: (data.key?("reason") ? data["reason"] : ::Pago::UNSET),
      evidence_due_by: (data.key?("evidence_due_by") ? data["evidence_due_by"] : ::Pago::UNSET),
      past_due: (data.key?("past_due") ? data["past_due"] : ::Pago::UNSET),
      order_id: (data.key?("order_id") ? data["order_id"] : ::Pago::UNSET),
      payment_id: (data.key?("payment_id") ? data["payment_id"] : ::Pago::UNSET),
      customer: (data.key?("customer") ? Models::DisputeCustomer.from_json(data["customer"]) : ::Pago::UNSET),
      case_id: (data.key?("case_id") ? data["case_id"] : ::Pago::UNSET)
    ),
    data
  )
end