2011-08-26 38 views
0

我正在測試應用程序結算和所有工作很好。現在,當我發送購買請求時,我有「購買窗口」,當我點擊「立即購買」時,GET_PURCHASE_INFORMATION會向我發送一個RESULT_ERROR響應代碼:/同樣的事情,當我嘗試恢復事務時,它失敗。在應用程序結算不起作用:RESULT_ERROR

有什麼辦法知道問題是我的還是谷歌的?又是什麼呢^^ (我把谷歌的代碼代碼,只是實現如下因素類)

private class ThemePurchaseObserver extends PurchaseObserver { 
    public ThemePurchaseObserver(Handler handler) { 
     super(PageAccueilActivity.this, handler); 
    } 

    @Override 
    public void onBillingSupported(boolean supported) { 
     Log.d("ThemePurchaseObserver", "onBillingSupported: "+supported); 

     if (supported){ 
      SharedPreferences prefs = getSharedPreferences(Utils.getPrefFile(), MODE_PRIVATE); 
      boolean restorationDone = prefs.getBoolean(KEY_PREF_RESTORATION_DONE, false); 
      if (!restorationDone){ 
       mBillingService.restoreTransactions(); 
      } 
     }   
    } 

    @Override 
    public void onPurchaseStateChange(PurchaseState purchaseState,String itemId, int quantity, long purchaseTime,String developerPayload) { 
     Log.d("ThemePurchaseObserver", "onPurchaseStateChange()"); 

     if (purchaseState == PurchaseState.PURCHASED){ 
      Log.d("ThemePurchaseObserver", itemId+ "PURCHASED"); 
     } else if (purchaseState == PurchaseState.REFUNDED){ 
      Log.d("ThemePurchaseObserver", itemId+ "REFUNDED"); 
     } else if (purchaseState == PurchaseState.CANCELED){ 
      Log.d("ThemePurchaseObserver", itemId+ "CANCELED"); 
     } else { 
      Log.d("ThemePurchaseObserver", itemId+ " unknow state"); 
     } 

    } 

    @Override 
    public void onRequestPurchaseResponse(RequestPurchase request, ResponseCode responseCode) { 
     Log.d("ThemePurchaseObserver", "onRequestPurchaseResponse: "+responseCode);   
    } 

    @Override 
    public void onRestoreTransactionsResponse(RestoreTransactions request, ResponseCode responseCode) { 
     Log.d("ThemePurchaseObserver", "onRestoreTransactionsResponse: "+responseCode); 

     if (responseCode == ResponseCode.RESULT_OK){ 
      SharedPreferences prefs = getSharedPreferences(Utils.getPrefFile(), MODE_PRIVATE); 
      Editor editeur = prefs.edit(); 
      editeur.putBoolean(KEY_PREF_RESTORATION_DONE, true); 
      editeur.commit(); 
     } else { 

     } 
    }  
} 

,並沒有用於恢復的logcat:

DEBUG/BillingService(3363): Billing service connected 
DEBUG/BillingService(3363): CheckBillingSupported 
INFO/BillingService(3363): CheckBillingSupported response code: RESULT_OK 
DEBUG/ThemePurchaseObserver(3363): onBillingSupported: true 
DEBUG/BillingService(3363): RestoreTransactions 
ERROR/BillingService(3363): restoreTransactions received RESULT_OK 
DEBUG/BillingService(3363): request id: 8836359618243990524 
DEBUG/BillingService(3363): request id: -1 
INFO/BillingService(3363): handleCommand() action:com.android.vending.billing.RESPONSE_CODE 
DEBUG/BillingService(3363): RestoreTransactions: RESULT_ERROR 
DEBUG/ThemePurchaseObserver(3363): onRestoreTransactionsResponse: RESULT_ERROR 

的logcat的一個靜態購買(「android.test.purchase」):

DEBUG/BillingService(3363): RequestPurchase 
DEBUG/BillingService(3363): request id: 8990314669027459189 
INFO/BillingReceiver(3363): notifyId: android.test.purchased 
INFO/BillingService(3363): handleCommand() action: com.example.dungeons.GET_PURCHASE_INFORMATION 
DEBUG/BillingService(3363): GetPurchaseInformation 
DEBUG/BillingService(3363): request id: 7301564145243038858 
DEBUG/BillingService(3363): RequestPurchase: RESULT_OK 
DEBUG/ThemePurchaseObserver(3363): onRequestPurchaseResponse: RESULT_OK 
INFO/BillingService(3363): handleCommand() action: com.android.vending.billing.RESPONSE_CODE 
DEBUG/BillingService(3363): GetPurchaseInformation: RESULT_ERROR 

我試圖用我的手機的其他谷歌帳戶(後將其重置爲出廠設置),但現在它給我一個RESULT_BILLING_無法檢查是否支持...

+0

檢查手機的市場應用版本。其次,您可以檢查您是否擁有所需的權限。第三,你是否遵循了Google發佈的開票文檔中提到的所有步驟 – the100rabh

+0

應用版本是2.3.6所以沒關係,權限沒問題,而且我認爲我完成了我需要做的所有事情:/ 加上,每隔RESULT_ERROR時間,一切都很好。 – Imotep

+0

好.....現在它的作品....我只是更新我的YouTube和谷歌地圖應用程序....什麼是鏈接? - 」 – Imotep

回答

0

我也有這個,它得到解決的方式是當我打開安卓市場的應用程序,並接受新的帳戶的條款和條件。

0

我發現它在測試很長一段時間時會出現這個錯誤。我認爲市場檢測到過度使用,並在一段時間內關閉。 24小時後重試或嘗試使用其他Google帳戶進行測試。