Example usage for com.badlogic.gdx.pay Transaction getIdentifier

List of usage examples for com.badlogic.gdx.pay Transaction getIdentifier

Introduction

In this page you can find the example usage for com.badlogic.gdx.pay Transaction getIdentifier.

Prototype

public String getIdentifier() 

Source Link

Document

The item identifier/SKU that matches our item id in the IAP service.

Usage

From source file:com.badlogic.gdx.pay.android.googleplay.testdata.GetPurchasesResponseObjectMother.java

private static ArrayList<String> makeStringArrayListForTransaction(Transaction transaction) {
    ArrayList<String> list = new ArrayList<>();

    JSONObject jsonObject = new JSONObject();

    try {/*from w w  w.ja  v a2  s  . c o m*/
        jsonObject.put(ORDER_ID, transaction.getOrderId());
        jsonObject.put(PACKAGE_NAME, PACKAGE_NAME_GOOD);
        jsonObject.put(ORDER_ID, transaction.getOrderId());
        jsonObject.put(PRODUCT_ID, transaction.getIdentifier());
        jsonObject.put(PURCHASE_TIME, System.currentTimeMillis());

        list.add(jsonObject.toString());
    } catch (JSONException e) {
        throw new RuntimeException(e);
    }

    return list;
}