Class: Stripe::LineItem

Inherits:
APIResource show all
Defined in:
lib/stripe/resources/line_item.rb

Overview

A line item.

Defined Under Namespace

Classes: Discount, Tax

Constant Summary collapse

OBJECT_NAME =
"item"

Constants inherited from StripeObject

StripeObject::RESERVED_FIELD_NAMES

Instance Attribute Summary collapse

Attributes inherited from APIResource

#save_with_parent

Attributes inherited from StripeObject

#last_response

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

included

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_discountObject (readonly)

Total discount amount applied. If no discounts were applied, defaults to 0.



51
52
53
# File 'lib/stripe/resources/line_item.rb', line 51

def amount_discount
  @amount_discount
end

#amount_subtotalObject (readonly)

Total before any discounts or taxes are applied.



53
54
55
# File 'lib/stripe/resources/line_item.rb', line 53

def amount_subtotal
  @amount_subtotal
end

#amount_taxObject (readonly)

Total tax amount applied. If no tax was applied, defaults to 0.



55
56
57
# File 'lib/stripe/resources/line_item.rb', line 55

def amount_tax
  @amount_tax
end

#amount_totalObject (readonly)

Total after discounts and taxes.



57
58
59
# File 'lib/stripe/resources/line_item.rb', line 57

def amount_total
  @amount_total
end

#currencyObject (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).



59
60
61
# File 'lib/stripe/resources/line_item.rb', line 59

def currency
  @currency
end

#descriptionObject (readonly)

An arbitrary string attached to the object. Often useful for displaying to users. Defaults to product name.



61
62
63
# File 'lib/stripe/resources/line_item.rb', line 61

def description
  @description
end

#discountsObject (readonly)

The discounts applied to the line item.



63
64
65
# File 'lib/stripe/resources/line_item.rb', line 63

def discounts
  @discounts
end

#idObject (readonly)

Unique identifier for the object.



65
66
67
# File 'lib/stripe/resources/line_item.rb', line 65

def id
  @id
end

#objectObject (readonly)

String representing the object’s type. Objects of the same type share the same value.



67
68
69
# File 'lib/stripe/resources/line_item.rb', line 67

def object
  @object
end

#priceObject (readonly)

The price used to generate the line item.



69
70
71
# File 'lib/stripe/resources/line_item.rb', line 69

def price
  @price
end

#quantityObject (readonly)

The quantity of products being purchased.



71
72
73
# File 'lib/stripe/resources/line_item.rb', line 71

def quantity
  @quantity
end

#taxesObject (readonly)

The taxes applied to the line item.



73
74
75
# File 'lib/stripe/resources/line_item.rb', line 73

def taxes
  @taxes
end

Class Method Details

.field_remappingsObject



79
80
81
# File 'lib/stripe/resources/line_item.rb', line 79

def self.field_remappings
  @field_remappings = {}
end

.inner_class_typesObject



75
76
77
# File 'lib/stripe/resources/line_item.rb', line 75

def self.inner_class_types
  @inner_class_types = { discounts: Discount, taxes: Tax }
end

.object_nameObject



8
9
10
# File 'lib/stripe/resources/line_item.rb', line 8

def self.object_name
  "item"
end