Class: Pago::V2026_04::Models::WebhookOrderUpdatedPayload

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

Overview

Sent when an order is updated.

An order is updated when:

  • Its status changes, e.g. from pending to paid.
  • It's refunded, partially or fully.

Discord & Slack support: Full

Constant Summary collapse

JSON_KEYS =

Returns:

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

Returns:

  • (Array[String])
["type", "timestamp", "data"].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(type:, timestamp:, data:) ⇒ WebhookOrderUpdatedPayload

Returns a new instance of WebhookOrderUpdatedPayload.

Parameters:



45602
45603
45604
45605
45606
45607
45608
45609
45610
45611
# File 'lib/pago/v2026_04/models.rb', line 45602

def initialize(
  type:,
  timestamp:,
  data:
)
  super()
  assign(:type, type)
  assign(:timestamp, timestamp)
  assign(:data, data)
end

Instance Attribute Details

#dataModels::Order (readonly)

Returns:



45600
45601
45602
# File 'lib/pago/v2026_04/models.rb', line 45600

def data
  @data
end

#timestampString (readonly)

Returns:

  • (String)


45597
45598
45599
# File 'lib/pago/v2026_04/models.rb', line 45597

def timestamp
  @timestamp
end

#typeString (readonly)

Returns:

  • (String)


45594
45595
45596
# File 'lib/pago/v2026_04/models.rb', line 45594

def type
  @type
end

Class Method Details

.from_json(data) ⇒ WebhookOrderUpdatedPayload?

Parameters:

  • data (Hash, String, nil)

Returns:



45615
45616
45617
45618
45619
45620
45621
45622
45623
45624
45625
45626
45627
45628
# File 'lib/pago/v2026_04/models.rb', line 45615

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(
      type: (data.key?("type") ? data["type"] : ::Pago::UNSET),
      timestamp: (data.key?("timestamp") ? data["timestamp"] : ::Pago::UNSET),
      data: (data.key?("data") ? Models::Order.from_json(data["data"]) : ::Pago::UNSET)
    ),
    data
  )
end