/** * Called after the response to a {@link * net.robotmedia.billing.request.CheckSubscriptionSupported} request is received. * * @param supported */ protected static void onSubscriptionChecked(boolean supported) { subscriptionStatus = supported ? BillingStatus.SUPPORTED : BillingStatus.UNSUPPORTED; if (subscriptionStatus == BillingStatus.SUPPORTED) { // Save us the // billing check billingStatus = BillingStatus.SUPPORTED; } for (IBillingObserver o : observers) { o.onSubscriptionChecked(supported); } }
protected static void onRequestPurchaseResponse( String itemId, BillingRequest.ResponseCode response) { for (IBillingObserver o : observers) { o.onRequestPurchaseResponse(itemId, response); } }
protected static void onTransactionsRestored() { for (IBillingObserver o : observers) { o.onTransactionsRestored(); } }
/** * Called after the response to a {@link net.robotmedia.billing.request.RequestPurchase} request * is received. * * @param itemId id of the item whose purchase was requested. * @param purchaseIntent intent to purchase the item. */ protected static void onPurchaseIntent(String itemId, PendingIntent purchaseIntent) { for (IBillingObserver o : observers) { o.onPurchaseIntent(itemId, purchaseIntent); } }
/** * Notifies observers of the purchase state change of the specified item. * * @param itemId id of the item whose purchase state has changed. * @param state new purchase state of the item. */ private static void notifyPurchaseStateChange(String itemId, Transaction.PurchaseState state) { for (IBillingObserver o : observers) { o.onPurchaseStateChanged(itemId, state); } }