Class: Pago::V2026_04::Models::SubscriptionCancel
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Constant Summary collapse
- JSON_KEYS =
{ customer_cancellation_reason: "customer_cancellation_reason", customer_cancellation_comment: "customer_cancellation_comment", cancel_at_period_end: "cancel_at_period_end" }.freeze
- REQUIRED_KEYS =
["cancel_at_period_end"].freeze
Instance Attribute Summary collapse
-
#cancel_at_period_end ⇒ Boolean
readonly
Cancel an active subscription once the current period ends.
-
#customer_cancellation_comment ⇒ String?
readonly
Customer feedback and why they decided to cancel.
-
#customer_cancellation_reason ⇒ String?
readonly
Customer reason for cancellation.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(customer_cancellation_reason: ::Pago::UNSET, customer_cancellation_comment: ::Pago::UNSET, cancel_at_period_end:) ⇒ SubscriptionCancel
constructor
A new instance of SubscriptionCancel.
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, cancel_at_period_end:) ⇒ SubscriptionCancel
Returns a new instance of SubscriptionCancel.
39792 39793 39794 39795 39796 39797 39798 39799 39800 39801 |
# File 'lib/pago/v2026_04/models.rb', line 39792 def initialize( customer_cancellation_reason: ::Pago::UNSET, customer_cancellation_comment: ::Pago::UNSET, cancel_at_period_end: ) super() assign(:customer_cancellation_reason, customer_cancellation_reason) assign(:customer_cancellation_comment, customer_cancellation_comment) assign(:cancel_at_period_end, cancel_at_period_end) end |
Instance Attribute Details
#cancel_at_period_end ⇒ Boolean (readonly)
Cancel an active subscription once the current period ends.
Or uncancel a subscription currently set to be revoked at period end.
39790 39791 39792 |
# File 'lib/pago/v2026_04/models.rb', line 39790 def cancel_at_period_end @cancel_at_period_end end |
#customer_cancellation_comment ⇒ String? (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.
39784 39785 39786 |
# File 'lib/pago/v2026_04/models.rb', line 39784 def customer_cancellation_comment @customer_cancellation_comment end |
#customer_cancellation_reason ⇒ String? (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).
39771 39772 39773 |
# File 'lib/pago/v2026_04/models.rb', line 39771 def customer_cancellation_reason @customer_cancellation_reason end |
Class Method Details
.from_json(data) ⇒ SubscriptionCancel?
39805 39806 39807 39808 39809 39810 39811 39812 39813 39814 39815 39816 39817 39818 |
# File 'lib/pago/v2026_04/models.rb', line 39805 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), cancel_at_period_end: (data.key?("cancel_at_period_end") ? data["cancel_at_period_end"] : ::Pago::UNSET) ), data ) end |