Inherits from NSObject
Declared in GAITransaction.h

Overview

A simple class to hold transaction data.

Tasks

Properties

affiliation

Transaction affiliation.

@property (nonatomic, copy, readonly) NSString *affiliation

Declared In

GAITransaction.h

items

Transaction items, as an immutable array.

@property (nonatomic, readonly) NSArray *items

Declared In

GAITransaction.h

revenueMicros

Revenue in micros (millionths of a currency unit). Note that this must be set manually because it is not updated when items are added.

@property (nonatomic, assign) int64_t revenueMicros

Declared In

GAITransaction.h

shippingMicros

Shipping cost in micros (millionths of a currency unit). Note that this must be set manually because it is not updated when items are added.

@property (nonatomic, assign) int64_t shippingMicros

Declared In

GAITransaction.h

taxMicros

Tax in micros (millionths of a currency unit). Note that this must be set manually because it is not updated when items are added.

@property (nonatomic, assign) int64_t taxMicros

Declared In

GAITransaction.h

transactionId

Transaction ID.

@property (nonatomic, copy, readonly) NSString *transactionId

Declared In

GAITransaction.h

Class Methods

transactionWithId:withAffiliation:

Create and initialize a transaction.

+ (GAITransaction *)transactionWithId:(NSString *)transactionId withAffiliation:(NSString *)affiliation

Parameters

transactionId

The transaction ID. Required (must not be nil).

affiliation

The transaction affiliation. May be nil.

Return Value

A GAITransaction object with the specified transaction ID and affiliation.

Declared In

GAITransaction.h

Instance Methods

addItem:

Add an item to the transaction. If an item with the same SKU already exists in the transaction, that item will be replaced with this one.

- (void)addItem:(GAITransactionItem *)item

Parameters

item

The GAITransactionItem to add to the transaction.

Declared In

GAITransaction.h

addItemWithCode:name:category:priceMicros:quantity:

Add an item to the transaction. If an item with the same SKU already exists in the transaction, that item will be replaced with this one.

- (void)addItemWithCode:(NSString *)productCode name:(NSString *)productName category:(NSString *)productCategory priceMicros:(int64_t)priceMicros quantity:(NSInteger)quantity

Parameters

productCode

The item product code; must not be nil or empty.

productName

The item product name; may be nil.

productCategory

The item product category; may be nil.

priceMicros

The item price, in micros (millionths of a currency unit).

quantity

The item quantity, as an NSInteger.

Return Value

The newly initialized item.

Declared In

GAITransaction.h