-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #61 from cb-amutha/feature/restore_purchase
[Feature] Restore Purchases
- Loading branch information
Showing
20 changed files
with
423 additions
and
29 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
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
38 changes: 38 additions & 0 deletions
38
android/src/main/kotlin/com/chargebee/flutter/sdk/CBNativeError.kt
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,38 @@ | ||
package com.chargebee.flutter.sdk | ||
|
||
import com.android.billingclient.api.BillingClient | ||
|
||
enum class CBNativeError(val code: Int) { | ||
// Restore Error | ||
SERVICE_TIMEOUT(2014), | ||
FEATURE_NOT_SUPPORTED(2015), | ||
SERVICE_UNAVAILABLE(2016), | ||
DEVELOPER_ERROR(2017), | ||
ERROR(2018), | ||
SERVICE_DISCONNECTED(2019), | ||
USER_CANCELED(2020), | ||
BILLING_UNAVAILABLE(2021), | ||
ITEM_UNAVAILABLE(2022), | ||
ITEM_NOT_OWNED(2023), | ||
ITEM_ALREADY_OWNED(2024), | ||
UNKNOWN(0); | ||
|
||
companion object { | ||
fun billingResponseCode(code: Int): CBNativeError { | ||
return when (code) { | ||
BillingClient.BillingResponseCode.SERVICE_TIMEOUT -> SERVICE_TIMEOUT | ||
BillingClient.BillingResponseCode.FEATURE_NOT_SUPPORTED -> FEATURE_NOT_SUPPORTED | ||
BillingClient.BillingResponseCode.SERVICE_UNAVAILABLE -> SERVICE_UNAVAILABLE | ||
BillingClient.BillingResponseCode.DEVELOPER_ERROR -> DEVELOPER_ERROR | ||
BillingClient.BillingResponseCode.ERROR -> ERROR | ||
BillingClient.BillingResponseCode.SERVICE_DISCONNECTED -> SERVICE_DISCONNECTED | ||
BillingClient.BillingResponseCode.USER_CANCELED -> USER_CANCELED | ||
BillingClient.BillingResponseCode.BILLING_UNAVAILABLE -> BILLING_UNAVAILABLE | ||
BillingClient.BillingResponseCode.ITEM_UNAVAILABLE -> ITEM_UNAVAILABLE | ||
BillingClient.BillingResponseCode.ITEM_NOT_OWNED -> ITEM_NOT_OWNED | ||
BillingClient.BillingResponseCode.ITEM_ALREADY_OWNED -> ITEM_ALREADY_OWNED | ||
else -> UNKNOWN | ||
} | ||
} | ||
} | ||
} |
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,33 @@ | ||
{ | ||
"identifier" : "393F510B", | ||
"nonRenewingSubscriptions" : [ | ||
{ | ||
"displayPrice" : "0.99", | ||
"familyShareable" : false, | ||
"internalID" : "0F260BA9", | ||
"localizations" : [ | ||
{ | ||
"description" : "", | ||
"displayName" : "", | ||
"locale" : "en_US" | ||
} | ||
], | ||
"productID" : "com.temporary.id", | ||
"referenceName" : "Testing", | ||
"type" : "NonRenewingSubscription" | ||
} | ||
], | ||
"products" : [ | ||
|
||
], | ||
"settings" : { | ||
|
||
}, | ||
"subscriptionGroups" : [ | ||
|
||
], | ||
"version" : { | ||
"major" : 1, | ||
"minor" : 1 | ||
} | ||
} |
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
Oops, something went wrong.