title: Android In-App Billing, missing purchases
body: <p>I am using Google's In-App Billing for my Android app.</p>
  
  <p>I used the IabHelper class from Google's how to, as their billing seems extremely complicated.</p>
  
  <p>My issue is I want to know if the purchase is successful or not. I think I'm following the process correctly, but in my logs I see a lot of users that get the upgrade, but whose purchase never shows up in my Google Play payments account. (i.e. they get the upgrade for free).</p>
  
  <p>I'm logging the GP order ids, sometimes its a number like,</p>
  
  <p>GPA.1234-5678-9123-1234</p>
  
  <p>But sometimes its like,</p>
  
  <p>1234567891234.1234567891234</p>
  
  <p>Normally I think its the non GPA orders that don't get charged.</p>
  
  <p>Also I think you can put an order through, then cancel it, and still get the upgrade?</p>
  
  <p>How do you ensure the user really paid?</p>
  
  <p>Code:</p>
  
  <pre><code>IabHelper.OnIabPurchaseFinishedListener mPurchaseFinishedListener = new IabHelper.OnIabPurchaseFinishedListener() {
      public void onIabPurchaseFinished(IabResult result, final Purchase purchase) {
          if (result.isFailure()) {
              showMessage("Google Billing Purchase Error");                   
              return;
          } else if (purchase.getSku().equals(sku)) {
              IabHelper.QueryInventoryFinishedListener mReceivedInventoryListener = new IabHelper.QueryInventoryFinishedListener() {
                  public void onQueryInventoryFinished(IabResult result, Inventory inventory) {
                      if (result.isFailure()) {
                          showMessage("Google Billing Error");
                          return;
                      } else {
                          if (inventory.hasPurchase(sku)) {
                              showMessage("Thank you for upgrading");
                              grantUpgrade();
                              // ** This line gets call, but no payment occurs.
                          }
                      }
                  }
              };
              mHelper.queryInventoryAsync(mReceivedInventoryListener);
          }
      }
  };
  mHelper.launchPurchaseFlow(this, sku, 10001, mPurchaseFinishedListener, "");
  </code></pre>
  
  <p>*** updated to check "inventory.hasPurchase(sku)" but still see users who get the upgrade but don't pay.</p>
  
  <p>** maybe the users are using Freedom hack? Anyway to prevent this?</p>