Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Docs and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
GaryQian committed Jun 9, 2022
1 parent c2557b0 commit 2512a0b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@ private void queryPurchasesAsync(String skuType, MethodChannel.Result result) {
public void onQueryPurchasesResponse(
BillingResult billingResult, List<Purchase> purchasesList) {
final Map<String, Object> serialized = new HashMap<>();
// The response code is no longer passed, as part of billing 4.1.0, so we pass OK here.
// The response code is no longer passed, as part of billing 4.0, so we pass OK here
// as success is implied by calling this callback.
serialized.put("responseCode", BillingClient.BillingResponseCode.OK);
serialized.put("billingResult", Translator.fromBillingResult(billingResult));
serialized.put(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ static HashMap<String, Object> fromPurchase(Purchase purchase) {
info.put("purchaseTime", purchase.getPurchaseTime());
info.put("purchaseToken", purchase.getPurchaseToken());
info.put("signature", purchase.getSignature());
// TODO(garyq): Remove deprecated `sku`.
// `sku` was deprecated in billion 4.0, but we cannot directly remove it from our
// API instantly. Thus, for backwards compatibility, we pass the first sku here
// and include the rest of the list under `skus`.
if (!skus.isEmpty()) {
info.put("sku", skus.get(0));
}
Expand All @@ -86,6 +90,10 @@ static HashMap<String, Object> fromPurchaseHistoryRecord(
info.put("purchaseTime", purchaseHistoryRecord.getPurchaseTime());
info.put("purchaseToken", purchaseHistoryRecord.getPurchaseToken());
info.put("signature", purchaseHistoryRecord.getSignature());
// TODO(garyq): Remove deprecated `sku`.
// `sku` was deprecated in billion 4.0, but we cannot directly remove it from our
// API instantly. Thus, for backwards compatibility, we pass the first sku here
// and include the rest of the list under `skus`.
if (!skus.isEmpty()) {
info.put("sku", skus.get(0));
}
Expand Down

0 comments on commit 2512a0b

Please sign in to comment.