Class: Stripe::Price::CreateParams::Recurring

Inherits:
RequestParams show all
Defined in:
lib/stripe/resources/price.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

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

Returns a new instance of Recurring.



397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
# File 'lib/stripe/resources/price.rb', line 397

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

Instance Attribute Details

#aggregate_usageObject

Specifies a usage aggregation strategy for prices of ‘usage_type=metered`. Defaults to `sum`.



380
381
382
# File 'lib/stripe/resources/price.rb', line 380

def aggregate_usage
  @aggregate_usage
end

#intervalObject

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



383
384
385
# File 'lib/stripe/resources/price.rb', line 383

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).



386
387
388
# File 'lib/stripe/resources/price.rb', line 386

def interval_count
  @interval_count
end

#meterObject

The meter tracking the usage of a metered price



389
390
391
# File 'lib/stripe/resources/price.rb', line 389

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).



392
393
394
# File 'lib/stripe/resources/price.rb', line 392

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`.



395
396
397
# File 'lib/stripe/resources/price.rb', line 395

def usage_type
  @usage_type
end