Class: Stripe::InvoiceService::UpcomingParams
- Inherits:
-
RequestParams
- Object
- RequestParams
- Stripe::InvoiceService::UpcomingParams
- Defined in:
- lib/stripe/services/invoice_service.rb
Defined Under Namespace
Classes: AutomaticTax, CustomerDetails, Discount, InvoiceItem, Issuer, ScheduleDetails, SubscriptionDetails, SubscriptionItem, SubscriptionPrebilling
Instance Attribute Summary collapse
-
#automatic_tax ⇒ Object
Settings for automatic tax lookup for this invoice preview.
-
#coupon ⇒ Object
The ID of the coupon to apply to this phase of the subscription schedule.
-
#currency ⇒ Object
The currency to preview this invoice in.
-
#customer ⇒ Object
The identifier of the customer whose upcoming invoice you’d like to retrieve.
-
#customer_details ⇒ Object
Details about the customer you want to invoice or overrides for an existing customer.
-
#discounts ⇒ Object
The coupons to redeem into discounts for the invoice preview.
-
#expand ⇒ Object
Specifies which fields in the response should be expanded.
-
#invoice_items ⇒ Object
List of invoice items to add or update in the upcoming invoice preview (up to 250).
-
#issuer ⇒ Object
The connected account that issues the invoice.
-
#on_behalf_of ⇒ Object
The account (if any) for which the funds of the invoice payment are intended.
-
#preview_mode ⇒ Object
Customizes the types of values to include when calculating the invoice.
-
#schedule ⇒ Object
The identifier of the schedule whose upcoming invoice you’d like to retrieve.
-
#schedule_details ⇒ Object
The schedule creation or modification params to apply as a preview.
-
#subscription ⇒ Object
The identifier of the subscription for which you’d like to retrieve the upcoming invoice.
-
#subscription_billing_cycle_anchor ⇒ Object
For new subscriptions, a future timestamp to anchor the subscription’s [billing cycle](stripe.com/docs/subscriptions/billing-cycle).
-
#subscription_cancel_at ⇒ Object
A timestamp at which the subscription should cancel.
-
#subscription_cancel_at_period_end ⇒ Object
Indicate whether this subscription should cancel at the end of the current period (‘current_period_end`).
-
#subscription_cancel_now ⇒ Object
This simulates the subscription being canceled or expired immediately.
-
#subscription_default_tax_rates ⇒ Object
If provided, the invoice returned will preview updating or creating a subscription with these default tax rates.
-
#subscription_details ⇒ Object
The subscription creation or modification params to apply as a preview.
-
#subscription_items ⇒ Object
A list of up to 20 subscription items, each with an attached price.
-
#subscription_prebilling ⇒ Object
The pre-billing to apply to the subscription as a preview.
-
#subscription_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.
-
#subscription_proration_date ⇒ Object
If previewing an update to a subscription, and doing proration, ‘subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time.
-
#subscription_resume_at ⇒ Object
For paused subscriptions, setting ‘subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed.
-
#subscription_start_date ⇒ Object
Date a subscription is intended to start (can be future or past).
-
#subscription_trial_end ⇒ Object
If provided, the invoice returned will preview updating or creating a subscription with that trial end.
-
#subscription_trial_from_plan ⇒ Object
Indicates if a plan’s ‘trial_period_days` should be applied to the subscription.
Instance Method Summary collapse
Methods inherited from RequestParams
Constructor Details
#initialize(automatic_tax: nil, coupon: nil, currency: nil, customer: nil, customer_details: nil, discounts: nil, expand: nil, invoice_items: nil, issuer: nil, on_behalf_of: nil, preview_mode: nil, schedule: nil, schedule_details: nil, subscription: nil, subscription_billing_cycle_anchor: nil, subscription_cancel_at: nil, subscription_cancel_at_period_end: nil, subscription_cancel_now: nil, subscription_default_tax_rates: nil, subscription_details: nil, subscription_items: nil, subscription_prebilling: nil, subscription_proration_behavior: nil, subscription_proration_date: nil, subscription_resume_at: nil, subscription_start_date: nil, subscription_trial_end: nil, subscription_trial_from_plan: nil) ⇒ UpcomingParams
Returns a new instance of UpcomingParams.
3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 |
# File 'lib/stripe/services/invoice_service.rb', line 3659 def initialize( automatic_tax: nil, coupon: nil, currency: nil, customer: nil, customer_details: nil, discounts: nil, expand: nil, invoice_items: nil, issuer: nil, on_behalf_of: nil, preview_mode: nil, schedule: nil, schedule_details: nil, subscription: nil, subscription_billing_cycle_anchor: nil, subscription_cancel_at: nil, subscription_cancel_at_period_end: nil, subscription_cancel_now: nil, subscription_default_tax_rates: nil, subscription_details: nil, subscription_items: nil, subscription_prebilling: nil, subscription_proration_behavior: nil, subscription_proration_date: nil, subscription_resume_at: nil, subscription_start_date: nil, subscription_trial_end: nil, subscription_trial_from_plan: nil ) @automatic_tax = automatic_tax @coupon = coupon @currency = currency @customer = customer @customer_details = customer_details @discounts = discounts @expand = @invoice_items = invoice_items @issuer = issuer @on_behalf_of = on_behalf_of @preview_mode = preview_mode @schedule = schedule @schedule_details = schedule_details @subscription = subscription @subscription_billing_cycle_anchor = subscription_billing_cycle_anchor @subscription_cancel_at = subscription_cancel_at @subscription_cancel_at_period_end = subscription_cancel_at_period_end @subscription_cancel_now = subscription_cancel_now @subscription_default_tax_rates = subscription_default_tax_rates @subscription_details = subscription_details @subscription_items = subscription_items @subscription_prebilling = subscription_prebilling @subscription_proration_behavior = subscription_proration_behavior @subscription_proration_date = subscription_proration_date @subscription_resume_at = subscription_resume_at @subscription_start_date = subscription_start_date @subscription_trial_end = subscription_trial_end @subscription_trial_from_plan = subscription_trial_from_plan end |
Instance Attribute Details
#automatic_tax ⇒ Object
Settings for automatic tax lookup for this invoice preview.
3576 3577 3578 |
# File 'lib/stripe/services/invoice_service.rb', line 3576 def automatic_tax @automatic_tax end |
#coupon ⇒ Object
The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use ‘discounts` instead.
3579 3580 3581 |
# File 'lib/stripe/services/invoice_service.rb', line 3579 def coupon @coupon end |
#currency ⇒ Object
The currency to preview this invoice in. Defaults to that of ‘customer` if not specified.
3582 3583 3584 |
# File 'lib/stripe/services/invoice_service.rb', line 3582 def currency @currency end |
#customer ⇒ Object
The identifier of the customer whose upcoming invoice you’d like to retrieve. If ‘automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set.
3585 3586 3587 |
# File 'lib/stripe/services/invoice_service.rb', line 3585 def customer @customer end |
#customer_details ⇒ Object
Details about the customer you want to invoice or overrides for an existing customer. If ‘automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set.
3588 3589 3590 |
# File 'lib/stripe/services/invoice_service.rb', line 3588 def customer_details @customer_details end |
#discounts ⇒ Object
The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts.
3591 3592 3593 |
# File 'lib/stripe/services/invoice_service.rb', line 3591 def discounts @discounts end |
#expand ⇒ Object
Specifies which fields in the response should be expanded.
3594 3595 3596 |
# File 'lib/stripe/services/invoice_service.rb', line 3594 def @expand end |
#invoice_items ⇒ Object
List of invoice items to add or update in the upcoming invoice preview (up to 250).
3597 3598 3599 |
# File 'lib/stripe/services/invoice_service.rb', line 3597 def invoice_items @invoice_items end |
#issuer ⇒ Object
The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.
3600 3601 3602 |
# File 'lib/stripe/services/invoice_service.rb', line 3600 def issuer @issuer end |
#on_behalf_of ⇒ Object
The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](stripe.com/docs/billing/invoices/connect) documentation for details.
3603 3604 3605 |
# File 'lib/stripe/services/invoice_service.rb', line 3603 def on_behalf_of @on_behalf_of end |
#preview_mode ⇒ Object
Customizes the types of values to include when calculating the invoice. Defaults to ‘next` if unspecified.
3606 3607 3608 |
# File 'lib/stripe/services/invoice_service.rb', line 3606 def preview_mode @preview_mode end |
#schedule ⇒ Object
The identifier of the schedule whose upcoming invoice you’d like to retrieve. Cannot be used with subscription or subscription fields.
3609 3610 3611 |
# File 'lib/stripe/services/invoice_service.rb', line 3609 def schedule @schedule end |
#schedule_details ⇒ Object
The schedule creation or modification params to apply as a preview. Cannot be used with ‘subscription` or `subscription_` prefixed fields.
3612 3613 3614 |
# File 'lib/stripe/services/invoice_service.rb', line 3612 def schedule_details @schedule_details end |
#subscription ⇒ Object
The identifier of the subscription for which you’d like to retrieve the upcoming invoice. If not provided, but a ‘subscription_details.items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_details.items` is provided, you will retrieve the next upcoming invoice from among the customer’s subscriptions.
3615 3616 3617 |
# File 'lib/stripe/services/invoice_service.rb', line 3615 def subscription @subscription end |
#subscription_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`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.billing_cycle_anchor` instead.
3618 3619 3620 |
# File 'lib/stripe/services/invoice_service.rb', line 3618 def subscription_billing_cycle_anchor @subscription_billing_cycle_anchor end |
#subscription_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. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at` instead.
3621 3622 3623 |
# File 'lib/stripe/services/invoice_service.rb', line 3621 def subscription_cancel_at @subscription_cancel_at end |
#subscription_cancel_at_period_end ⇒ Object
Indicate whether this subscription should cancel at the end of the current period (‘current_period_end`). Defaults to `false`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead.
3624 3625 3626 |
# File 'lib/stripe/services/invoice_service.rb', line 3624 def subscription_cancel_at_period_end @subscription_cancel_at_period_end end |
#subscription_cancel_now ⇒ Object
This simulates the subscription being canceled or expired immediately. This field has been deprecated and will be removed in a future API version. Use ‘subscription_details.cancel_now` instead.
3627 3628 3629 |
# File 'lib/stripe/services/invoice_service.rb', line 3627 def subscription_cancel_now @subscription_cancel_now end |
#subscription_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. This field has been deprecated and will be removed in a future API version. Use `subscription_details.default_tax_rates` instead.
3630 3631 3632 |
# File 'lib/stripe/services/invoice_service.rb', line 3630 def subscription_default_tax_rates @subscription_default_tax_rates end |
#subscription_details ⇒ Object
The subscription creation or modification params to apply as a preview. Cannot be used with ‘schedule` or `schedule_details` fields.
3633 3634 3635 |
# File 'lib/stripe/services/invoice_service.rb', line 3633 def subscription_details @subscription_details end |
#subscription_items ⇒ Object
A list of up to 20 subscription items, each with an attached price. This field has been deprecated and will be removed in a future API version. Use ‘subscription_details.items` instead.
3636 3637 3638 |
# File 'lib/stripe/services/invoice_service.rb', line 3636 def subscription_items @subscription_items end |
#subscription_prebilling ⇒ Object
The pre-billing to apply to the subscription as a preview. This field has been deprecated and will be removed in a future API version. Use ‘subscription_details.prebilling` instead.
3639 3640 3641 |
# File 'lib/stripe/services/invoice_service.rb', line 3639 def subscription_prebilling @subscription_prebilling end |
#subscription_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`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_behavior` instead.
3642 3643 3644 |
# File 'lib/stripe/services/invoice_service.rb', line 3642 def subscription_proration_behavior @subscription_proration_behavior end |
#subscription_proration_date ⇒ Object
If previewing an update to a subscription, and doing proration, ‘subscription_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_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to ’none’. This field has been deprecated and will be removed in a future API version. Use ‘subscription_details.proration_date` instead.
3645 3646 3647 |
# File 'lib/stripe/services/invoice_service.rb', line 3645 def subscription_proration_date @subscription_proration_date end |
#subscription_resume_at ⇒ Object
For paused subscriptions, setting ‘subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. This field has been deprecated and will be removed in a future API version. Use `subscription_details.resume_at` instead.
3648 3649 3650 |
# File 'lib/stripe/services/invoice_service.rb', line 3648 def subscription_resume_at @subscription_resume_at end |
#subscription_start_date ⇒ Object
Date a subscription is intended to start (can be future or past). This field has been deprecated and will be removed in a future API version. Use ‘subscription_details.start_date` instead.
3651 3652 3653 |
# File 'lib/stripe/services/invoice_service.rb', line 3651 def subscription_start_date @subscription_start_date end |
#subscription_trial_end ⇒ Object
If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of ‘subscription_items` or `subscription` is required. This field has been deprecated and will be removed in a future API version. Use `subscription_details.trial_end` instead.
3654 3655 3656 |
# File 'lib/stripe/services/invoice_service.rb', line 3654 def subscription_trial_end @subscription_trial_end end |
#subscription_trial_from_plan ⇒ Object
Indicates if a plan’s ‘trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](stripe.com/docs/billing/subscriptions/trials) to learn more.
3657 3658 3659 |
# File 'lib/stripe/services/invoice_service.rb', line 3657 def subscription_trial_from_plan @subscription_trial_from_plan end |