Class: Pago::V2026_04::Models::CustomerPaymentMethodGeneric

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

Returns:

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

Returns a new instance of CustomerPaymentMethodGeneric.

Parameters:

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


18727
18728
18729
18730
18731
18732
18733
18734
18735
18736
18737
18738
18739
18740
18741
18742
18743
18744
# File 'lib/pago/v2026_04/models.rb', line 18727

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

Instance Attribute Details

#created_atString (readonly)

Creation timestamp of the object.

Returns:

  • (String)


18708
18709
18710
# File 'lib/pago/v2026_04/models.rb', line 18708

def created_at
  @created_at
end

#customer_idString (readonly)

Returns:

  • (String)


18718
18719
18720
# File 'lib/pago/v2026_04/models.rb', line 18718

def customer_id
  @customer_id
end

#idString (readonly)

The ID of the object.

Returns:

  • (String)


18704
18705
18706
# File 'lib/pago/v2026_04/models.rb', line 18704

def id
  @id
end

#is_defaultBoolean (readonly)

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

Returns:

  • (Boolean)


18725
18726
18727
# File 'lib/pago/v2026_04/models.rb', line 18725

def is_default
  @is_default
end

#modified_atString? (readonly)

Last modification timestamp of the object.

Returns:

  • (String, nil)


18712
18713
18714
# File 'lib/pago/v2026_04/models.rb', line 18712

def modified_at
  @modified_at
end

#processorString (readonly)

Returns:

  • (String)


18715
18716
18717
# File 'lib/pago/v2026_04/models.rb', line 18715

def processor
  @processor
end

#typeString (readonly)

Returns:

  • (String)


18721
18722
18723
# File 'lib/pago/v2026_04/models.rb', line 18721

def type
  @type
end

Class Method Details

.from_json(data) ⇒ CustomerPaymentMethodGeneric?

Parameters:

  • data (Hash, String, nil)

Returns:



18748
18749
18750
18751
18752
18753
18754
18755
18756
18757
18758
18759
18760
18761
18762
18763
18764
18765
# File 'lib/pago/v2026_04/models.rb', line 18748

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