[英]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.