Class: Stripe::CreditNotePreviewLinesService::ListParams::Line

Inherits:
RequestParams
  • Object
show all
Defined in:
lib/stripe/services/credit_note_preview_lines_service.rb

Defined Under Namespace

Classes: TaxAmount

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from RequestParams

#to_h

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.



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/stripe/services/credit_note_preview_lines_service.rb', line 41

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

#amountObject

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



23
24
25
# File 'lib/stripe/services/credit_note_preview_lines_service.rb', line 23

def amount
  @amount
end

#descriptionObject

The description of the credit note line item. Only valid when the ‘type` is `custom_line_item`.



25
26
27
# File 'lib/stripe/services/credit_note_preview_lines_service.rb', line 25

def description
  @description
end

#invoice_line_itemObject

The invoice line item to credit. Only valid when the ‘type` is `invoice_line_item`.



27
28
29
# File 'lib/stripe/services/credit_note_preview_lines_service.rb', line 27

def invoice_line_item
  @invoice_line_item
end

#quantityObject

The line item quantity to credit.



29
30
31
# File 'lib/stripe/services/credit_note_preview_lines_service.rb', line 29

def quantity
  @quantity
end

#tax_amountsObject

A list of up to 10 tax amounts for the credit note line item. Cannot be mixed with ‘tax_rates`.



31
32
33
# File 'lib/stripe/services/credit_note_preview_lines_service.rb', line 31

def tax_amounts
  @tax_amounts
end

#tax_ratesObject

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`.



33
34
35
# File 'lib/stripe/services/credit_note_preview_lines_service.rb', line 33

def tax_rates
  @tax_rates
end

#typeObject

Type of the credit note line item, one of ‘invoice_line_item` or `custom_line_item`



35
36
37
# File 'lib/stripe/services/credit_note_preview_lines_service.rb', line 35

def type
  @type
end

#unit_amountObject

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`.



37
38
39
# File 'lib/stripe/services/credit_note_preview_lines_service.rb', line 37

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.



39
40
41
# File 'lib/stripe/services/credit_note_preview_lines_service.rb', line 39

def unit_amount_decimal
  @unit_amount_decimal
end