Class: Pago::V2026_04::Models::CustomerOrderPaymentStatus

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

Overview

Payment status for an order.

Constant Summary collapse

JSON_KEYS =

Returns:

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

Returns:

  • (Array[String])
["status"].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(status:, error: ::Pago::UNSET) ⇒ CustomerOrderPaymentStatus

Returns a new instance of CustomerOrderPaymentStatus.

Parameters:

  • status: (String)
  • error: (String, nil) (defaults to: ::Pago::UNSET)


17721
17722
17723
17724
17725
17726
17727
17728
# File 'lib/pago/v2026_04/models.rb', line 17721

def initialize(
  status:,
  error: ::Pago::UNSET
)
  super()
  assign(:status, status)
  assign(:error, error)
end

Instance Attribute Details

#errorString? (readonly)

Error message if payment failed.

Returns:

  • (String, nil)


17719
17720
17721
# File 'lib/pago/v2026_04/models.rb', line 17719

def error
  @error
end

#statusString (readonly)

Current payment status.

Returns:

  • (String)


17715
17716
17717
# File 'lib/pago/v2026_04/models.rb', line 17715

def status
  @status
end

Class Method Details

.from_json(data) ⇒ CustomerOrderPaymentStatus?

Parameters:

  • data (Hash, String, nil)

Returns:



17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
17743
17744
# File 'lib/pago/v2026_04/models.rb', line 17732

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