Class: Stripe::InvoiceCreatePreviewParams

Inherits:
RequestParams show all
Defined in:
lib/stripe/params/invoice_create_preview_params.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, 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) ⇒ InvoiceCreatePreviewParams

Returns a new instance of InvoiceCreatePreviewParams.



1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1772

def initialize(
  automatic_tax: 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
  @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.



1742
1743
1744
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1742

def automatic_tax
  @automatic_tax
end

#currencyObject

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



1744
1745
1746
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1744

def currency
  @currency
end

#customerObject

The identifier of the customer whose upcoming invoice you’re retrieving. If ‘automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set.



1746
1747
1748
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1746

def customer
  @customer
end

#customer_accountObject

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



1748
1749
1750
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1748

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.



1750
1751
1752
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1750

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.



1752
1753
1754
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1752

def discounts
  @discounts
end

#expandObject

Specifies which fields in the response should be expanded.



1754
1755
1756
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1754

def expand
  @expand
end

#invoice_itemsObject

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



1756
1757
1758
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1756

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.



1758
1759
1760
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1758

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](docs.stripe.com/billing/invoices/connect) documentation for details.



1760
1761
1762
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1760

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.



1762
1763
1764
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1762

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.



1764
1765
1766
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1764

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.



1766
1767
1768
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1766

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.



1768
1769
1770
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1768

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.



1770
1771
1772
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 1770

def subscription_details
  @subscription_details
end