0

我想问一个关于 IAB API 的问题 - 无效购买 API https://developers.google.com/android-publisher/api-ref/purchases/voidedpurchases/list

我有一个正式的订单,我已经退款了。订单状态已退款。我使用 voided Purchases API,但总是得到空数据(voidedPurchases = null)。请给我一些关于使用这个 API 的建议。非常感谢。

AndroidVoidedPurchasesResponse result;

HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport();
JsonFactory jsonFactory = JacksonFactory.getDefaultInstance();
ClassLoader classLoader = getClass().getClassLoader();
GoogleCredential credential = new GoogleCredential.Builder()
.setTransport(httpTransport)
.setJsonFactory(jsonFactory)
.setServiceAccountId("service account id")
.setServiceAccountScopes(Collections.singleton("https://www.googleapis.com/auth/androidpublisher"))
.setServiceAccountPrivateKeyFromP12File(new File("p12 file path"))
.build();

AndroidPublisher pub = new AndroidPublisher.Builder(httpTransport, jsonFactory, credential).setApplicationName("packageName").build();
AndroidPublisher.Purchases.Voidedpurchases.List getList = pub.purchases().voidedpurchases().list("packageName");
result = getList.execute();

http返回状态= 200,但结果对象的voidedPurchases值为null

托尼

4

1 回答 1

0
    you can make a simple curl request to the following api

    curl -i https://www.googleapis.com/androidpublisher/v2/applications/packageName/purchases/voidedpurchases


your response would be like this
{
  "tokenPagination": {
    "nextPageToken": string
  },
  "voidedPurchases": [
    {
      "kind": "androidpublisher#voidedPurchase",
      "purchaseToken": string,
      "purchaseTimeMillis": long,
      "voidedTimeMillis": long
    }
  ]
}
于 2017-09-25T07:42:50.280 回答