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
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](stripe.com/docs/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.
-
#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
#==, #[], #[]=, 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
#adjustable_quantity ⇒ Object (readonly)
Attribute for field adjustable_quantity
28 29 30 |
# File 'lib/stripe/resources/line_item.rb', line 28 def adjustable_quantity @adjustable_quantity end |
#amount_discount ⇒ Object (readonly)
Total discount amount applied. If no discounts were applied, defaults to 0.
30 31 32 |
# File 'lib/stripe/resources/line_item.rb', line 30 def amount_discount @amount_discount end |
#amount_subtotal ⇒ Object (readonly)
Total before any discounts or taxes are applied.
32 33 34 |
# File 'lib/stripe/resources/line_item.rb', line 32 def amount_subtotal @amount_subtotal end |
#amount_tax ⇒ Object (readonly)
Total tax amount applied. If no tax was applied, defaults to 0.
34 35 36 |
# File 'lib/stripe/resources/line_item.rb', line 34 def amount_tax @amount_tax end |
#amount_total ⇒ Object (readonly)
Total after discounts and taxes.
36 37 38 |
# File 'lib/stripe/resources/line_item.rb', line 36 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).
38 39 40 |
# File 'lib/stripe/resources/line_item.rb', line 38 def currency @currency end |
#description ⇒ Object (readonly)
An arbitrary string attached to the object. Often useful for displaying to users. Defaults to product name.
40 41 42 |
# File 'lib/stripe/resources/line_item.rb', line 40 def description @description end |
#discounts ⇒ Object (readonly)
The discounts applied to the line item.
42 43 44 |
# File 'lib/stripe/resources/line_item.rb', line 42 def discounts @discounts end |
#display ⇒ Object (readonly)
Attribute for field display
44 45 46 |
# File 'lib/stripe/resources/line_item.rb', line 44 def display @display end |
#id ⇒ Object (readonly)
Unique identifier for the object.
46 47 48 |
# File 'lib/stripe/resources/line_item.rb', line 46 def id @id end |
#metadata ⇒ Object (readonly)
Set of [key-value pairs](stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
48 49 50 |
# File 'lib/stripe/resources/line_item.rb', line 48 def @metadata end |
#object ⇒ Object (readonly)
String representing the object’s type. Objects of the same type share the same value.
50 51 52 |
# File 'lib/stripe/resources/line_item.rb', line 50 def object @object end |
#price ⇒ Object (readonly)
The price used to generate the line item.
52 53 54 |
# File 'lib/stripe/resources/line_item.rb', line 52 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`.
56 57 58 |
# File 'lib/stripe/resources/line_item.rb', line 56 def product @product end |
#quantity ⇒ Object (readonly)
The quantity of products being purchased.
58 59 60 |
# File 'lib/stripe/resources/line_item.rb', line 58 def quantity @quantity end |
#taxes ⇒ Object (readonly)
The taxes applied to the line item.
60 61 62 |
# File 'lib/stripe/resources/line_item.rb', line 60 def taxes @taxes end |
Class Method Details
.object_name ⇒ Object
8 9 10 |
# File 'lib/stripe/resources/line_item.rb', line 8 def self.object_name "item" end |