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

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

Introduction

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

Prototype

public String getOrderId() 

Source Link

Document

The original transaction identifier which is unique for each purchase (doesn't change).

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   www.  ja  v a  2 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;
}