Class: Pago::V2026_04::Models::CustomerPaymentMethodCard

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",
  is_default: "is_default"
}.freeze
REQUIRED_KEYS =

Returns:

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

Returns a new instance of CustomerPaymentMethodCard.

Parameters:

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


18483
18484
18485
18486
18487
18488
18489
18490
18491
18492
18493
18494
18495
18496
18497
18498
18499
18500
18501
18502
# File 'lib/pago/v2026_04/models.rb', line 18483

def initialize(
  id:,
  created_at:,
  modified_at:,
  processor:,
  customer_id:,
  type:,
  method_metadata:,
  is_default:
)
  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, )
  assign(:is_default, is_default)
end

Instance Attribute Details

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


18461
18462
18463
# File 'lib/pago/v2026_04/models.rb', line 18461

def created_at
  @created_at
end

#customer_idString (readonly)

Returns:

  • (String)


18471
18472
18473
# File 'lib/pago/v2026_04/models.rb', line 18471

def customer_id
  @customer_id
end

#idString (readonly)

The ID of the object.

Returns:

  • (String)


18457
18458
18459
# File 'lib/pago/v2026_04/models.rb', line 18457

def id
  @id
end

#is_defaultBoolean (readonly)

Whether this payment method is the customer's default payment method.

Returns:

  • (Boolean)


18481
18482
18483
# File 'lib/pago/v2026_04/models.rb', line 18481

def is_default
  @is_default
end

#method_metadataModels::PaymentMethodCardMetadata (readonly)



18477
18478
18479
# File 'lib/pago/v2026_04/models.rb', line 18477

def 
  @method_metadata
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


18465
18466
18467
# File 'lib/pago/v2026_04/models.rb', line 18465

def modified_at
  @modified_at
end

#processorString (readonly)

Returns:

  • (String)


18468
18469
18470
# File 'lib/pago/v2026_04/models.rb', line 18468

def processor
  @processor
end

#typeString (readonly)

Returns:

  • (String)


18474
18475
18476
# File 'lib/pago/v2026_04/models.rb', line 18474

def type
  @type
end

Class Method Details

.from_json(data) ⇒ CustomerPaymentMethodCard?

Parameters:

  • data (Hash, String, nil)

Returns:



18506
18507
18508
18509
18510
18511
18512
18513
18514
18515
18516
18517
18518
18519
18520
18521
18522
18523
18524
# File 'lib/pago/v2026_04/models.rb', line 18506

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),
      is_default: (data.key?("is_default") ? data["is_default"] : ::Pago::UNSET)
    ),
    data
  )
end