Skip to content

Commit

Permalink
Upgrade to latest nugets and fix up UWP
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmontemagno committed Jul 23, 2020
1 parent 143bc2a commit ffb0288
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="4.7.0.968" />
<PackageReference Include="Xamarin.Forms" Version="4.7.0.1179" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainActivity.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
<PackageReference Include="System.ValueTuple">
<Version>4.5.0</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="4.2.0.848062" />
<PackageReference Include="Xamarin.Forms" Version="4.7.0.1179" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.1.5" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
<PackageReference Include="System.ValueTuple">
<Version>4.5.0</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="4.7.0.968" />
<PackageReference Include="Xamarin.Forms" Version="4.7.0.1179" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\iOS\Xamarin.iOS.CSharp.targets" />
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<ItemGroup>
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="Xamarin.Forms" Version="4.7.0.968" />
<PackageReference Include="Xamarin.Forms" Version="4.7.0.1179" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions src/Plugin.InAppBilling/InAppBilling.android.cs
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,10 @@ public static string TransformString(string key, int i)
return new string(chars);
}

#pragma warning disable IDE1006 // Naming Styles
const string KeyFactoryAlgorithm = "RSA";
const string SignatureAlgorithm = "SHA1withRSA";
#pragma warning restore IDE1006 // Naming Styles

}
}
Expand Down
19 changes: 5 additions & 14 deletions src/Plugin.InAppBilling/InAppBilling.uwp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public async override Task<IEnumerable<InAppBillingProduct>> GetProductInfoAsync
return products;
}

protected async override Task<IEnumerable<InAppBillingPurchase>> GetPurchasesAsync(ItemType itemType, IInAppBillingVerifyPurchase verifyPurchase, string verifyOnlyProductId)
public async override Task<IEnumerable<InAppBillingPurchase>> GetPurchasesAsync(ItemType itemType)
{
// Get list of product receipts from store or simulator
var xmlReceipt = await CurrentAppMock.GetAppReceiptAsync(InTestingMode);
Expand All @@ -76,7 +76,7 @@ protected async override Task<IEnumerable<InAppBillingPurchase>> GetPurchasesAsy
/// <param name="verifyPurchase">Verify purchase implementation</param>
/// <returns></returns>
/// <exception cref="InAppBillingPurchaseException">If an error occurs during processing</exception>
public async override Task<InAppBillingPurchase> PurchaseAsync(string productId, ItemType itemType, string payload, IInAppBillingVerifyPurchase verifyPurchase = null)
public async override Task<InAppBillingPurchase> PurchaseAsync(string productId, ItemType itemType, IInAppBillingVerifyPurchase verifyPurchase = null)
{
// Get purchase result from store or simulator
var purchaseResult = await CurrentAppMock.RequestProductPurchaseAsync(InTestingMode, productId);
Expand All @@ -100,7 +100,7 @@ public async override Task<InAppBillingPurchase> PurchaseAsync(string productId,
/// <param name="purchaseToken">Original Purchase Token</param>
/// <returns>If consumed successful</returns>
/// <exception cref="InAppBillingPurchaseException">If an error occures during processing</exception>
public async override Task<InAppBillingPurchase> ConsumePurchaseAsync(string productId, string purchaseToken)
public async override Task<bool> ConsumePurchaseAsync(string productId, string purchaseToken)
{
var result = await CurrentAppMock.ReportConsumableFulfillmentAsync(InTestingMode, productId, new Guid(purchaseToken));
switch(result)
Expand All @@ -113,18 +113,9 @@ public async override Task<InAppBillingPurchase> ConsumePurchaseAsync(string pro
case FulfillmentResult.PurchaseReverted:
throw new InAppBillingPurchaseException(PurchaseError.GeneralError);
case FulfillmentResult.Succeeded:
return new InAppBillingPurchase
{
Id = purchaseToken,
AutoRenewing = false,
Payload = string.Empty,
PurchaseToken = purchaseToken,
ProductId = productId,
State = PurchaseState.Purchased,
TransactionDateUtc = DateTime.UtcNow
};
return true;
default:
return null;
return false;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Plugin.InAppBilling/Plugin.InAppBilling.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<Compile Include="**\*.android.cs" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
<PackageReference Include="Xamarin.Android.Google.BillingClient" Version="2.2.1" />
<PackageReference Include="Xamarin.Android.Google.BillingClient" Version="3.0.0" />
</ItemGroup>

<ItemGroup Condition=" $(TargetFramework.StartsWith('Xamarin.iOS')) ">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class InAppBillingProduct
/// <summary>
/// Number of subscription billing periods for which the user will be given the introductory price, such as 3
/// </summary>
public string IntroductoryPriceCycles { get; set; }
public int IntroductoryPriceCycles { get; set; }

/// <summary>
/// Billing period of the introductory price, specified in ISO 8601 format
Expand Down

0 comments on commit ffb0288

Please sign in to comment.