Class: Stripe::InvoiceCreatePreviewParams::InvoiceItem::PriceData

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/params/invoice_create_preview_params.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

attr_accessor, coerce_params, coerce_value, new, #to_h

Constructor Details

#initialize(currency: nil, product: nil, tax_behavior: nil, unit_amount: nil, unit_amount_decimal: nil) ⇒ PriceData

Returns a new instance of PriceData.



309
310
311
312
313
314
315
316
317
318
319
320
321
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 309

def initialize(
  currency: nil,
  product: nil,
  tax_behavior: nil,
  unit_amount: nil,
  unit_amount_decimal: nil
)
  @currency = currency
  @product = product
  @tax_behavior = tax_behavior
  @unit_amount = unit_amount
  @unit_amount_decimal = unit_amount_decimal
end

Instance Attribute Details

#currencyObject

Three-letter ISO currency code, in lowercase. Must be a supported currency.



299
300
301
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 299

def currency
  @currency
end

#productObject

The ID of the Product that this Price will belong to.



301
302
303
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 301

def product
  @product
end

#tax_behaviorObject

Only required if a default tax behavior was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of inclusive, exclusive, or unspecified. Once specified as either inclusive or exclusive, it cannot be changed.



303
304
305
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 303

def tax_behavior
  @tax_behavior
end

#unit_amountObject

A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.



305
306
307
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 305

def unit_amount
  @unit_amount
end

#unit_amount_decimalObject

Same as unit_amount, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of unit_amount and unit_amount_decimal can be set.



307
308
309
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 307

def unit_amount_decimal
  @unit_amount_decimal
end

Class Method Details

.field_encodingsObject



323
324
325
# File 'lib/stripe/params/invoice_create_preview_params.rb', line 323

def self.field_encodings
  @field_encodings = { unit_amount_decimal: :decimal_string }
end