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

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

Introduction

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

Prototype

public String getIdentifier() 

Source Link

Usage

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

private static ArrayList<String> itemIdList(Offer offer) {
    ArrayList<String> skuList = new ArrayList<>();
    skuList.add(offer.getIdentifier());
    return skuList;
}

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

private static JSONObject makeJsonObject(Offer offer, Information information) {
    JSONObject object = new JSONObject();

    try {/*  w  w  w . ja  v  a  2  s  . c  o m*/
        object.put(GoogleBillingConstants.SKU_TITLE, information.getLocalName());
        object.put(GoogleBillingConstants.SKU_DESCRIPTION, information.getLocalDescription());
        object.put(GoogleBillingConstants.SKU_PRICE, information.getLocalPricing());
        object.put(GoogleBillingConstants.PRODUCT_ID, offer.getIdentifier());
        object.put(GoogleBillingConstants.PRICE_AMOUNT_MICROS, information.getPriceInCents() * 10_000);
        object.put(GoogleBillingConstants.PRICE_CURRENCY_CODE, information.getPriceCurrencyCode());
    } catch (JSONException e) {
        throw new IllegalStateException("Failed to create json object", e);
    }
    return object;
}

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

private static String makeJsonObjectForOffer(Offer offer) throws JSONException {
    JSONObject jsonObject = new JSONObject();
    jsonObject.put(GoogleBillingConstants.PRODUCT_ID, offer.getIdentifier());
    jsonObject.put(GoogleBillingConstants.PURCHASE_TIME, System.currentTimeMillis());
    jsonObject.put(GoogleBillingConstants.ORDER_ID, "GPA.1234-5678-9012-34567");

    return jsonObject.toString();
}