Class Overview
Class representing an order's individual line items. This is used for order attribution in
reportOrder(List, String, String)
. You can use these items to e.g.
represent an cart of items, their ID, value and quantity or to break down the order total
to vat, discount etc.
Summary
Public Constructors |
|
LineItem(String identifier, int amount)
|
|
LineItem(String identifier, int amount, int quantity)
|
|
LineItem(String identifier, int amount, int quantity, String description)
Examples:
// 3 carrots at $1.99 (ea)
LineItem carrots = new LineItem("carrot", 199, 3, "Fresh Carrots");
// 1 banana at $3.99 (ea)
LineItem banana = new LineItem("banana", 399, 1, "Left Banana");
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Public Constructors
public
LineItem
(String identifier, int amount)
Parameters
identifier
| your items identifier or identifier for this line item ("sku-1234") |
amount
| the per item cost in the smallest decimal unit for this currency,
see reportOrder(List, String, String) for more
information about currency. (199 for $1.99)
|
public
LineItem
(String identifier, int amount, int quantity)
Parameters
identifier
| your items identifier or identifier for this line item ("sku-1234") |
amount
| the per item cost in the smallest decimal unit for this currency,
see reportOrder(int, String, String) for more
information about currency. (199 for $1.99) |
quantity
| the number of items of this type (1)
|
public
LineItem
(String identifier, int amount, int quantity, String description)
Examples:
// 3 carrots at $1.99 (ea)
LineItem carrots = new LineItem("carrot", 199, 3, "Fresh Carrots");
// 1 banana at $3.99 (ea)
LineItem banana = new LineItem("banana", 399, 1, "Left Banana");
Parameters
identifier
| /sku your items identifier or identifier for this line item ("sku-1234") |
amount
| the per item cost in the smallest decimal unit for this currency,
see reportOrder(int, String, String) for more
information about currency. (199 for $1.99) |
quantity
| the number of items of this type (3) |
description
| /name a longer description for this item ("Moose Felt Print")
|
Public Methods
Each line item can have optional free form attributes on them that will be used in the processing
of these items.
Returns
- same object, for convenience