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

Commit 2512a0b

Browse files
committed
Docs and comments
1 parent c2557b0 commit 2512a0b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/MethodCallHandlerImpl.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,8 @@ private void queryPurchasesAsync(String skuType, MethodChannel.Result result) {
314314
public void onQueryPurchasesResponse(
315315
BillingResult billingResult, List<Purchase> purchasesList) {
316316
final Map<String, Object> serialized = new HashMap<>();
317-
// The response code is no longer passed, as part of billing 4.1.0, so we pass OK here.
317+
// The response code is no longer passed, as part of billing 4.0, so we pass OK here
318+
// as success is implied by calling this callback.
318319
serialized.put("responseCode", BillingClient.BillingResponseCode.OK);
319320
serialized.put("billingResult", Translator.fromBillingResult(billingResult));
320321
serialized.put(

packages/in_app_purchase/in_app_purchase_android/android/src/main/java/io/flutter/plugins/inapppurchase/Translator.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ static HashMap<String, Object> fromPurchase(Purchase purchase) {
6161
info.put("purchaseTime", purchase.getPurchaseTime());
6262
info.put("purchaseToken", purchase.getPurchaseToken());
6363
info.put("signature", purchase.getSignature());
64+
// TODO(garyq): Remove deprecated `sku`.
65+
// `sku` was deprecated in billion 4.0, but we cannot directly remove it from our
66+
// API instantly. Thus, for backwards compatibility, we pass the first sku here
67+
// and include the rest of the list under `skus`.
6468
if (!skus.isEmpty()) {
6569
info.put("sku", skus.get(0));
6670
}
@@ -86,6 +90,10 @@ static HashMap<String, Object> fromPurchaseHistoryRecord(
8690
info.put("purchaseTime", purchaseHistoryRecord.getPurchaseTime());
8791
info.put("purchaseToken", purchaseHistoryRecord.getPurchaseToken());
8892
info.put("signature", purchaseHistoryRecord.getSignature());
93+
// TODO(garyq): Remove deprecated `sku`.
94+
// `sku` was deprecated in billion 4.0, but we cannot directly remove it from our
95+
// API instantly. Thus, for backwards compatibility, we pass the first sku here
96+
// and include the rest of the list under `skus`.
8997
if (!skus.isEmpty()) {
9098
info.put("sku", skus.get(0));
9199
}

0 commit comments

Comments
 (0)