Class Order

An order sent upon user checkout. The order contains a total purchase value and line items representing each product and quantity.

1public class Order
2extends java.lang.Object

Fields 

FieldDescriptionModifier and Type
lineItemsOptional list of LineItem ordered by the user.java.util.List<LineItem>
orderIdOptional order ID uniquely identifies an order to avoid duplication if the same order is resent.java.lang.String
totalValueThe total value of the order.java.lang.Double
totalValueCurrencyISO code for the pricing currency of this order’s total value such as USD, EUR, GBP.

lineItems 

1public java.util.List<LineItem> lineItems

Optional list of LineItem ordered by the user.

orderId 

1public java.lang.String orderId

Optional order ID uniquely identifies an order to avoid duplication if the same order is resent.

totalValue 

1public java.lang.Double totalValue

The total value of the order. If present and non-zero, this value overrides the normal order value calculation which is quantity multiplied by price for all the line items.

totalValueCurrency 

1public java.lang.String totalValueCurrency

ISO code for the pricing currency of this order’s total value such as USD, EUR, GBP.

Constructors 

Order 

Builds an order, which can then be further modified. This method only builds a data object. To use it, pass it to one of the tracking methods like Context.purchase(com.evergage.android.promote.Order).

1public Order(java.lang.String orderId,
2             java.util.List<LineItem> lineItems,
3             java.lang.Double totalValue)

Parameters 

ParameterDescription
orderIdThe optional unique ID of this order.
lineItemsThe optional items being ordered along with their quantities. All entries must be of type LineItem.
totalValueThe optional total value of the order. If null or 0, the total will be generated as the sum of the revenue from each line item (price x quantity).

Methods 

fromJSONObject 

1public static Order fromJSONObject(org.json.JSONObject json)