繁体   English   中英

Google Play付款流程身份验证错误

[英]google play payment flow authentication error

嗨,我正在尝试测试我的inapp购买。 我已经建立了一个商家帐户,并创建了一个测试人员Alpha组。 但是,当我尝试在设备上的应用程序上进行付款时,出现以下错误。 我已经在2种不同的设备上对此进行了测试,但是虽然可以卸载其他应用程序,但是却遇到了相同的错误。

错误验证是必需的。 您需要登录到您的Google帐户。

请帮忙

    mHelper.startSetup(new IabHelper.OnIabSetupFinishedListener() {
        public void onIabSetupFinished(IabResult result) {
            Log.d(TAG, "Setup finished.");

            if (!result.isSuccess()) {
                // Oh noes, there was a problem.
                complain("Problem setting up in-app billing: " + result);
                return;
            }

            // Have we been disposed of in the meantime? If so, quit.
            if (mHelper == null) return;

            // IAB is fully set up. Now, let's get an inventory of stuff we own.
            Log.d(TAG, "Setup successful. Querying inventory.");
            try {
                mHelper.queryInventoryAsync(mGotInventoryListener);
            } catch (IabHelper.IabAsyncInProgressException e) {
                complain("Error querying inventory. Another async operation in progress.");
            }
        }
    });

   //Querying for Items Available for Purchase
   IabHelper.QueryInventoryFinishedListener mGotInventoryListener = new IabHelper.QueryInventoryFinishedListener() {
    public void onQueryInventoryFinished(IabResult result, Inventory inventory) {
        Purchase gasPurchase = inventory.getPurchase(SKU_GAS);
        if (gasPurchase != null && verifyDeveloperPayload(gasPurchase)) {
            Log.d(TAG, "We have gas. Consuming it.");
            try {
                mHelper.consumeAsync(inventory.getPurchase(SKU_GAS), mConsumeFinishedListener);
            } catch (IabHelper.IabAsyncInProgressException e) {
                complain("Error consuming gas. Another async operation in progress.");
            }
            return;
        }

        //updateUi();
        //setWaitScreen(false);
        Log.d(TAG, "Initial inventory query finished; enabling main UI.");
    }
   };

   // User clicked the "Buy Gas" button
   public void onBuyCoinButtonClicked(View arg0) {
    Log.d(TAG, "Buy coin button clicked.");

    Log.d(TAG, "Launching purchase flow for coins.");

    String payload = "";

    try {
        mHelper.launchPurchaseFlow(this, SKU_GAS, RC_REQUEST,
                mPurchaseFinishedListener, payload);
    } catch (IabHelper.IabAsyncInProgressException e) {
        complain("Error launching purchase flow. Another async operation in progress.");
        //setWaitScreen(false);
    }
}

我的资料来自简单的驱动器示例https://developer.android.com/training/in-app-billing/preparing-iab-app.html

步骤1:检查您的base 64密钥

步骤2:检查您的Sku

static final String SKU_GAS = "android.test.purchased";

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM