Class: Stripe::BillingPortal::ConfigurationService::CreateParams::Features::SubscriptionCancel

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/services/billing_portal/configuration_service.rb

Defined Under Namespace

Classes: CancellationReason

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

#initialize(cancellation_reason: nil, enabled: nil, mode: nil, proration_behavior: nil) ⇒ SubscriptionCancel

Returns a new instance of SubscriptionCancel.



118
119
120
121
122
123
124
125
126
127
128
# File 'lib/stripe/services/billing_portal/configuration_service.rb', line 118

def initialize(
  cancellation_reason: nil,
  enabled: nil,
  mode: nil,
  proration_behavior: nil
)
  @cancellation_reason = cancellation_reason
  @enabled = enabled
  @mode = mode
  @proration_behavior = proration_behavior
end

Instance Attribute Details

#cancellation_reasonObject

Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer



107
108
109
# File 'lib/stripe/services/billing_portal/configuration_service.rb', line 107

def cancellation_reason
  @cancellation_reason
end

#enabledObject

Whether the feature is enabled.



110
111
112
# File 'lib/stripe/services/billing_portal/configuration_service.rb', line 110

def enabled
  @enabled
end

#modeObject

Whether to cancel subscriptions immediately or at the end of the billing period.



113
114
115
# File 'lib/stripe/services/billing_portal/configuration_service.rb', line 113

def mode
  @mode
end

#proration_behaviorObject

Whether to create prorations when canceling subscriptions. Possible values are ‘none` and `create_prorations`, which is only compatible with `mode=immediately`. No prorations are generated when canceling a subscription at the end of its natural billing period.



116
117
118
# File 'lib/stripe/services/billing_portal/configuration_service.rb', line 116

def proration_behavior
  @proration_behavior
end