Skip to content

Commit

Permalink
Updates for v6
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmontemagno committed May 31, 2023
1 parent c13b7c9 commit 4348a8f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Plugin.InAppBilling/InAppBilling.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Android.BillingClient.Api;
using Android.Content;
using static Android.BillingClient.Api.BillingClient;
using BillingResponseCode = Android.BillingClient.Api.BillingResponseCode;
#if NET
using Microsoft.Maui.ApplicationModel;
#else
Expand Down Expand Up @@ -182,7 +183,8 @@ public override async Task<IEnumerable<InAppBillingPurchase>> GetPurchasesAsync(
_ => ProductType.Subs
};

var purchasesResult = await BillingClient.QueryPurchasesAsync(QueryPurchasesParams.NewBuilder().SetProductType(skuType).Build());
var query = QueryPurchasesParams.NewBuilder().SetProductType(skuType).Build();
var purchasesResult = await BillingClient.QueryPurchasesAsync(query);

ParseBillingResult(purchasesResult.Result);

Expand Down Expand Up @@ -271,9 +273,10 @@ async Task<InAppBillingPurchase> UpgradePurchasedSubscriptionInternalAsync(strin
.SetOldPurchaseToken(purchaseTokenOfOriginalSubscription)
.SetReplaceProrationMode((int)prorationMode)
.Build();

var prodDetailsParams = BillingFlowParams.ProductDetailsParams.NewBuilder()
.SetProductDetails(skuDetails)
.SetOfferToken(skuDetails.GetSubscriptionOfferDetails()?.FirstOrDefault()?.OfferToken)
.Build();

var flowParams = BillingFlowParams.NewBuilder()
Expand Down

0 comments on commit 4348a8f

Please sign in to comment.