Class: Pago::V2026_04::Models::Refund

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

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  created_at: "created_at",
  modified_at: "modified_at",
  id: "id",
  metadata: "metadata",
  status: "status",
  reason: "reason",
  amount: "amount",
  tax_amount: "tax_amount",
  currency: "currency",
  organization_id: "organization_id",
  order_id: "order_id",
  subscription_id: "subscription_id",
  customer_id: "customer_id",
  revoke_benefits: "revoke_benefits",
  dispute: "dispute"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["created_at", "modified_at", "id", "metadata", "status", "reason", "amount", "tax_amount", "currency", "organization_id", "order_id", "subscription_id", "customer_id", "revoke_benefits", "dispute"].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:, metadata:, status:, reason:, amount:, tax_amount:, currency:, organization_id:, order_id:, subscription_id:, customer_id:, revoke_benefits:, dispute:) ⇒ Refund

Returns a new instance of Refund.

Parameters:

  • created_at: (String)
  • modified_at: (String, nil)
  • id: (String)
  • metadata: (Hash[String, untyped])
  • status: (String)
  • reason: (String)
  • amount: (Integer)
  • tax_amount: (Integer)
  • currency: (String)
  • organization_id: (String)
  • order_id: (String)
  • subscription_id: (String, nil)
  • customer_id: (String)
  • revoke_benefits: (Boolean)
  • dispute: (Models::RefundDispute, nil)


38265
38266
38267
38268
38269
38270
38271
38272
38273
38274
38275
38276
38277
38278
38279
38280
38281
38282
38283
38284
38285
38286
38287
38288
38289
38290
38291
38292
38293
38294
38295
38296
38297
38298
# File 'lib/pago/v2026_04/models.rb', line 38265

def initialize(
  created_at:,
  modified_at:,
  id:,
  metadata:,
  status:,
  reason:,
  amount:,
  tax_amount:,
  currency:,
  organization_id:,
  order_id:,
  subscription_id:,
  customer_id:,
  revoke_benefits:,
  dispute:
)
  super()
  assign(:created_at, created_at)
  assign(:modified_at, modified_at)
  assign(:id, id)
  assign(:metadata, )
  assign(:status, status)
  assign(:reason, reason)
  assign(:amount, amount)
  assign(:tax_amount, tax_amount)
  assign(:currency, currency)
  assign(:organization_id, organization_id)
  assign(:order_id, order_id)
  assign(:subscription_id, subscription_id)
  assign(:customer_id, customer_id)
  assign(:revoke_benefits, revoke_benefits)
  assign(:dispute, dispute)
end

Instance Attribute Details

#amountInteger (readonly)

Returns:

  • (Integer)


38239
38240
38241
# File 'lib/pago/v2026_04/models.rb', line 38239

def amount
  @amount
end

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


38219
38220
38221
# File 'lib/pago/v2026_04/models.rb', line 38219

def created_at
  @created_at
end

#currencyString (readonly)

Returns:

  • (String)


38245
38246
38247
# File 'lib/pago/v2026_04/models.rb', line 38245

def currency
  @currency
end

#customer_idString (readonly)

Returns:

  • (String)


38257
38258
38259
# File 'lib/pago/v2026_04/models.rb', line 38257

def customer_id
  @customer_id
end

#disputeModels::RefundDispute? (readonly)

Returns:



38263
38264
38265
# File 'lib/pago/v2026_04/models.rb', line 38263

def dispute
  @dispute
end

#idString (readonly)

The ID of the object.

Returns:

  • (String)


38227
38228
38229
# File 'lib/pago/v2026_04/models.rb', line 38227

def id
  @id
end

#metadataHash{String => String, Integer, Float, Boolean} (readonly)

Returns:

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


38230
38231
38232
# File 'lib/pago/v2026_04/models.rb', line 38230

def 
  @metadata
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


38223
38224
38225
# File 'lib/pago/v2026_04/models.rb', line 38223

def modified_at
  @modified_at
end

#order_idString (readonly)

Returns:

  • (String)


38251
38252
38253
# File 'lib/pago/v2026_04/models.rb', line 38251

def order_id
  @order_id
end

#organization_idString (readonly)

Returns:

  • (String)


38248
38249
38250
# File 'lib/pago/v2026_04/models.rb', line 38248

def organization_id
  @organization_id
end

#reasonString (readonly)

Returns:

  • (String)


38236
38237
38238
# File 'lib/pago/v2026_04/models.rb', line 38236

def reason
  @reason
end

#revoke_benefitsBoolean (readonly)

Returns:

  • (Boolean)


38260
38261
38262
# File 'lib/pago/v2026_04/models.rb', line 38260

def revoke_benefits
  @revoke_benefits
end

#statusString (readonly)

Returns:

  • (String)


38233
38234
38235
# File 'lib/pago/v2026_04/models.rb', line 38233

def status
  @status
end

#subscription_idString? (readonly)

Returns:

  • (String, nil)


38254
38255
38256
# File 'lib/pago/v2026_04/models.rb', line 38254

def subscription_id
  @subscription_id
end

#tax_amountInteger (readonly)

Returns:

  • (Integer)


38242
38243
38244
# File 'lib/pago/v2026_04/models.rb', line 38242

def tax_amount
  @tax_amount
end

Class Method Details

.from_json(data) ⇒ Refund?

Parameters:

  • data (Hash, String, nil)

Returns:



38302
38303
38304
38305
38306
38307
38308
38309
38310
38311
38312
38313
38314
38315
38316
38317
38318
38319
38320
38321
38322
38323
38324
38325
38326
38327
# File 'lib/pago/v2026_04/models.rb', line 38302

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),
      metadata: (data.key?("metadata") ? data["metadata"] : ::Pago::UNSET),
      status: (data.key?("status") ? data["status"] : ::Pago::UNSET),
      reason: (data.key?("reason") ? data["reason"] : ::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),
      organization_id: (data.key?("organization_id") ? data["organization_id"] : ::Pago::UNSET),
      order_id: (data.key?("order_id") ? data["order_id"] : ::Pago::UNSET),
      subscription_id: (data.key?("subscription_id") ? data["subscription_id"] : ::Pago::UNSET),
      customer_id: (data.key?("customer_id") ? data["customer_id"] : ::Pago::UNSET),
      revoke_benefits: (data.key?("revoke_benefits") ? data["revoke_benefits"] : ::Pago::UNSET),
      dispute: (data.key?("dispute") ? Models::RefundDispute.from_json(data["dispute"]) : ::Pago::UNSET)
    ),
    data
  )
end