EVGOrder Class Reference

Inherits fromDeclared in
NSObjectEVGItems.h

Overview 

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

Initialization 

Here is a convenient way to initialize an EVGOrder

1EVGOrder *order = [EVGOrder orderWithId:@"order123" lineItems:@[lineItem] totalValue:@100];

lineItems 

Optional array of EVGLineItems ordered by the user.

1@property (nullable, nonatomic, strong) NSArray<EVGLineItem*> *lineItems

orderId 

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

1@property (nullable, nonatomic, copy) NSString *orderId

totalValue 

The total value of the order. If present and nonzero this value overrides the normal order value calculation which is quantity x price for all the line items.

1@property (nullable, nonatomic, strong) NSNumber *totalValue

totalValueCurrency 

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

1@property (nullable, nonatomic, copy) NSString *totalValueCurrency

orderWithId:lineItems:totalValue: 

Builds an order. This method only builds a data object. To use it, pass it to one of the tracking methods like [EVGContext purchase:].

1+ (nonnull instancetype)orderWithId:(nullable NSString *)orderId lineItems:(nullable NSArray<EVGLineItem*> *)lineItems totalValue:(nullable NSNumber *)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 EVGLineItem.
totalValueThe optional total value of the order. If nil or 0 it will be treated as the sum of the revenue from each line item (price x quantity).

Return Value

An order which can be further modified.