PurchaseEvent

public class PurchaseEvent extends PredefinedEvent<PurchaseEvent>

A purchase event to be sent to Answers with optional attributes.

Inherited Constant Summary

Public Constructor Summary

Public Method Summary

PurchaseEvent
putCurrency(Currency currency)
Put currency used in item purchase.
PurchaseEvent
putItemId(String itemId)
Put unique id for purchased item.
PurchaseEvent
putItemName(String itemName)
Put name for purchased item.
PurchaseEvent
putItemPrice(BigDecimal itemPrice)
Put price of purchased item.
PurchaseEvent
putItemType(String itemType)
Put type of purchased item.
PurchaseEvent
putSuccess(boolean purchaseSucceeded)
Put result of purchase attempt.

Inherited Method Summary

Public Constructors

public PurchaseEvent ()

Public Methods

public PurchaseEvent putCurrency (Currency currency)

Put currency used in item purchase.

Parameters
currency currency used in item purchase, not null
Returns
  • this

public PurchaseEvent putItemId (String itemId)

Put unique id for purchased item.

Parameters
itemId unique id for purchased item, not null, no more than MAX_STRING_LENGTH chars
Returns
  • this

public PurchaseEvent putItemName (String itemName)

Put name for purchased item. Answers uses item names for display purposes on the dashboard.

Parameters
itemName name for purchased item, not null, no more than MAX_STRING_LENGTH chars
Returns
  • this

public PurchaseEvent putItemPrice (BigDecimal itemPrice)

Put price of purchased item.

Parameters
itemPrice price of purchased item, not null
Returns
  • this

public PurchaseEvent putItemType (String itemType)

Put type of purchased item. Answers uses item types to group purchased items.

Parameters
itemType type of purchased item, not null, no more than MAX_STRING_LENGTH chars
Returns
  • this

public PurchaseEvent putSuccess (boolean purchaseSucceeded)

Put result of purchase attempt. A value of true indicates that the purchase was successful. A value of false indicates that the purchase failed to be completed.

Parameters
purchaseSucceeded result of purchase attempt
Returns
  • this