コード例 #1
0
ファイル: Pay.java プロジェクト: hsoftxl/PlayProject
        public void onConsumeFinished(Purchase purchase, IabResult result) {
          Log.e(TAG, "Consumption finished. Purchase: " + purchase + ", result: " + result);

          // We know this is the "gas" sku because it's the only one we
          // consume,
          // so we don't check which sku was consumed. If you have more than
          // one
          // sku, you probably should check...
          if (result.isSuccess()) {
            // successfully consumed, so we apply the effects of the item in
            // our
            // game world's logic, which in our case means filling the gas
            // tank a bit
            Log.e(TAG, "支付成功");
            payMent.onSucess(item);
            finish();
          } else {
            Log.e(TAG, "支付失败");
            mHelper.consumeAsync(purchase, mConsumeFinishedListener);
            complain("Error while consuming: " + result);
          }
          Log.e(TAG, "End consumption flow.");
        }