Class: Pago::V2026_04::Models::WebhookOrderRefundedPayload

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 fully or partially refunded.

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:) ⇒ WebhookOrderRefundedPayload

Returns a new instance of WebhookOrderRefundedPayload.

Parameters:



45548
45549
45550
45551
45552
45553
45554
45555
45556
45557
# File 'lib/pago/v2026_04/models.rb', line 45548

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

Instance Attribute Details

#dataModels::Order (readonly)

Returns:



45546
45547
45548
# File 'lib/pago/v2026_04/models.rb', line 45546

def data
  @data
end

#timestampString (readonly)

Returns:

  • (String)


45543
45544
45545
# File 'lib/pago/v2026_04/models.rb', line 45543

def timestamp
  @timestamp
end

#typeString (readonly)

Returns:

  • (String)


45540
45541
45542
# File 'lib/pago/v2026_04/models.rb', line 45540

def type
  @type
end

Class Method Details

.from_json(data) ⇒ WebhookOrderRefundedPayload?

Parameters:

  • data (Hash, String, nil)

Returns:



45561
45562
45563
45564
45565
45566
45567
45568
45569
45570
45571
45572
45573
45574
# File 'lib/pago/v2026_04/models.rb', line 45561

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