Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Finish Migration to new Android Billing Client Library
- Loading branch information
1 parent
ede49ec
commit 6899f2a
Showing
16 changed files
with
5,473 additions
and
2,809 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/InAppBillingTests/InAppBillingTests.Android/Properties/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.InAppBillingTests"> | ||
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28" /> | ||
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="29" /> | ||
<application android:label="InAppBillingTests.Android"></application> | ||
</manifest> |
7,297 changes: 5,239 additions & 2,058 deletions
7,297
src/InAppBillingTests/InAppBillingTests.Android/Resources/Resource.designer.cs
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using System; | ||
using Android.BillingClient.Api; | ||
|
||
namespace Plugin.InAppBilling | ||
{ | ||
public static class Converters | ||
{ | ||
public static InAppBillingPurchase ToIABPurchase(this Purchase purchase) | ||
{ | ||
var finalPurchase = new InAppBillingPurchase | ||
{ | ||
AutoRenewing = purchase.IsAutoRenewing, | ||
ConsumptionState = ConsumptionState.NoYetConsumed, | ||
Id = purchase.OrderId, | ||
IsAcknowledged = purchase.IsAcknowledged, | ||
Payload = purchase.DeveloperPayload, | ||
ProductId = purchase.Sku, | ||
PurchaseToken = purchase.PurchaseToken, | ||
TransactionDateUtc = DateTimeOffset.FromUnixTimeMilliseconds(purchase.PurchaseTime).DateTime | ||
}; | ||
|
||
finalPurchase.State = purchase.PurchaseState switch | ||
{ | ||
Android.BillingClient.Api.PurchaseState.Pending => PurchaseState.PaymentPending, | ||
Android.BillingClient.Api.PurchaseState.Purchased => PurchaseState.Purchased, | ||
_ => PurchaseState.Unknown | ||
}; | ||
return finalPurchase; | ||
} | ||
} | ||
} |
Oops, something went wrong.