Class: Pago::V2026_04::Models::WebhookCustomerCreatedPayload

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

Overview

Sent when a new customer is created.

A customer can be created:

  • After a successful checkout.
  • Programmatically via the API.

Discord & Slack support: Basic

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

Returns a new instance of WebhookCustomerCreatedPayload.

Parameters:

  • type: (String)
  • timestamp: (String)
  • data: (Object)


44926
44927
44928
44929
44930
44931
44932
44933
44934
44935
# File 'lib/pago/v2026_04/models.rb', line 44926

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

Instance Attribute Details

#dataObject (readonly)

Returns:

  • (Object)


44924
44925
44926
# File 'lib/pago/v2026_04/models.rb', line 44924

def data
  @data
end

#timestampString (readonly)

Returns:

  • (String)


44921
44922
44923
# File 'lib/pago/v2026_04/models.rb', line 44921

def timestamp
  @timestamp
end

#typeString (readonly)

Returns:

  • (String)


44918
44919
44920
# File 'lib/pago/v2026_04/models.rb', line 44918

def type
  @type
end

Class Method Details

.from_json(data) ⇒ WebhookCustomerCreatedPayload?

Parameters:

  • data (Hash, String, nil)

Returns:



44939
44940
44941
44942
44943
44944
44945
44946
44947
44948
44949
44950
44951
44952
# File 'lib/pago/v2026_04/models.rb', line 44939

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