Class: Stripe::PriceService::CreateParams::Recurring

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

#initialize(interval: nil, interval_count: nil, meter: nil, trial_period_days: nil, usage_type: nil) ⇒ Recurring

Returns a new instance of Recurring.



228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/stripe/services/price_service.rb', line 228

def initialize(
  interval: nil,
  interval_count: nil,
  meter: nil,
  trial_period_days: nil,
  usage_type: nil
)
  @interval = interval
  @interval_count = interval_count
  @meter = meter
  @trial_period_days = trial_period_days
  @usage_type = usage_type
end

Instance Attribute Details

#intervalObject

Specifies billing frequency. Either ‘day`, `week`, `month` or `year`.



218
219
220
# File 'lib/stripe/services/price_service.rb', line 218

def interval
  @interval
end

#interval_countObject

The number of intervals between subscription billings. For example, ‘interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks).



220
221
222
# File 'lib/stripe/services/price_service.rb', line 220

def interval_count
  @interval_count
end

#meterObject

The meter tracking the usage of a metered price



222
223
224
# File 'lib/stripe/services/price_service.rb', line 222

def meter
  @meter
end

#trial_period_daysObject

Default number of trial days when subscribing a customer to this price using [‘trial_from_plan=true`](stripe.com/docs/api#create_subscription-trial_from_plan).



224
225
226
# File 'lib/stripe/services/price_service.rb', line 224

def trial_period_days
  @trial_period_days
end

#usage_typeObject

Configures how the quantity per period should be determined. Can be either ‘metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`.



226
227
228
# File 'lib/stripe/services/price_service.rb', line 226

def usage_type
  @usage_type
end