簡體   English   中英

Purchases.Voidedpurchases.List 返回空響應

[英]Purchases.Voidedpurchases.List returns empty response

我正在向google Android Publisher api請求檢查在我的應用程序中已作廢的購買。 問題是響應總是空的(代碼為 200)。 我在 30 天內購買了一些退款。 I tried to make this request using C# android publisher nuget package and manually using postman. 結果成功但為空。

        string           contents   = await File.ReadAllTextAsync("D:/Projects/android-publisher-api-key.json");
        GoogleCredential credential = GoogleCredential.FromJson(contents);

        string[] scopes = { AndroidPublisherService.Scope.Androidpublisher };

        credential = credential.CreateScoped(scopes);

        BaseClientService.Initializer initializer = new BaseClientService.Initializer
        {
            HttpClientInitializer = credential,
            ApplicationName       = "Test App"
        };

        AndroidPublisherService androidPublisherService = new AndroidPublisherService(initializer);

        var request  = androidPublisherService.Purchases.Voidedpurchases.List("com.MyCompany.MyTestApp");
        var response = await request.ExecuteAsync(); // In this response all fields are null

使用 postman 我將請求發送到(使用 BearerToken): https://androidpublisher.googleapis.com/androidpublisher/v3/applications/com.MyCompany.MyTestApp/purchases/voidedpurchases

響應是成功 200 但正文僅包含{} 它至少應該具有文檔中列出的結構。

我解決了這個問題。 如果您遇到此類問題並且您通過 google play 控制台對購買進行退款,那么在退款表格中您必須選中Remove entitlement復選框。 否則,無效的購買將不包括在響應中。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM