You can get the token and order id processing the response from 'getPurchases'
https://developer.android.com/google/play/billing/billing_reference.html#getPurchases
, IabHelper TrialDrive.
https://github.com/googlesamples/android-play-billing/tree/master/TrivialDrive
, , Inventory:
IabHelper.QueryInventoryFinishedListener mGotInventoryListener = new IabHelper.QueryInventoryFinishedListener() {
public void onQueryInventoryFinished(IabResult result, Inventory inventory) {
Log.d(TAG, "Query inventory finished.");
if (mHelper == null) return;
if (result.isFailure()) {
Log.d(TAG, "Failed to query inventory: " + result);
return;
}
Purchase premiumMonthly = inventory.getPurchase(SKU_SUSCRIPTION);
if (premiumMonthly != null && premiumMonthly.isAutoRenewing()) {
String token = premiumMonthly.getToken();
String orderid = premiumMonthly.getOrderId();
Log.d(TAG, token);
Log.d(TAG, orderid);
}
}
....
mHelper.queryInventoryAsync(mGotInventoryListener);