Class: Pago::V2026_04::Models::PaymentMethodCard

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])
{
  id: "id",
  created_at: "created_at",
  modified_at: "modified_at",
  processor: "processor",
  customer_id: "customer_id",
  type: "type",
  method_metadata: "method_metadata"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["id", "created_at", "modified_at", "processor", "customer_id", "type", "method_metadata"].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(id:, created_at:, modified_at:, processor:, customer_id:, type:, method_metadata:) ⇒ PaymentMethodCard

Returns a new instance of PaymentMethodCard.

Parameters:

  • id: (String)
  • created_at: (String)
  • modified_at: (String, nil)
  • processor: (String)
  • customer_id: (String)
  • type: (String)
  • method_metadata: (Models::PaymentMethodCardMetadata)


35557
35558
35559
35560
35561
35562
35563
35564
35565
35566
35567
35568
35569
35570
35571
35572
35573
35574
# File 'lib/pago/v2026_04/models.rb', line 35557

def initialize(
  id:,
  created_at:,
  modified_at:,
  processor:,
  customer_id:,
  type:,
  method_metadata:
)
  super()
  assign(:id, id)
  assign(:created_at, created_at)
  assign(:modified_at, modified_at)
  assign(:processor, processor)
  assign(:customer_id, customer_id)
  assign(:type, type)
  assign(:method_metadata, )
end

Instance Attribute Details

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


35539
35540
35541
# File 'lib/pago/v2026_04/models.rb', line 35539

def created_at
  @created_at
end

#customer_idString (readonly)

Returns:

  • (String)


35549
35550
35551
# File 'lib/pago/v2026_04/models.rb', line 35549

def customer_id
  @customer_id
end

#idString (readonly)

The ID of the object.

Returns:

  • (String)


35535
35536
35537
# File 'lib/pago/v2026_04/models.rb', line 35535

def id
  @id
end

#method_metadataModels::PaymentMethodCardMetadata (readonly)



35555
35556
35557
# File 'lib/pago/v2026_04/models.rb', line 35555

def 
  @method_metadata
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


35543
35544
35545
# File 'lib/pago/v2026_04/models.rb', line 35543

def modified_at
  @modified_at
end

#processorString (readonly)

Returns:

  • (String)


35546
35547
35548
# File 'lib/pago/v2026_04/models.rb', line 35546

def processor
  @processor
end

#typeString (readonly)

Returns:

  • (String)


35552
35553
35554
# File 'lib/pago/v2026_04/models.rb', line 35552

def type
  @type
end

Class Method Details

.from_json(data) ⇒ PaymentMethodCard?

Parameters:

  • data (Hash, String, nil)

Returns:



35578
35579
35580
35581
35582
35583
35584
35585
35586
35587
35588
35589
35590
35591
35592
35593
35594
35595
# File 'lib/pago/v2026_04/models.rb', line 35578

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(
      id: (data.key?("id") ? data["id"] : ::Pago::UNSET),
      created_at: (data.key?("created_at") ? data["created_at"] : ::Pago::UNSET),
      modified_at: (data.key?("modified_at") ? data["modified_at"] : ::Pago::UNSET),
      processor: (data.key?("processor") ? data["processor"] : ::Pago::UNSET),
      customer_id: (data.key?("customer_id") ? data["customer_id"] : ::Pago::UNSET),
      type: (data.key?("type") ? data["type"] : ::Pago::UNSET),
      method_metadata: (data.key?("method_metadata") ? Models::PaymentMethodCardMetadata.from_json(data["method_metadata"]) : ::Pago::UNSET)
    ),
    data
  )
end