Class: Stripe::InvoiceUpcomingLinesService::ListParams

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

Defined Under Namespace

Classes: AutomaticTax, CustomerDetails, Discount, InvoiceItem, Issuer, ScheduleDetails, SubscriptionDetails, SubscriptionItem, SubscriptionPrebilling

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

Constructor Details

#initialize(automatic_tax: nil, coupon: nil, currency: nil, customer: nil, customer_details: nil, discounts: nil, ending_before: nil, expand: nil, invoice_items: nil, issuer: nil, limit: nil, on_behalf_of: nil, preview_mode: nil, schedule: nil, schedule_details: nil, starting_after: 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) ⇒ ListParams

Returns a new instance of ListParams.



2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2081

def initialize(
  automatic_tax: nil,
  coupon: nil,
  currency: nil,
  customer: nil,
  customer_details: nil,
  discounts: nil,
  ending_before: nil,
  expand: nil,
  invoice_items: nil,
  issuer: nil,
  limit: nil,
  on_behalf_of: nil,
  preview_mode: nil,
  schedule: nil,
  schedule_details: nil,
  starting_after: 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
  @ending_before = ending_before
  @expand = expand
  @invoice_items = invoice_items
  @issuer = issuer
  @limit = limit
  @on_behalf_of = on_behalf_of
  @preview_mode = preview_mode
  @schedule = schedule
  @schedule_details = schedule_details
  @starting_after = starting_after
  @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_taxObject

Settings for automatic tax lookup for this invoice preview.



1989
1990
1991
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 1989

def automatic_tax
  @automatic_tax
end

#couponObject

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.



1992
1993
1994
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 1992

def coupon
  @coupon
end

#currencyObject

The currency to preview this invoice in. Defaults to that of ‘customer` if not specified.



1995
1996
1997
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 1995

def currency
  @currency
end

#customerObject

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.



1998
1999
2000
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 1998

def customer
  @customer
end

#customer_detailsObject

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.



2001
2002
2003
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2001

def customer_details
  @customer_details
end

#discountsObject

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.



2004
2005
2006
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2004

def discounts
  @discounts
end

#ending_beforeObject

A cursor for use in pagination. ‘ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.



2007
2008
2009
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2007

def ending_before
  @ending_before
end

#expandObject

Specifies which fields in the response should be expanded.



2010
2011
2012
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2010

def expand
  @expand
end

#invoice_itemsObject

List of invoice items to add or update in the upcoming invoice preview (up to 250).



2013
2014
2015
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2013

def invoice_items
  @invoice_items
end

#issuerObject

The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account.



2016
2017
2018
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2016

def issuer
  @issuer
end

#limitObject

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.



2019
2020
2021
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2019

def limit
  @limit
end

#on_behalf_ofObject

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.



2022
2023
2024
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2022

def on_behalf_of
  @on_behalf_of
end

#preview_modeObject

Customizes the types of values to include when calculating the invoice. Defaults to ‘next` if unspecified.



2025
2026
2027
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2025

def preview_mode
  @preview_mode
end

#scheduleObject

The identifier of the schedule whose upcoming invoice you’d like to retrieve. Cannot be used with subscription or subscription fields.



2028
2029
2030
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2028

def schedule
  @schedule
end

#schedule_detailsObject

The schedule creation or modification params to apply as a preview. Cannot be used with ‘subscription` or `subscription_` prefixed fields.



2031
2032
2033
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2031

def schedule_details
  @schedule_details
end

#starting_afterObject

A cursor for use in pagination. ‘starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.



2034
2035
2036
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2034

def starting_after
  @starting_after
end

#subscriptionObject

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.



2037
2038
2039
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2037

def subscription
  @subscription
end

#subscription_billing_cycle_anchorObject

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.



2040
2041
2042
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2040

def subscription_billing_cycle_anchor
  @subscription_billing_cycle_anchor
end

#subscription_cancel_atObject

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.



2043
2044
2045
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2043

def subscription_cancel_at
  @subscription_cancel_at
end

#subscription_cancel_at_period_endObject

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.



2046
2047
2048
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2046

def subscription_cancel_at_period_end
  @subscription_cancel_at_period_end
end

#subscription_cancel_nowObject

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.



2049
2050
2051
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2049

def subscription_cancel_now
  @subscription_cancel_now
end

#subscription_default_tax_ratesObject

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.



2052
2053
2054
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2052

def subscription_default_tax_rates
  @subscription_default_tax_rates
end

#subscription_detailsObject

The subscription creation or modification params to apply as a preview. Cannot be used with ‘schedule` or `schedule_details` fields.



2055
2056
2057
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2055

def subscription_details
  @subscription_details
end

#subscription_itemsObject

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.



2058
2059
2060
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2058

def subscription_items
  @subscription_items
end

#subscription_prebillingObject

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.



2061
2062
2063
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2061

def subscription_prebilling
  @subscription_prebilling
end

#subscription_proration_behaviorObject

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.



2064
2065
2066
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2064

def subscription_proration_behavior
  @subscription_proration_behavior
end

#subscription_proration_dateObject

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.



2067
2068
2069
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2067

def subscription_proration_date
  @subscription_proration_date
end

#subscription_resume_atObject

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.



2070
2071
2072
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2070

def subscription_resume_at
  @subscription_resume_at
end

#subscription_start_dateObject

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.



2073
2074
2075
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2073

def subscription_start_date
  @subscription_start_date
end

#subscription_trial_endObject

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.



2076
2077
2078
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2076

def subscription_trial_end
  @subscription_trial_end
end

#subscription_trial_from_planObject

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.



2079
2080
2081
# File 'lib/stripe/services/invoice_upcoming_lines_service.rb', line 2079

def subscription_trial_from_plan
  @subscription_trial_from_plan
end