Represents one line item being purchased through a payment provider, carrying its quantity, unit cost, tax and final price. Payment provider implementations receive a list of these when processing a payment, as an alternative to the older DebitItem based methods.
Properties
| Property | Returns | Description |
|---|---|---|
| finalCost | BigDecimal | The tax inclusive final price, including promotions or other discounts |
| itemDescription | String | Human readable description of the item being purchased. |
| lineItemId | String | Identifier for this line item within the cart, used to correlate the item with the source cart line. |
| product | Product | The product being purchased. |
| productSku | ProductSku | The product sku being purchased, if this line item is for a specific sku. |
| quantity | BigDecimal | Number of units of the item being purchased. |
| tax | BigDecimal | The tax amount included in getFinalCost() for this line item. |
| taxRate | BigDecimal | Tax rate applied to this item, expressed as the rate used to calculate getTax(). |
| unitCost | BigDecimal | Price of a single unit of the item, before tax and before any promotions or discounts. |
Methods
getLineItemId() · getQuantity() · getUnitCost() · getTaxRate() · getFinalCost() · finalCost(Narrative narrative) · getItemDescription() · getProductSku() · getProduct() · getTax()
getLineItemId()
Returns: String
Identifier for this line item within the cart, used to correlate the item with the source cart line.
getQuantity()
Returns: BigDecimal
Number of units of the item being purchased.
getUnitCost()
Returns: BigDecimal
Price of a single unit of the item, before tax and before any promotions or discounts.
getTaxRate()
Returns: BigDecimal
Tax rate applied to this item, expressed as the rate used to calculate getTax().
getFinalCost()
Returns: BigDecimal
The tax inclusive final price, including promotions or other discounts
finalCost(Narrative narrative)
Returns: BigDecimal
Calculates the final cost of this item within the context of the given narrative, allowing narrative specific pricing or promotions to be applied.
| Parameter | Description |
|---|---|
narrative | the narrative context the price is calculated for |
getItemDescription()
Returns: String
Human readable description of the item being purchased.
getProductSku()
Returns: ProductSku
The product sku being purchased, if this line item is for a specific sku.
getProduct()
Returns: Product
The product being purchased.
getTax()
Returns: BigDecimal
The tax amount included in getFinalCost() for this line item.