Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Docs and comments
  • Loading branch information
GaryQian committed Jul 7, 2022
commit 847b1dcd4a5350d5f69b6b22ca3a96aaed2ed365
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()) {
Copy link
Contributor

@cyanglaz cyanglaz Jul 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be easier to cleanup later if we put this logic to the dart side.
Then we don't have to cleanup the java code when we remove .sku.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, makes sense, I'll do that

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