我想问一个关于IAB的问题??无效的购买API https://developers.google.com/android-publisher/api-ref/purchases/voidedpurchases/list。
我有一份正式的订单,我已经退货了。已退还订单状态。我使用无效的购买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值为空。
托尼
发布于 2017-09-24 23:42:50
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
}
]
}
https://stackoverflow.com/questions/46399804
复制