Class: Stripe::CreditNoteLineItem
- Inherits:
-
StripeObject
- Object
- StripeObject
- Stripe::CreditNoteLineItem
- Defined in:
- lib/stripe/resources/credit_note_line_item.rb
Overview
The credit note line item object
Defined Under Namespace
Classes: DiscountAmount, PretaxCreditAmount, Tax, TaxCalculationReference
Constant Summary collapse
- OBJECT_NAME =
"credit_note_line_item"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
The integer amount in cents (or local equivalent) representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts.
-
#description ⇒ Object
readonly
Description of the item being credited.
-
#discount_amount ⇒ Object
readonly
The integer amount in cents (or local equivalent) representing the discount being credited for this line item.
-
#discount_amounts ⇒ Object
readonly
The amount of discount calculated per discount for this line item.
-
#id ⇒ Object
readonly
Unique identifier for the object.
-
#invoice_line_item ⇒ Object
readonly
ID of the invoice line item being credited.
-
#livemode ⇒ Object
readonly
If the object exists in live mode, the value is ‘true`.
-
#metadata ⇒ Object
readonly
Set of [key-value pairs](docs.stripe.com/api/metadata) that you can attach to an object.
-
#object ⇒ Object
readonly
String representing the object’s type.
-
#pretax_credit_amounts ⇒ Object
readonly
The pretax credit amounts (ex: discount, credit grants, etc) for this line item.
-
#quantity ⇒ Object
readonly
The number of units of product being credited.
-
#tax_calculation_reference ⇒ Object
readonly
The tax calculation identifiers of the line item.
-
#tax_rates ⇒ Object
readonly
The tax rates which apply to the line item.
-
#taxes ⇒ Object
readonly
The tax information of the line item.
-
#type ⇒ Object
readonly
The type of the credit note line item, one of ‘invoice_line_item` or `custom_line_item`.
-
#unit_amount ⇒ Object
readonly
The cost of each unit of product being credited.
-
#unit_amount_decimal ⇒ Object
readonly
Same as ‘unit_amount`, but contains a decimal value with at most 12 decimal places.
Attributes inherited from StripeObject
Class Method Summary collapse
- .field_encodings ⇒ Object
- .field_remappings ⇒ Object
- .inner_class_types ⇒ Object
- .object_name ⇒ Object
Methods inherited from StripeObject
#==, #[], #[]=, #_get_inner_class_type, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, #hash, #initialize, #inspect, #keys, #marshal_dump, #marshal_load, protected_fields, #serialize_params, #to_hash, #to_json, #to_s, #update_attributes, #values
Constructor Details
This class inherits a constructor from Stripe::StripeObject
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Stripe::StripeObject
Instance Attribute Details
#amount ⇒ Object (readonly)
The integer amount in cents (or local equivalent) representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts.
96 97 98 |
# File 'lib/stripe/resources/credit_note_line_item.rb', line 96 def amount @amount end |
#description ⇒ Object (readonly)
Description of the item being credited.
98 99 100 |
# File 'lib/stripe/resources/credit_note_line_item.rb', line 98 def description @description end |
#discount_amount ⇒ Object (readonly)
The integer amount in cents (or local equivalent) representing the discount being credited for this line item.
100 101 102 |
# File 'lib/stripe/resources/credit_note_line_item.rb', line 100 def discount_amount @discount_amount end |
#discount_amounts ⇒ Object (readonly)
The amount of discount calculated per discount for this line item
102 103 104 |
# File 'lib/stripe/resources/credit_note_line_item.rb', line 102 def discount_amounts @discount_amounts end |
#id ⇒ Object (readonly)
Unique identifier for the object.
104 105 106 |
# File 'lib/stripe/resources/credit_note_line_item.rb', line 104 def id @id end |
#invoice_line_item ⇒ Object (readonly)
ID of the invoice line item being credited
106 107 108 |
# File 'lib/stripe/resources/credit_note_line_item.rb', line 106 def invoice_line_item @invoice_line_item end |
#livemode ⇒ Object (readonly)
If the object exists in live mode, the value is ‘true`. If the object exists in test mode, the value is `false`.
108 109 110 |
# File 'lib/stripe/resources/credit_note_line_item.rb', line 108 def livemode @livemode end |
#metadata ⇒ Object (readonly)
Set of [key-value pairs](docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
110 111 112 |
# File 'lib/stripe/resources/credit_note_line_item.rb', line 110 def @metadata end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
112 113 114 |
# File 'lib/stripe/resources/credit_note_line_item.rb', line 112 def object @object end |
#pretax_credit_amounts ⇒ Object (readonly)
The pretax credit amounts (ex: discount, credit grants, etc) for this line item.
114 115 116 |
# File 'lib/stripe/resources/credit_note_line_item.rb', line 114 def pretax_credit_amounts @pretax_credit_amounts end |
#quantity ⇒ Object (readonly)
The number of units of product being credited.
116 117 118 |
# File 'lib/stripe/resources/credit_note_line_item.rb', line 116 def quantity @quantity end |
#tax_calculation_reference ⇒ Object (readonly)
The tax calculation identifiers of the line item.
118 119 120 |
# File 'lib/stripe/resources/credit_note_line_item.rb', line 118 def tax_calculation_reference @tax_calculation_reference end |
#tax_rates ⇒ Object (readonly)
The tax rates which apply to the line item.
120 121 122 |
# File 'lib/stripe/resources/credit_note_line_item.rb', line 120 def tax_rates @tax_rates end |
#taxes ⇒ Object (readonly)
The tax information of the line item.
122 123 124 |
# File 'lib/stripe/resources/credit_note_line_item.rb', line 122 def taxes @taxes end |
#type ⇒ Object (readonly)
The type of the credit note line item, one of ‘invoice_line_item` or `custom_line_item`. When the type is `invoice_line_item` there is an additional `invoice_line_item` property on the resource the value of which is the id of the credited line item on the invoice.
124 125 126 |
# File 'lib/stripe/resources/credit_note_line_item.rb', line 124 def type @type end |
#unit_amount ⇒ Object (readonly)
The cost of each unit of product being credited.
126 127 128 |
# File 'lib/stripe/resources/credit_note_line_item.rb', line 126 def unit_amount @unit_amount end |
#unit_amount_decimal ⇒ Object (readonly)
Same as ‘unit_amount`, but contains a decimal value with at most 12 decimal places.
128 129 130 |
# File 'lib/stripe/resources/credit_note_line_item.rb', line 128 def unit_amount_decimal @unit_amount_decimal end |
Class Method Details
.field_encodings ⇒ Object
143 144 145 |
# File 'lib/stripe/resources/credit_note_line_item.rb', line 143 def self.field_encodings @field_encodings = { unit_amount_decimal: :decimal_string } end |
.field_remappings ⇒ Object
139 140 141 |
# File 'lib/stripe/resources/credit_note_line_item.rb', line 139 def self.field_remappings @field_remappings = {} end |
.inner_class_types ⇒ Object
130 131 132 133 134 135 136 137 |
# File 'lib/stripe/resources/credit_note_line_item.rb', line 130 def self.inner_class_types @inner_class_types = { discount_amounts: DiscountAmount, pretax_credit_amounts: PretaxCreditAmount, tax_calculation_reference: TaxCalculationReference, taxes: Tax, } end |
.object_name ⇒ Object
8 9 10 |
# File 'lib/stripe/resources/credit_note_line_item.rb', line 8 def self.object_name "credit_note_line_item" end |