Class: Pago::V2026_04::Models::WebhookOrderPaidPayload

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 paid.

When you receive this event, the order is fully processed and payment has been received.

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

Returns a new instance of WebhookOrderPaidPayload.

Parameters:



45499
45500
45501
45502
45503
45504
45505
45506
45507
45508
# File 'lib/pago/v2026_04/models.rb', line 45499

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

Instance Attribute Details

#dataModels::Order (readonly)

Returns:



45497
45498
45499
# File 'lib/pago/v2026_04/models.rb', line 45497

def data
  @data
end

#timestampString (readonly)

Returns:

  • (String)


45494
45495
45496
# File 'lib/pago/v2026_04/models.rb', line 45494

def timestamp
  @timestamp
end

#typeString (readonly)

Returns:

  • (String)


45491
45492
45493
# File 'lib/pago/v2026_04/models.rb', line 45491

def type
  @type
end

Class Method Details

.from_json(data) ⇒ WebhookOrderPaidPayload?

Parameters:

  • data (Hash, String, nil)

Returns:



45512
45513
45514
45515
45516
45517
45518
45519
45520
45521
45522
45523
45524
45525
# File 'lib/pago/v2026_04/models.rb', line 45512

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