Class: Pago::V2026_04::Models::OrderFinalize

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

Overview

Schema to finalize a draft order and trigger an off-session charge.

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  payment_method_id: "payment_method_id"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
[].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(payment_method_id: ::Pago::UNSET) ⇒ OrderFinalize

Returns a new instance of OrderFinalize.

Parameters:

  • payment_method_id: (String, nil) (defaults to: ::Pago::UNSET)


32444
32445
32446
32447
32448
32449
# File 'lib/pago/v2026_04/models.rb', line 32444

def initialize(
  payment_method_id: ::Pago::UNSET
)
  super()
  assign(:payment_method_id, payment_method_id)
end

Instance Attribute Details

#payment_method_idString? (readonly)

ID of the payment method to charge. Must belong to the order's customer. Falls back to the customer's default payment method when unset.

Returns:

  • (String, nil)


32442
32443
32444
# File 'lib/pago/v2026_04/models.rb', line 32442

def payment_method_id
  @payment_method_id
end

Class Method Details

.from_json(data) ⇒ OrderFinalize?

Parameters:

  • data (Hash, String, nil)

Returns:



32453
32454
32455
32456
32457
32458
32459
32460
32461
32462
32463
32464
# File 'lib/pago/v2026_04/models.rb', line 32453

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