Class: Stripe::Invoice::ListUpcomingLineItemsParams::SubscriptionDetails
- Inherits:
-
RequestParams
- Object
- RequestParams
- Stripe::Invoice::ListUpcomingLineItemsParams::SubscriptionDetails
- Defined in:
- lib/stripe/resources/invoice.rb
Defined Under Namespace
Classes: Item, Prebilling
Instance Attribute Summary collapse
-
#billing_cycle_anchor ⇒ Object
For new subscriptions, a future timestamp to anchor the subscription’s [billing cycle](stripe.com/docs/subscriptions/billing-cycle).
-
#cancel_at ⇒ Object
A timestamp at which the subscription should cancel.
-
#cancel_at_period_end ⇒ Object
Indicate whether this subscription should cancel at the end of the current period (‘current_period_end`).
-
#cancel_now ⇒ Object
This simulates the subscription being canceled or expired immediately.
-
#default_tax_rates ⇒ Object
If provided, the invoice returned will preview updating or creating a subscription with these default tax rates.
-
#items ⇒ Object
A list of up to 20 subscription items, each with an attached price.
-
#prebilling ⇒ Object
The pre-billing to apply to the subscription as a preview.
-
#proration_behavior ⇒ Object
Determines how to handle [prorations](stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting ‘billing_cycle_anchor=now`, or starting a trial), or if an item’s ‘quantity` changes.
-
#proration_date ⇒ Object
If previewing an update to a subscription, and doing proration, ‘subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time.
-
#resume_at ⇒ Object
For paused subscriptions, setting ‘subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed.
-
#start_date ⇒ Object
Date a subscription is intended to start (can be future or past).
-
#trial_end ⇒ Object
If provided, the invoice returned will preview updating or creating a subscription with that trial end.
Instance Method Summary collapse
-
#initialize(billing_cycle_anchor: nil, cancel_at: nil, cancel_at_period_end: nil, cancel_now: nil, default_tax_rates: nil, items: nil, prebilling: nil, proration_behavior: nil, proration_date: nil, resume_at: nil, start_date: nil, trial_end: nil) ⇒ SubscriptionDetails
constructor
A new instance of SubscriptionDetails.
Methods inherited from RequestParams
Constructor Details
#initialize(billing_cycle_anchor: nil, cancel_at: nil, cancel_at_period_end: nil, cancel_now: nil, default_tax_rates: nil, items: nil, prebilling: nil, proration_behavior: nil, proration_date: nil, resume_at: nil, start_date: nil, trial_end: nil) ⇒ SubscriptionDetails
Returns a new instance of SubscriptionDetails.
6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 |
# File 'lib/stripe/resources/invoice.rb', line 6054 def initialize( billing_cycle_anchor: nil, cancel_at: nil, cancel_at_period_end: nil, cancel_now: nil, default_tax_rates: nil, items: nil, prebilling: nil, proration_behavior: nil, proration_date: nil, resume_at: nil, start_date: nil, trial_end: nil ) @billing_cycle_anchor = billing_cycle_anchor @cancel_at = cancel_at @cancel_at_period_end = cancel_at_period_end @cancel_now = cancel_now @default_tax_rates = default_tax_rates @items = items @prebilling = prebilling @proration_behavior = proration_behavior @proration_date = proration_date @resume_at = resume_at @start_date = start_date @trial_end = trial_end end |
Instance Attribute Details
#billing_cycle_anchor ⇒ Object
For new subscriptions, a future timestamp to anchor the subscription’s [billing cycle](stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with ‘month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`.
6019 6020 6021 |
# File 'lib/stripe/resources/invoice.rb', line 6019 def billing_cycle_anchor @billing_cycle_anchor end |
#cancel_at ⇒ Object
A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using ‘proration_behavior`. If set during a future period, this will always cause a proration for that period.
6022 6023 6024 |
# File 'lib/stripe/resources/invoice.rb', line 6022 def cancel_at @cancel_at end |
#cancel_at_period_end ⇒ Object
Indicate whether this subscription should cancel at the end of the current period (‘current_period_end`). Defaults to `false`.
6025 6026 6027 |
# File 'lib/stripe/resources/invoice.rb', line 6025 def cancel_at_period_end @cancel_at_period_end end |
#cancel_now ⇒ Object
This simulates the subscription being canceled or expired immediately.
6028 6029 6030 |
# File 'lib/stripe/resources/invoice.rb', line 6028 def cancel_now @cancel_now end |
#default_tax_rates ⇒ Object
If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have ‘tax_rates` set.
6031 6032 6033 |
# File 'lib/stripe/resources/invoice.rb', line 6031 def default_tax_rates @default_tax_rates end |
#items ⇒ Object
A list of up to 20 subscription items, each with an attached price.
6034 6035 6036 |
# File 'lib/stripe/resources/invoice.rb', line 6034 def items @items end |
#prebilling ⇒ Object
The pre-billing to apply to the subscription as a preview.
6037 6038 6039 |
# File 'lib/stripe/resources/invoice.rb', line 6037 def prebilling @prebilling end |
#proration_behavior ⇒ Object
Determines how to handle [prorations](stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting ‘billing_cycle_anchor=now`, or starting a trial), or if an item’s ‘quantity` changes. The default value is `create_prorations`.
6040 6041 6042 |
# File 'lib/stripe/resources/invoice.rb', line 6040 def proration_behavior @proration_behavior end |
#proration_date ⇒ Object
If previewing an update to a subscription, and doing proration, ‘subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to ’none’.
6043 6044 6045 |
# File 'lib/stripe/resources/invoice.rb', line 6043 def proration_date @proration_date end |
#resume_at ⇒ Object
For paused subscriptions, setting ‘subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed.
6046 6047 6048 |
# File 'lib/stripe/resources/invoice.rb', line 6046 def resume_at @resume_at end |
#start_date ⇒ Object
Date a subscription is intended to start (can be future or past).
6049 6050 6051 |
# File 'lib/stripe/resources/invoice.rb', line 6049 def start_date @start_date end |
#trial_end ⇒ Object
If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of ‘subscription_details.items` or `subscription` is required.
6052 6053 6054 |
# File 'lib/stripe/resources/invoice.rb', line 6052 def trial_end @trial_end end |