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.ObjectFields
| Field | Description | Modifier and Type |
|---|---|---|
lineItems | Optional list of LineItem ordered by the user. | java.util.List<LineItem> |
orderId | Optional order ID uniquely identifies an order to avoid duplication if the same order is resent. | java.lang.String |
totalValue | The total value of the order. | java.lang.Double |
totalValueCurrency | ISO code for the pricing currency of this order’s total value such as USD, EUR, GBP. |
lineItems
1@Nullable
2public List<LineItem> lineItemsOptional list of LineItem ordered by the user.
orderId
1@Nullable
2public String orderIdOptional order ID uniquely identifies an order to avoid duplication if the same order is resent.
totalValue
1@Nullable
2public Double totalValueThe total value of the order. If provided and non-zero, this value overrides the default calculation, which is the quantity multiplied by the price for all line items.
totalValueCurrency
1@Nullable
2public String totalValueCurrencyAn ISO 4217 currency code for the 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(@Nullable
2 String orderId,
3 @Nullable
4 List<LineItem> lineItems,
5 @Nullable
6 Double totalValue)Parameters
| Parameter | Description |
|---|---|
orderId | The optional unique ID of this order. |
lineItems | The optional items being ordered along with their quantities. All entries must be of type LineItem. |
totalValue | The optional total value of the order. If null or 0, the total is generated as the sum of the revenue from each line item (price multiplied by quantity). |
Methods
fromJSONObject
1@Nullable
2public static Order fromJSONObject(@NonNull
3 org.json.JSONObject json)DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!
Let us know so we can improve!