Class: Pago::V2026_04::Models::WebhookSubscriptionPastDuePayload

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

Overview

Sent when a subscription payment fails and the subscription enters past_due status.

This is a recoverable state - the customer can update their payment method to restore the subscription. Benefits may be revoked depending on the organization's grace period settings.

If payment retries are exhausted, a subscription.revoked event will be sent.

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

Returns a new instance of WebhookSubscriptionPastDuePayload.

Parameters:



46052
46053
46054
46055
46056
46057
46058
46059
46060
46061
# File 'lib/pago/v2026_04/models.rb', line 46052

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

Instance Attribute Details

#dataModels::Subscription (readonly)



46050
46051
46052
# File 'lib/pago/v2026_04/models.rb', line 46050

def data
  @data
end

#timestampString (readonly)

Returns:

  • (String)


46047
46048
46049
# File 'lib/pago/v2026_04/models.rb', line 46047

def timestamp
  @timestamp
end

#typeString (readonly)

Returns:

  • (String)


46044
46045
46046
# File 'lib/pago/v2026_04/models.rb', line 46044

def type
  @type
end

Class Method Details

.from_json(data) ⇒ WebhookSubscriptionPastDuePayload?

Parameters:

  • data (Hash, String, nil)

Returns:



46065
46066
46067
46068
46069
46070
46071
46072
46073
46074
46075
46076
46077
46078
# File 'lib/pago/v2026_04/models.rb', line 46065

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