Class: Stripe::CreditNote::PreviewParams::Line
- Inherits:
-
RequestParams
- Object
- RequestParams
- Stripe::CreditNote::PreviewParams::Line
- Defined in:
- lib/stripe/resources/credit_note.rb
Defined Under Namespace
Classes: TaxAmount
Instance Attribute Summary collapse
-
#amount ⇒ Object
The line item amount to credit.
-
#description ⇒ Object
The description of the credit note line item.
-
#invoice_line_item ⇒ Object
The invoice line item to credit.
-
#quantity ⇒ Object
The line item quantity to credit.
-
#tax_amounts ⇒ Object
A list of up to 10 tax amounts for the credit note line item.
-
#tax_rates ⇒ Object
The tax rates which apply to the credit note line item.
-
#type ⇒ Object
Type of the credit note line item, one of ‘invoice_line_item` or `custom_line_item`.
-
#unit_amount ⇒ Object
The integer unit amount in cents (or local equivalent) of the credit note line item.
-
#unit_amount_decimal ⇒ Object
Same as ‘unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places.
Instance Method Summary collapse
-
#initialize(amount: nil, description: nil, invoice_line_item: nil, quantity: nil, tax_amounts: nil, tax_rates: nil, type: nil, unit_amount: nil, unit_amount_decimal: nil) ⇒ Line
constructor
A new instance of Line.
Methods inherited from RequestParams
Constructor Details
#initialize(amount: nil, description: nil, invoice_line_item: nil, quantity: nil, tax_amounts: nil, tax_rates: nil, type: nil, unit_amount: nil, unit_amount_decimal: nil) ⇒ Line
Returns a new instance of Line.
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 |
# File 'lib/stripe/resources/credit_note.rb', line 329 def initialize( amount: nil, description: nil, invoice_line_item: nil, quantity: nil, tax_amounts: nil, tax_rates: nil, type: nil, unit_amount: nil, unit_amount_decimal: nil ) @amount = amount @description = description @invoice_line_item = invoice_line_item @quantity = quantity @tax_amounts = tax_amounts @tax_rates = tax_rates @type = type @unit_amount = unit_amount @unit_amount_decimal = unit_amount_decimal end |
Instance Attribute Details
#amount ⇒ Object
The line item amount to credit. Only valid when ‘type` is `invoice_line_item`. If invoice is set up with `automatic_tax=true`, this amount is tax exclusive
311 312 313 |
# File 'lib/stripe/resources/credit_note.rb', line 311 def amount @amount end |
#description ⇒ Object
The description of the credit note line item. Only valid when the ‘type` is `custom_line_item`.
313 314 315 |
# File 'lib/stripe/resources/credit_note.rb', line 313 def description @description end |
#invoice_line_item ⇒ Object
The invoice line item to credit. Only valid when the ‘type` is `invoice_line_item`.
315 316 317 |
# File 'lib/stripe/resources/credit_note.rb', line 315 def invoice_line_item @invoice_line_item end |
#quantity ⇒ Object
The line item quantity to credit.
317 318 319 |
# File 'lib/stripe/resources/credit_note.rb', line 317 def quantity @quantity end |
#tax_amounts ⇒ Object
A list of up to 10 tax amounts for the credit note line item. Cannot be mixed with ‘tax_rates`.
319 320 321 |
# File 'lib/stripe/resources/credit_note.rb', line 319 def tax_amounts @tax_amounts end |
#tax_rates ⇒ Object
The tax rates which apply to the credit note line item. Only valid when the ‘type` is `custom_line_item` and cannot be mixed with `tax_amounts`.
321 322 323 |
# File 'lib/stripe/resources/credit_note.rb', line 321 def tax_rates @tax_rates end |
#type ⇒ Object
Type of the credit note line item, one of ‘invoice_line_item` or `custom_line_item`
323 324 325 |
# File 'lib/stripe/resources/credit_note.rb', line 323 def type @type end |
#unit_amount ⇒ Object
The integer unit amount in cents (or local equivalent) of the credit note line item. This ‘unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`.
325 326 327 |
# File 'lib/stripe/resources/credit_note.rb', line 325 def unit_amount @unit_amount end |
#unit_amount_decimal ⇒ Object
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.
327 328 329 |
# File 'lib/stripe/resources/credit_note.rb', line 327 def unit_amount_decimal @unit_amount_decimal end |