/** * Purchases a guide. * * @param guide Guide to be purchased. */ public void purchase(Guide guide) { int status = manager.purchaseProduct( guide.getId(), IAPClientPaymentManager.FORCED_AUTOMATIC_RESTORATION); if (status != IAPClientPaymentManager.SUCCESS) { guide = null; Util.showAlert("Purchase failure", getPaymentError(status)); } }
public final void productDataReceived(int status, IAPClientProductData productData) { newGuide.setCity(productData.getShortDescription()); newGuide.setPrice(productData.getPrice()); newGuide.setUrl(GUIDE_URL_PREFIX + newGuide.getId()); manager.purchaseProduct(newGuide.getId(), IAPClientPaymentManager.FORCED_AUTOMATIC_RESTORATION); }