Search in sources :

Example 1 with VerificationStartedEvent

use of com.soomla.store.events.VerificationStartedEvent in project android-store by soomla.

the class SoomlaStore method handleVerificationStarted.

/**
 * Posts an event about the start of verification for the purchase, or an unexpected
 * error event if the item was not found.
 *
 * @param purchases List of purchases to handle.
 */
private void handleVerificationStarted(List<IabPurchase> purchases) {
    for (IabPurchase purchase : purchases) {
        String sku = purchase.getSku();
        try {
            PurchasableVirtualItem v = StoreInfo.getPurchasableItem(sku);
            BusProvider.getInstance().post(new VerificationStartedEvent(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());
        }
    }
}
Also used : PurchasableVirtualItem(com.soomla.store.domain.PurchasableVirtualItem) VirtualItemNotFoundException(com.soomla.store.exceptions.VirtualItemNotFoundException) VerificationStartedEvent(com.soomla.store.events.VerificationStartedEvent) UnexpectedStoreErrorEvent(com.soomla.store.events.UnexpectedStoreErrorEvent) IabPurchase(com.soomla.store.billing.IabPurchase)

Aggregations

IabPurchase (com.soomla.store.billing.IabPurchase)1 PurchasableVirtualItem (com.soomla.store.domain.PurchasableVirtualItem)1 UnexpectedStoreErrorEvent (com.soomla.store.events.UnexpectedStoreErrorEvent)1 VerificationStartedEvent (com.soomla.store.events.VerificationStartedEvent)1 VirtualItemNotFoundException (com.soomla.store.exceptions.VirtualItemNotFoundException)1