예제 #1
0
 /**
  * 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));
   }
 }
예제 #2
0
 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);
 }