EVGOrder Class Reference
| Inherits from | NSObject |
|---|---|
| Declared in | EVGItems.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
EVGOrder *order = [EVGOrder orderWithId:@"order123" lineItems:@[lineItem] totalValue:@100];
lineItems
Optional array of EVGLineItems ordered by the user.
@property (nullable, nonatomic, strong) NSArray<EVGLineItem*> *lineItemsDeclared In
EVGItems.h
orderId
Optional order ID uniquely identifies an order to avoid duplication if the same order is resent.
@property (nullable, nonatomic, copy) NSString *orderIdDeclared In
EVGItems.h
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.
@property (nullable, nonatomic, strong) NSNumber *totalValueDeclared In
EVGItems.h
totalValueCurrency
ISO code for the pricing currency of this order’s total value such as "USD", "EUR", "GBP".
@property (nullable, nonatomic, copy) NSString *totalValueCurrencyDeclared In
EVGItems.h
+ 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:].
+ (nonnull instancetype)orderWithId:(nullable NSString *)orderId lineItems:(nullable NSArray<EVGLineItem*> *)lineItems totalValue:(nullable NSNumber *)totalValueParameters
orderId |
The optional unique ID of this order. |
|---|---|
lineItems |
The optional items being ordered along with their quantities. All entries must be of type |
totalValue |
The optional total value of the order. If |
Return Value
An order which can be further modified.
Declared In
EVGItems.h