Class: Pago::V2026_04::Models::SubscriptionRevoke

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

Constant Summary collapse

JSON_KEYS =

Returns:

  • (Hash[Symbol, String])
{
  customer_cancellation_reason: "customer_cancellation_reason",
  customer_cancellation_comment: "customer_cancellation_comment",
  revoke: "revoke"
}.freeze
REQUIRED_KEYS =

Returns:

  • (Array[String])
["revoke"].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(customer_cancellation_reason: ::Pago::UNSET, customer_cancellation_comment: ::Pago::UNSET, revoke:) ⇒ SubscriptionRevoke

Returns a new instance of SubscriptionRevoke.

Parameters:

  • customer_cancellation_reason: (String, nil) (defaults to: ::Pago::UNSET)
  • customer_cancellation_comment: (String, nil) (defaults to: ::Pago::UNSET)
  • revoke: (Boolean)


42022
42023
42024
42025
42026
42027
42028
42029
42030
42031
# File 'lib/pago/v2026_04/models.rb', line 42022

def initialize(
  customer_cancellation_reason: ::Pago::UNSET,
  customer_cancellation_comment: ::Pago::UNSET,
  revoke:
)
  super()
  assign(:customer_cancellation_reason, customer_cancellation_reason)
  assign(:customer_cancellation_comment, customer_cancellation_comment)
  assign(:revoke, revoke)
end

Instance Attribute Details

#customer_cancellation_commentString? (readonly)

Customer feedback and why they decided to cancel.

IMPORTANT: Do not use this to store internal notes! It's intended to be input from the customer and is therefore also available in their Pago purchases library.

Only set this in case your own service is requesting the reason from the customer. Or you copy a message directly from a customer conversation, i.e support.

Returns:

  • (String, nil)


42016
42017
42018
# File 'lib/pago/v2026_04/models.rb', line 42016

def customer_cancellation_comment
  @customer_cancellation_comment
end

#customer_cancellation_reasonString? (readonly)

Customer reason for cancellation.

Helpful to monitor reasons behind churn for future improvements.

Only set this in case your own service is requesting the reason from the customer. Or you know based on direct conversations, i.e support, with the customer.

  • too_expensive: Too expensive for the customer.
  • missing_features: Customer is missing certain features.
  • switched_service: Customer switched to another service.
  • unused: Customer is not using it enough.
  • customer_service: Customer is not satisfied with the customer service.
  • low_quality: Customer is unhappy with the quality.
  • too_complex: Customer considers the service too complicated.
  • other: Other reason(s).

Returns:

  • (String, nil)


42003
42004
42005
# File 'lib/pago/v2026_04/models.rb', line 42003

def customer_cancellation_reason
  @customer_cancellation_reason
end

#revokeBoolean (readonly)

Cancel and revoke an active subscription immediately

Returns:

  • (Boolean)


42020
42021
42022
# File 'lib/pago/v2026_04/models.rb', line 42020

def revoke
  @revoke
end

Class Method Details

.from_json(data) ⇒ SubscriptionRevoke?

Parameters:

  • data (Hash, String, nil)

Returns:



42035
42036
42037
42038
42039
42040
42041
42042
42043
42044
42045
42046
42047
42048
# File 'lib/pago/v2026_04/models.rb', line 42035

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(
      customer_cancellation_reason: (data.key?("customer_cancellation_reason") ? data["customer_cancellation_reason"] : ::Pago::UNSET),
      customer_cancellation_comment: (data.key?("customer_cancellation_comment") ? data["customer_cancellation_comment"] : ::Pago::UNSET),
      revoke: (data.key?("revoke") ? data["revoke"] : ::Pago::UNSET)
    ),
    data
  )
end