Class: Stripe::OrderService::UpdateParams::LineItem
- Inherits:
-
RequestParams
- Object
- RequestParams
- Stripe::OrderService::UpdateParams::LineItem
- Defined in:
- lib/stripe/services/order_service.rb
Defined Under Namespace
Classes: Discount, PriceData, ProductData
Instance Attribute Summary collapse
-
#description ⇒ Object
The description for the line item.
-
#discounts ⇒ Object
The discounts applied to this line item.
-
#id ⇒ Object
The ID of an existing line item on the order.
-
#price ⇒ Object
The ID of a [Price](docs.stripe.com/api/prices) to add to the Order.
-
#price_data ⇒ Object
Data used to generate a new Price object inline.
-
#product ⇒ Object
The ID of a [Product](docs.stripe.com/api/products) to add to the Order.
-
#product_data ⇒ Object
Defines a [Product](docs.stripe.com/api/products) inline and adds it to the Order.
-
#quantity ⇒ Object
The quantity of the line item.
-
#tax_rates ⇒ Object
The tax rates applied to this line item.
Instance Method Summary collapse
-
#initialize(description: nil, discounts: nil, id: nil, price: nil, price_data: nil, product: nil, product_data: nil, quantity: nil, tax_rates: nil) ⇒ LineItem
constructor
A new instance of LineItem.
Methods inherited from RequestParams
Constructor Details
#initialize(description: nil, discounts: nil, id: nil, price: nil, price_data: nil, product: nil, product_data: nil, quantity: nil, tax_rates: nil) ⇒ LineItem
Returns a new instance of LineItem.
1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 |
# File 'lib/stripe/services/order_service.rb', line 1376 def initialize( description: nil, discounts: nil, id: nil, price: nil, price_data: nil, product: nil, product_data: nil, quantity: nil, tax_rates: nil ) @description = description @discounts = discounts @id = id @price = price @price_data = price_data @product = product @product_data = product_data @quantity = quantity @tax_rates = tax_rates end |
Instance Attribute Details
#description ⇒ Object
The description for the line item. Will default to the name of the associated product.
1346 1347 1348 |
# File 'lib/stripe/services/order_service.rb', line 1346 def description @description end |
#discounts ⇒ Object
The discounts applied to this line item.
1348 1349 1350 |
# File 'lib/stripe/services/order_service.rb', line 1348 def discounts @discounts end |
#id ⇒ Object
The ID of an existing line item on the order.
1350 1351 1352 |
# File 'lib/stripe/services/order_service.rb', line 1350 def id @id end |
#price ⇒ Object
The ID of a [Price](docs.stripe.com/api/prices) to add to the Order.
The ‘price` parameter is an alternative to using the `product` parameter. If each of your products are sold at a single price, you can set `Product.default_price` and then pass the `product` parameter when creating a line item. If your products are sold at several possible prices, use the `price` parameter to explicitly specify which one to use.
1354 1355 1356 |
# File 'lib/stripe/services/order_service.rb', line 1354 def price @price end |
#price_data ⇒ Object
Data used to generate a new Price object inline.
The ‘price_data` parameter is an alternative to using the `product` or `price` parameters. If you create a Product upfront and configure a `Product.default_price`, pass the `product` parameter when creating a line item. If you prefer not to define Products upfront, or if you charge variable prices, pass the `price_data` parameter to describe the price for this line item.
Each time you pass ‘price_data` we create a Price for the Product. This Price is hidden in both the Dashboard and API lists and cannot be reused.
1360 1361 1362 |
# File 'lib/stripe/services/order_service.rb', line 1360 def price_data @price_data end |
#product ⇒ Object
The ID of a [Product](docs.stripe.com/api/products) to add to the Order.
The Product must have a ‘default_price` specified. Otherwise, specify the price by passing the `price` or `price_data` parameter.
1364 1365 1366 |
# File 'lib/stripe/services/order_service.rb', line 1364 def product @product end |
#product_data ⇒ Object
Defines a [Product](docs.stripe.com/api/products) inline and adds it to the Order.
‘product_data` is an alternative to the `product` parameter. If you created a Product upfront, use the `product` parameter to refer to the existing Product. But if you prefer not to create Products upfront, pass the `product_data` parameter to define a Product inline as part of configuring the Order.
‘product_data` automatically creates a Product, just as if you had manually created the Product. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates.
1370 1371 1372 |
# File 'lib/stripe/services/order_service.rb', line 1370 def product_data @product_data end |
#quantity ⇒ Object
The quantity of the line item.
1372 1373 1374 |
# File 'lib/stripe/services/order_service.rb', line 1372 def quantity @quantity end |
#tax_rates ⇒ Object
The tax rates applied to this line item.
1374 1375 1376 |
# File 'lib/stripe/services/order_service.rb', line 1374 def tax_rates @tax_rates end |