-
Notifications
You must be signed in to change notification settings - Fork 105
Unified StoreReplacementMode API #3234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
fire-at-will
wants to merge
40
commits into
main
Choose a base branch
from
shared-replacement-mode
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 35 commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
26157e8
add StoreReplacementMode + API tests
fire-at-will fe1db6e
add StoreReplacementMode -> store specific conversions + tests
fire-at-will 49a58cb
remove Product change
fire-at-will 6d3b024
remove GalaxyPurchasingData.Product api.txt change
fire-at-will 3039a06
add StoreReplacementMode to api.txts
fire-at-will 9a42704
add .replacementMode() to PurchaseParams
fire-at-will e1e2017
set PurchaseParams.googleReplacementMode when setting replacementMode
fire-at-will d067c44
detekt
fire-at-will bf8c82a
Merge branch 'main' into shared-replacement-mode
fire-at-will c302f2d
Merge branch 'main' into shared-replacement-mode
fire-at-will 8782fcb
galaxy-specific flow updates
fire-at-will 503e9e0
add unit tests for galaxy flow
fire-at-will ac40b0e
Update PurchasesOrchestrator.kt
fire-at-will 9666938
update PurchasesCommonTest
fire-at-will 4ecb493
Google -> StoreReplacementMode in play store flows
fire-at-will 3448485
detekt
fire-at-will 93e19aa
Merge branch 'main' into shared-replacement-mode
fire-at-will aabb558
update backend name generation to use StoreReplacementMode
fire-at-will da3dd6e
set replacementMode in PurchaseParams when providing googleReplacemen…
fire-at-will a98959f
make ReplacementModeSerializer use StoreReplacementMode
fire-at-will 7b76f17
update PurchaseParams public APIs
fire-at-will 1f08ad0
remove GalaxyReplacementMode
fire-at-will 8fd6aab
actually remove GalaxyReplacementMode
fire-at-will 0981b79
Merge branch 'main' into shared-replacement-mode
fire-at-will 0d1859f
deprecate GoogleReplacementMode
fire-at-will de85b71
migrate paywalls to use StoreReplacementMode
fire-at-will f0312d4
send replacement mode to handleReceipt() in galaxy flow
fire-at-will 28c8ac1
update paywall tests
fire-at-will 31a571f
docs updates
fire-at-will 266a2ba
default to WITHOUT_PRORATION in galaxy when it receives unsupported r…
fire-at-will 56356cd
update paywall docs
fire-at-will 8fb4f13
ReplacementMode serialization tweaks
fire-at-will a981323
centralize ReplacementMode mapping
fire-at-will 5948a18
detekt
fire-at-will 9993691
Merge branch 'main' into shared-replacement-mode
fire-at-will a7e0ef9
update PurchaseTester to use new replacementMode APIs
fire-at-will 987bc18
Update PurchaseParamsValidatorTest.kt
fire-at-will ff9863c
update api testers
fire-at-will 7985a60
update PurchaseTester to allow product changes on galaxy store
fire-at-will 065832a
Merge branch 'main' into shared-replacement-mode
fire-at-will File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
21 changes: 0 additions & 21 deletions
21
api-tester/src/main/java/com/revenuecat/apitester/kotlin/GalaxyReplacementModeAPI.kt
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
17 changes: 17 additions & 0 deletions
17
api-tester/src/main/java/com/revenuecat/apitester/kotlin/StoreReplacementModeAPI.kt
This file contains hidden or 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,17 @@ | ||
| package com.revenuecat.apitester.kotlin | ||
|
|
||
| import com.revenuecat.purchases.models.StoreReplacementMode | ||
|
|
||
| @Suppress("unused", "UNUSED_VARIABLE") | ||
| private class StoreReplacementModeAPI { | ||
| fun check(mode: StoreReplacementMode) { | ||
| when (mode) { | ||
| StoreReplacementMode.WITHOUT_PRORATION, | ||
| StoreReplacementMode.WITH_TIME_PRORATION, | ||
| StoreReplacementMode.CHARGE_FULL_PRICE, | ||
| StoreReplacementMode.CHARGE_PRORATED_PRICE, | ||
| StoreReplacementMode.DEFERRED, | ||
| -> {} | ||
| }.exhaustive | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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
15 changes: 0 additions & 15 deletions
15
...in/kotlin/com/revenuecat/purchases/galaxy/conversions/GalaxyReplacementModeConversions.kt
This file was deleted.
Oops, something went wrong.
30 changes: 30 additions & 0 deletions
30
...ain/kotlin/com/revenuecat/purchases/galaxy/conversions/StoreReplacementModeConversions.kt
This file contains hidden or 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,30 @@ | ||
| package com.revenuecat.purchases.galaxy.conversions | ||
|
|
||
| import com.revenuecat.purchases.PurchasesError | ||
| import com.revenuecat.purchases.PurchasesErrorCode | ||
| import com.revenuecat.purchases.PurchasesException | ||
| import com.revenuecat.purchases.galaxy.GalaxyStrings | ||
| import com.revenuecat.purchases.galaxy.logging.LogIntent | ||
| import com.revenuecat.purchases.galaxy.logging.log | ||
| import com.revenuecat.purchases.models.StoreReplacementMode | ||
| import com.samsung.android.sdk.iap.lib.constants.HelperDefine | ||
|
|
||
| @Throws(PurchasesException::class) | ||
| internal fun StoreReplacementMode.toGalaxyReplacementMode(): HelperDefine.ProrationMode { | ||
| return when (this) { | ||
| StoreReplacementMode.WITHOUT_PRORATION -> HelperDefine.ProrationMode.INSTANT_NO_PRORATION | ||
| StoreReplacementMode.WITH_TIME_PRORATION -> HelperDefine.ProrationMode.INSTANT_PRORATED_DATE | ||
| StoreReplacementMode.CHARGE_PRORATED_PRICE -> HelperDefine.ProrationMode.INSTANT_PRORATED_CHARGE | ||
| StoreReplacementMode.DEFERRED -> HelperDefine.ProrationMode.DEFERRED | ||
| StoreReplacementMode.CHARGE_FULL_PRICE -> { | ||
| val message = GalaxyStrings.CHARGE_FULL_PRICE_NOT_SUPPORTED | ||
| log(LogIntent.GALAXY_ERROR) { message } | ||
| throw PurchasesException( | ||
| PurchasesError( | ||
| PurchasesErrorCode.UnsupportedError, | ||
| message, | ||
| ), | ||
| ) | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If
StoreReplacementMode.CHARGE_FULL_PRICEis provided to the Galaxy store for a product change, we return an error, since there is no equivalent of this mode for the Galaxy Store.We could gracefully degrade to a default here, but I thought it might be best to fail since the request can't be executed as specified. What do y'all think?