Class: Stripe::LineItem
- Inherits:
-
APIResource
- Object
- StripeObject
- APIResource
- Stripe::LineItem
- Defined in:
- lib/stripe/resources/line_item.rb
Overview
A line item.
Defined Under Namespace
Classes: AdjustableQuantity, Discount, Display, Tax, TaxCalculationReference
Constant Summary collapse
- OBJECT_NAME =
"item"
Constants inherited from StripeObject
StripeObject::RESERVED_FIELD_NAMES
Instance Attribute Summary collapse
-
#adjustable_quantity ⇒ Object
readonly
Attribute for field adjustable_quantity.
-
#amount_discount ⇒ Object
readonly
Total discount amount applied.
-
#amount_subtotal ⇒ Object
readonly
Total before any discounts or taxes are applied.
-
#amount_tax ⇒ Object
readonly
Total tax amount applied.
-
#amount_total ⇒ Object
readonly
Total after discounts and taxes.
-
#currency ⇒ Object
readonly
Three-letter [ISO currency code](www.iso.org/iso-4217-currency-codes.html), in lowercase.
-
#description ⇒ Object
readonly
An arbitrary string attached to the object.
-
#discounts ⇒ Object
readonly
The discounts applied to the line item.
-
#display ⇒ Object
readonly
Attribute for field display.
-
#id ⇒ Object
readonly
Unique identifier for the object.
-
#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.
-
#price ⇒ Object
readonly
The price used to generate the line item.
-
#product ⇒ Object
readonly
The ID of the product for this line item.
-
#quantity ⇒ Object
readonly
The quantity of products being purchased.
-
#tax_calculation_reference ⇒ Object
readonly
The tax calculation identifiers of the line item.
-
#taxes ⇒ Object
readonly
The taxes applied to the line item.
Attributes inherited from APIResource
Attributes inherited from StripeObject
Class Method Summary collapse
Methods inherited from APIResource
class_name, custom_method, #refresh, #request_stripe_object, resource_url, #resource_url, retrieve, save_nested_resource
Methods included from APIOperations::Request
Methods inherited from StripeObject
#==, #[], #[]=, #_get_inner_class_type, additive_object_param, additive_object_param?, #as_json, construct_from, #deleted?, #dirty!, #each, #eql?, field_encodings, #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
#adjustable_quantity ⇒ Object (readonly)
Attribute for field adjustable_quantity
100 101 102 |
# File 'lib/stripe/resources/line_item.rb', line 100 def adjustable_quantity @adjustable_quantity end |
#amount_discount ⇒ Object (readonly)
Total discount amount applied. If no discounts were applied, defaults to 0.
102 103 104 |
# File 'lib/stripe/resources/line_item.rb', line 102 def amount_discount @amount_discount end |
#amount_subtotal ⇒ Object (readonly)
Total before any discounts or taxes are applied.
104 105 106 |
# File 'lib/stripe/resources/line_item.rb', line 104 def amount_subtotal @amount_subtotal end |
#amount_tax ⇒ Object (readonly)
Total tax amount applied. If no tax was applied, defaults to 0.
106 107 108 |
# File 'lib/stripe/resources/line_item.rb', line 106 def amount_tax @amount_tax end |
#amount_total ⇒ Object (readonly)
Total after discounts and taxes.
108 109 110 |
# File 'lib/stripe/resources/line_item.rb', line 108 def amount_total @amount_total end |
#currency ⇒ Object (readonly)
Three-letter [ISO currency code](www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](stripe.com/docs/currencies).
110 111 112 |
# File 'lib/stripe/resources/line_item.rb', line 110 def currency @currency end |
#description ⇒ Object (readonly)
An arbitrary string attached to the object. Often useful for displaying to users. Defaults to product name.
112 113 114 |
# File 'lib/stripe/resources/line_item.rb', line 112 def description @description end |
#discounts ⇒ Object (readonly)
The discounts applied to the line item.
114 115 116 |
# File 'lib/stripe/resources/line_item.rb', line 114 def discounts @discounts end |
#display ⇒ Object (readonly)
Attribute for field display
116 117 118 |
# File 'lib/stripe/resources/line_item.rb', line 116 def display @display end |
#id ⇒ Object (readonly)
Unique identifier for the object.
118 119 120 |
# File 'lib/stripe/resources/line_item.rb', line 118 def id @id 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.
120 121 122 |
# File 'lib/stripe/resources/line_item.rb', line 120 def @metadata end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
122 123 124 |
# File 'lib/stripe/resources/line_item.rb', line 122 def object @object end |
#price ⇒ Object (readonly)
The price used to generate the line item.
124 125 126 |
# File 'lib/stripe/resources/line_item.rb', line 124 def price @price end |
#product ⇒ Object (readonly)
The ID of the product for this line item.
This will always be the same as ‘price.product`.
128 129 130 |
# File 'lib/stripe/resources/line_item.rb', line 128 def product @product end |
#quantity ⇒ Object (readonly)
The quantity of products being purchased.
130 131 132 |
# File 'lib/stripe/resources/line_item.rb', line 130 def quantity @quantity end |
#tax_calculation_reference ⇒ Object (readonly)
The tax calculation identifiers of the line item.
132 133 134 |
# File 'lib/stripe/resources/line_item.rb', line 132 def tax_calculation_reference @tax_calculation_reference end |
#taxes ⇒ Object (readonly)
The taxes applied to the line item.
134 135 136 |
# File 'lib/stripe/resources/line_item.rb', line 134 def taxes @taxes end |
Class Method Details
.field_remappings ⇒ Object
146 147 148 |
# File 'lib/stripe/resources/line_item.rb', line 146 def self.field_remappings @field_remappings = {} end |
.inner_class_types ⇒ Object
136 137 138 139 140 141 142 143 144 |
# File 'lib/stripe/resources/line_item.rb', line 136 def self.inner_class_types @inner_class_types = { adjustable_quantity: AdjustableQuantity, discounts: Discount, display: Display, tax_calculation_reference: TaxCalculationReference, taxes: Tax, } end |
.object_name ⇒ Object
8 9 10 |
# File 'lib/stripe/resources/line_item.rb', line 8 def self.object_name "item" end |