Class: Stripe::PlanCreateParams
- Inherits:
-
RequestParams
- Object
- RequestParams
- Stripe::PlanCreateParams
- Defined in:
- lib/stripe/params/plan_create_params.rb
Defined Under Namespace
Classes: Product, Tier, TransformUsage
Instance Attribute Summary collapse
-
#active ⇒ Object
Whether the plan is currently available for new subscriptions.
-
#amount ⇒ Object
A positive integer in cents (or local equivalent) (or 0 for a free plan) representing how much to charge on a recurring basis.
-
#amount_decimal ⇒ Object
Same as ‘amount`, but accepts a decimal value with at most 12 decimal places.
-
#billing_scheme ⇒ Object
Describes how to compute the price per period.
-
#currency ⇒ Object
Three-letter [ISO currency code](www.iso.org/iso-4217-currency-codes.html), in lowercase.
-
#expand ⇒ Object
Specifies which fields in the response should be expanded.
-
#id ⇒ Object
An identifier randomly generated by Stripe.
-
#interval ⇒ Object
Specifies billing frequency.
-
#interval_count ⇒ Object
The number of intervals between subscription billings.
-
#metadata ⇒ Object
Set of [key-value pairs](docs.stripe.com/api/metadata) that you can attach to an object.
-
#meter ⇒ Object
The meter tracking the usage of a metered price.
-
#nickname ⇒ Object
A brief description of the plan, hidden from customers.
-
#product ⇒ Object
Attribute for param field product.
-
#tiers ⇒ Object
Each element represents a pricing tier.
-
#tiers_mode ⇒ Object
Defines if the tiering price should be ‘graduated` or `volume` based.
-
#transform_usage ⇒ Object
Apply a transformation to the reported usage or set quantity before computing the billed price.
-
#trial_period_days ⇒ Object
Default number of trial days when subscribing a customer to this plan using [‘trial_from_plan=true`](docs.stripe.com/api#create_subscription-trial_from_plan).
-
#usage_type ⇒ Object
Configures how the quantity per period should be determined.
Instance Method Summary collapse
-
#initialize(active: nil, amount: nil, amount_decimal: nil, billing_scheme: nil, currency: nil, expand: nil, id: nil, interval: nil, interval_count: nil, metadata: nil, meter: nil, nickname: nil, product: nil, tiers: nil, tiers_mode: nil, transform_usage: nil, trial_period_days: nil, usage_type: nil) ⇒ PlanCreateParams
constructor
A new instance of PlanCreateParams.
Methods inherited from RequestParams
Constructor Details
#initialize(active: nil, amount: nil, amount_decimal: nil, billing_scheme: nil, currency: nil, expand: nil, id: nil, interval: nil, interval_count: nil, metadata: nil, meter: nil, nickname: nil, product: nil, tiers: nil, tiers_mode: nil, transform_usage: nil, trial_period_days: nil, usage_type: nil) ⇒ PlanCreateParams
Returns a new instance of PlanCreateParams.
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 |
# File 'lib/stripe/params/plan_create_params.rb', line 133 def initialize( active: nil, amount: nil, amount_decimal: nil, billing_scheme: nil, currency: nil, expand: nil, id: nil, interval: nil, interval_count: nil, metadata: nil, meter: nil, nickname: nil, product: nil, tiers: nil, tiers_mode: nil, transform_usage: nil, trial_period_days: nil, usage_type: nil ) @active = active @amount = amount @amount_decimal = amount_decimal @billing_scheme = billing_scheme @currency = currency @expand = @id = id @interval = interval @interval_count = interval_count @metadata = @meter = meter @nickname = nickname @product = product @tiers = tiers @tiers_mode = tiers_mode @transform_usage = transform_usage @trial_period_days = trial_period_days @usage_type = usage_type end |
Instance Attribute Details
#active ⇒ Object
Whether the plan is currently available for new subscriptions. Defaults to ‘true`.
97 98 99 |
# File 'lib/stripe/params/plan_create_params.rb', line 97 def active @active end |
#amount ⇒ Object
A positive integer in cents (or local equivalent) (or 0 for a free plan) representing how much to charge on a recurring basis.
99 100 101 |
# File 'lib/stripe/params/plan_create_params.rb', line 99 def amount @amount end |
#amount_decimal ⇒ Object
Same as ‘amount`, but accepts a decimal value with at most 12 decimal places. Only one of `amount` and `amount_decimal` can be set.
101 102 103 |
# File 'lib/stripe/params/plan_create_params.rb', line 101 def amount_decimal @amount_decimal end |
#billing_scheme ⇒ Object
Describes how to compute the price per period. Either ‘per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `amount`) will be charged per unit in `quantity` (for plans with `usage_type=licensed`), or per unit of total usage (for plans with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes.
103 104 105 |
# File 'lib/stripe/params/plan_create_params.rb', line 103 def billing_scheme @billing_scheme end |
#currency ⇒ Object
Three-letter [ISO currency code](www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](stripe.com/docs/currencies).
105 106 107 |
# File 'lib/stripe/params/plan_create_params.rb', line 105 def currency @currency end |
#expand ⇒ Object
Specifies which fields in the response should be expanded.
107 108 109 |
# File 'lib/stripe/params/plan_create_params.rb', line 107 def @expand end |
#id ⇒ Object
An identifier randomly generated by Stripe. Used to identify this plan when subscribing a customer. You can optionally override this ID, but the ID must be unique across all plans in your Stripe account. You can, however, use the same plan ID in both live and test modes.
109 110 111 |
# File 'lib/stripe/params/plan_create_params.rb', line 109 def id @id end |
#interval ⇒ Object
Specifies billing frequency. Either ‘day`, `week`, `month` or `year`.
111 112 113 |
# File 'lib/stripe/params/plan_create_params.rb', line 111 def interval @interval end |
#interval_count ⇒ Object
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).
113 114 115 |
# File 'lib/stripe/params/plan_create_params.rb', line 113 def interval_count @interval_count end |
#metadata ⇒ Object
Set of [key-value pairs](docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to ‘metadata`.
115 116 117 |
# File 'lib/stripe/params/plan_create_params.rb', line 115 def @metadata end |
#meter ⇒ Object
The meter tracking the usage of a metered price
117 118 119 |
# File 'lib/stripe/params/plan_create_params.rb', line 117 def meter @meter end |
#nickname ⇒ Object
A brief description of the plan, hidden from customers.
119 120 121 |
# File 'lib/stripe/params/plan_create_params.rb', line 119 def nickname @nickname end |
#product ⇒ Object
Attribute for param field product
121 122 123 |
# File 'lib/stripe/params/plan_create_params.rb', line 121 def product @product end |
#tiers ⇒ Object
Each element represents a pricing tier. This parameter requires ‘billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`.
123 124 125 |
# File 'lib/stripe/params/plan_create_params.rb', line 123 def tiers @tiers end |
#tiers_mode ⇒ Object
Defines if the tiering price should be ‘graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows.
125 126 127 |
# File 'lib/stripe/params/plan_create_params.rb', line 125 def tiers_mode @tiers_mode end |
#transform_usage ⇒ Object
Apply a transformation to the reported usage or set quantity before computing the billed price. Cannot be combined with ‘tiers`.
127 128 129 |
# File 'lib/stripe/params/plan_create_params.rb', line 127 def transform_usage @transform_usage end |
#trial_period_days ⇒ Object
Default number of trial days when subscribing a customer to this plan using [‘trial_from_plan=true`](docs.stripe.com/api#create_subscription-trial_from_plan).
129 130 131 |
# File 'lib/stripe/params/plan_create_params.rb', line 129 def trial_period_days @trial_period_days end |
#usage_type ⇒ Object
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`.
131 132 133 |
# File 'lib/stripe/params/plan_create_params.rb', line 131 def usage_type @usage_type end |