use of com.google.api.services.androidpublisher.model.InappproductsListResponse in project OsmAnd-tools by osmandapp.
the class UpdateSubscriptionImpl method test.
private static void test(AndroidPublisher publisher, String subscriptionId, String purchaseToken) {
try {
com.google.api.services.androidpublisher.AndroidPublisher.Inappproducts.List lst = publisher.inappproducts().list(GOOGLE_PACKAGE_NAME_FREE);
InappproductsListResponse response = lst.execute();
for (InAppProduct p : response.getInappproduct()) {
System.out.println("SKU=" + p.getSku() + " type=" + p.getPurchaseType() + " LNG=" + p.getDefaultLanguage() + // " P="+p.getPrices()+
" Period=" + p.getSubscriptionPeriod() + " Status=" + p.getStatus());
}
AndroidPublisher.Purchases purchases = publisher.purchases();
SubscriptionPurchase subscription = purchases.subscriptions().get(GOOGLE_PACKAGE_NAME_FREE, subscriptionId, purchaseToken).execute();
System.out.println(subscription.getUnknownKeys());
System.out.println(subscription.getAutoRenewing());
System.out.println(subscription.getKind());
System.out.println(new Date(subscription.getExpiryTimeMillis()));
System.out.println(new Date(subscription.getStartTimeMillis()));
// return subscription.getExpiryTimeMillis();
// return subscripcion.getValidUntilTimestampMsec();
} catch (IOException e) {
e.printStackTrace();
}
}
Aggregations