Class: Stripe::Invoice::CreatePreviewParams

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

Defined Under Namespace

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

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, expand: nil, invoice_items: nil, issuer: nil, on_behalf_of: nil, preview_mode: nil, schedule: nil, schedule_details: nil, subscription: nil, subscription_details: nil) ⇒ CreatePreviewParams

Returns a new instance of CreatePreviewParams.



7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
# File 'lib/stripe/resources/invoice.rb', line 7827

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_details: nil
)
  @automatic_tax = automatic_tax
  @coupon = coupon
  @currency = currency
  @customer = customer
  @customer_details = customer_details
  @discounts = discounts
  @expand = 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_details = subscription_details
end

Instance Attribute Details

#automatic_taxObject

Settings for automatic tax lookup for this invoice preview.



7797
7798
7799
# File 'lib/stripe/resources/invoice.rb', line 7797

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.



7799
7800
7801
# File 'lib/stripe/resources/invoice.rb', line 7799

def coupon
  @coupon
end

#currencyObject

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



7801
7802
7803
# File 'lib/stripe/resources/invoice.rb', line 7801

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.



7803
7804
7805
# File 'lib/stripe/resources/invoice.rb', line 7803

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.



7805
7806
7807
# File 'lib/stripe/resources/invoice.rb', line 7805

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.



7807
7808
7809
# File 'lib/stripe/resources/invoice.rb', line 7807

def discounts
  @discounts
end

#expandObject

Specifies which fields in the response should be expanded.



7809
7810
7811
# File 'lib/stripe/resources/invoice.rb', line 7809

def expand
  @expand
end

#invoice_itemsObject

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



7811
7812
7813
# File 'lib/stripe/resources/invoice.rb', line 7811

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.



7813
7814
7815
# File 'lib/stripe/resources/invoice.rb', line 7813

def issuer
  @issuer
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.



7815
7816
7817
# File 'lib/stripe/resources/invoice.rb', line 7815

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.



7817
7818
7819
# File 'lib/stripe/resources/invoice.rb', line 7817

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.



7819
7820
7821
# File 'lib/stripe/resources/invoice.rb', line 7819

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.



7821
7822
7823
# File 'lib/stripe/resources/invoice.rb', line 7821

def schedule_details
  @schedule_details
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.



7823
7824
7825
# File 'lib/stripe/resources/invoice.rb', line 7823

def subscription
  @subscription
end

#subscription_detailsObject

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



7825
7826
7827
# File 'lib/stripe/resources/invoice.rb', line 7825

def subscription_details
  @subscription_details
end