@Override public void request(Hashtable<String, String> products) { Log.d("IabTest", "requesting"); SparseArray<Bundle> arr = new SparseArray<Bundle>(); int i = 0; Enumeration<String> e = products.keys(); while (e.hasMoreElements()) { String prodName = e.nextElement(); Bundle map = new Bundle(); Log.d("IabTest", "ProdName: " + prodName + "; sku: " + products.get(prodName)); map.putString("productId", products.get(prodName)); map.putString("title", "Test product " + i); map.putString("description", "Product for testing"); map.putString("price", "1.99"); arr.put(i, map); i++; } Iab.productsComplete(this, arr); Iab.productsError(this, "Test Products Error"); }
@Override public void restore() { Log.d("IabTest", "restoring"); Iab.restoreComplete(this); Iab.restoreError(this, "Test Restore Error"); }
@Override public void purchase(String productId) { Log.d("IabTest", "purchasing: " + productId); Iab.purchaseComplete(this, productId, "test_receipt"); Iab.purchaseError(this, "Test Purchase Error"); }
@Override public void check() { Log.d("IabTest", "checking"); Iab.available(this); Iab.notAvailable(this); }