Purchases.Voidedpurchases.List returns 空响应

Purchases.Voidedpurchases.List returns empty response

我正在向 google Android Publisher api 请求检查我的申请中已作废的购买。问题是响应始终为空(代码为 200)。我在 30 天内收到了一些退款。我尝试使用 C# android 发布者 nuget 包并手动使用邮递员发出此请求。结果成功但为空

        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

我使用邮递员将请求发送到(使用 bearerToken): https://androidpublisher.googleapis.com/androidpublisher/v3/applications/com.MyCompany.MyTestApp/purchases/voidedpurchases

响应成功 200,但正文仅包含 {}。它至少应具有 documentation.

中列出的结构

我解决了这个问题。如果您遇到这样的问题,并且您正在通过 google Play 控制台对购买的商品进行退款,那么在退款表格中,您必须选中 Remove entitlement 复选框。否则作废的购买将不会被包含在响应中。