@Override public int getPurchaseHistory(@Nonnull String product, @Nullable String continuationToken, @Nullable Bundle extraParams, @Nonnull RequestListener<Purchases> listener) { Check.isNotEmpty(product); return runWhenConnected(new GetPurchaseHistoryRequest(product, continuationToken, extraParams), wrapListener(listener), mTag); }
@Override public int purchase(@Nonnull String product, @Nonnull String sku, @Nullable String payload, @Nullable Bundle extraParams, @Nonnull PurchaseFlow purchaseFlow) { Check.isNotEmpty(product); Check.isNotEmpty(sku); return runWhenConnected(new PurchaseRequest(product, sku, payload, extraParams), wrapListener(purchaseFlow), mTag); }
@Override public int purchase(@Nonnull String product, @Nonnull String sku, @Nullable String payload, @Nonnull PurchaseFlow purchaseFlow) { Check.isNotEmpty(product); Check.isNotEmpty(sku); return runWhenConnected(new PurchaseRequest(product, sku, payload), wrapListener(purchaseFlow), mTag); }
@Override public int consume(@Nonnull String token, @Nonnull RequestListener<Object> listener) { Check.isNotEmpty(token); return runWhenConnected(new ConsumePurchaseRequest(token), wrapListener(listener), mTag); }
@Override public int changeSubscription(@Nonnull List<String> oldSkus, @Nonnull String newSku, @Nullable String payload, @Nonnull PurchaseFlow purchaseFlow) { Check.isNotEmpty(oldSkus); Check.isNotEmpty(newSku); return runWhenConnected( new ChangePurchaseRequest(ProductTypes.SUBSCRIPTION, oldSkus, newSku, payload), wrapListener(purchaseFlow), mTag); }
@Override public int isBillingSupported(@Nonnull String product, int apiVersion, @Nonnull Bundle extraParams, @Nonnull RequestListener<Object> listener) { Check.isNotEmpty(product); return runWhenConnected(new BillingSupportedRequest(product, apiVersion, extraParams), wrapListener(listener), mTag); }
@Override public int isBillingSupported(@Nonnull String product, int apiVersion, @Nonnull RequestListener<Object> listener) { Check.isNotEmpty(product); return runWhenConnected(new BillingSupportedRequest(product, apiVersion, null), wrapListener(listener), mTag); }
@Override public int isPurchased(@Nonnull final String product, @Nonnull final String sku, @Nonnull final RequestListener<Boolean> listener) { Check.isNotEmpty(sku); final IsPurchasedListener isPurchasedListener = new IsPurchasedListener(sku, listener); final GetPurchasesRequest request = new GetPurchasesRequest(product, null, mConfiguration.getPurchaseVerifier()); isPurchasedListener.mRequest = request; return runWhenConnected(request, wrapListener(isPurchasedListener), mTag); }
@Override public int getWholePurchaseHistory(@Nonnull String product, @Nullable Bundle extraParams, @Nonnull RequestListener<Purchases> listener) { Check.isNotEmpty(product); final GetPurchaseHistoryRequest request = new GetPurchaseHistoryRequest(product, null, extraParams); return runWhenConnected(request, wrapListener(new GetWholePurchaseHistoryListener(request, listener)), mTag); }
@Override public int getSkus(@Nonnull String product, @Nonnull List<String> skus, @Nonnull RequestListener<Skus> listener) { Check.isNotEmpty(product); Check.isNotEmpty(skus); return runWhenConnected(new GetSkuDetailsRequest(product, skus), wrapListener(listener), mTag); }
@Override public int getAllPurchases(@Nonnull String product, @Nonnull RequestListener<Purchases> listener) { Check.isNotEmpty(product); final GetPurchasesRequest request = new GetPurchasesRequest(product, null, mConfiguration.getPurchaseVerifier()); return runWhenConnected(request, wrapListener(new GetAllPurchasesListener(request, listener)), mTag); }
@Override public int getPurchases(@Nonnull final String product, @Nullable final String continuationToken, @Nonnull RequestListener<Purchases> listener) { Check.isNotEmpty(product); return runWhenConnected(new GetPurchasesRequest(product, continuationToken, mConfiguration.getPurchaseVerifier()), wrapListener(listener), mTag); }