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, billing_cadence: nil, currency: nil, customer: nil, customer_account: 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.



4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
# File 'lib/stripe/resources/invoice.rb', line 4317

def initialize(
  automatic_tax: nil,
  billing_cadence: nil,
  currency: nil,
  customer: nil,
  customer_account: 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
  @billing_cadence = billing_cadence
  @currency = currency
  @customer = customer
  @customer_account = 
  @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.



4285
4286
4287
# File 'lib/stripe/resources/invoice.rb', line 4285

def automatic_tax
  @automatic_tax
end

#billing_cadenceObject

The identifier of the billing cadence for which you’d like to retrieve the upcoming invoice.Cannot be provided when ‘subscription`, `schedule`, `subscription_details` or `schedule_details` are provided.



4287
4288
4289
# File 'lib/stripe/resources/invoice.rb', line 4287

def billing_cadence
  @billing_cadence
end

#currencyObject

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



4289
4290
4291
# File 'lib/stripe/resources/invoice.rb', line 4289

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.



4291
4292
4293
# File 'lib/stripe/resources/invoice.rb', line 4291

def customer
  @customer
end

#customer_accountObject

The identifier of the account whose upcoming invoice you’d like to retrieve. If ‘automatic_tax` is enabled then one of `customer`, `customer_account`, `customer_details`, `subscription`, or `schedule` must be set.



4293
4294
4295
# File 'lib/stripe/resources/invoice.rb', line 4293

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



4295
4296
4297
# File 'lib/stripe/resources/invoice.rb', line 4295

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.



4297
4298
4299
# File 'lib/stripe/resources/invoice.rb', line 4297

def discounts
  @discounts
end

#expandObject

Specifies which fields in the response should be expanded.



4299
4300
4301
# File 'lib/stripe/resources/invoice.rb', line 4299

def expand
  @expand
end

#invoice_itemsObject

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



4301
4302
4303
# File 'lib/stripe/resources/invoice.rb', line 4301

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.



4303
4304
4305
# File 'lib/stripe/resources/invoice.rb', line 4303

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.



4305
4306
4307
# File 'lib/stripe/resources/invoice.rb', line 4305

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.



4307
4308
4309
# File 'lib/stripe/resources/invoice.rb', line 4307

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.



4309
4310
4311
# File 'lib/stripe/resources/invoice.rb', line 4309

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.



4311
4312
4313
# File 'lib/stripe/resources/invoice.rb', line 4311

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.



4313
4314
4315
# File 'lib/stripe/resources/invoice.rb', line 4313

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.



4315
4316
4317
# File 'lib/stripe/resources/invoice.rb', line 4315

def subscription_details
  @subscription_details
end