use of com.soomla.store.events.MarketPurchaseCancelledEvent in project android-store by soomla.
the class SoomlaStore method handleCancelledPurchase.
/**
* Handles a cancelled purchase by either posting an event containing a
* <code>PurchasableVirtualItem</code> corresponding to the given purchase, or an unexpected
* error event if the item was not found.
*
* @param purchase cancelled purchase to handle.
*/
private void handleCancelledPurchase(IabPurchase purchase) {
String sku = purchase.getSku();
try {
PurchasableVirtualItem v = StoreInfo.getPurchasableItem(sku);
BusProvider.getInstance().post(new MarketPurchaseCancelledEvent(v));
} catch (VirtualItemNotFoundException e) {
SoomlaUtils.LogError(TAG, "(purchaseActionResultCancelled) ERROR : Couldn't find the " + "VirtualCurrencyPack OR MarketItem with productId: " + sku + ". It's unexpected so an unexpected error is being emitted.");
BusProvider.getInstance().post(new UnexpectedStoreErrorEvent());
}
}
Aggregations