MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / purchaseToJson

Method purchaseToJson

src/plugins/iap/src/com/foxdebug/iap/Iap.java:387–403  ·  view source on GitHub ↗
(Purchase purchase)

Source from the content-addressed store, hash-verified

385 }
386
387 private JSONObject purchaseToJson(Purchase purchase) throws JSONException {
388 JSONObject item = new JSONObject();
389 List<String> skuList = purchase.getSkus();
390 JSONArray skuArray = new JSONArray();
391 for (String sku : skuList) {
392 skuArray.put(sku);
393 }
394 item.put("productIds", skuArray);
395 item.put("orderId", purchase.getOrderId());
396 item.put("signature", purchase.getSignature());
397 item.put("purchaseTime", purchase.getPurchaseTime());
398 item.put("purchaseToken", purchase.getPurchaseToken());
399 item.put("purchaseState", purchase.getPurchaseState());
400 item.put("isAcknowledged", purchase.isAcknowledged());
401 item.put("developerPayload", purchase.getDeveloperPayload());
402 return item;
403 }
404
405 private void sendPurchasePluginResult(PluginResult result) {
406 if (purchaseUpdated != null) {

Callers 2

onPurchasesUpdatedMethod · 0.95

Calls 1

putMethod · 0.80

Tested by

no test coverage detected