Skip to content

Add tiered subscriptions (intro offers) to Galaxy Store pricing phases#2954

Merged
fire-at-will merged 3 commits into
samsung-devfrom
include-intro-offers-in-pricing-phases
Dec 19, 2025
Merged

Add tiered subscriptions (intro offers) to Galaxy Store pricing phases#2954
fire-at-will merged 3 commits into
samsung-devfrom
include-intro-offers-in-pricing-phases

Conversation

@fire-at-will

Copy link
Copy Markdown
Contributor

Description

Adds support for including tiered subscription (intro offers) in GalaxySubscriptionOption's pricing phases

@fire-at-will fire-at-will requested a review from a team as a code owner December 18, 2025 18:52
@fire-at-will fire-at-will added the pr:feat A new feature label Dec 18, 2025
GalaxyStrings.PARSING_INTRO_PRICING_PHASES_FOR_SUBS_TIERED_PRICING_NOT_SUPPORTED
}
this.createFreeTrialPricingPhase()?.let { pricingPhases.addFirst(it) }
this.createFreeTrialPricingPhase()?.let { pricingPhases.add(it) }

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replacing addFirst with add to avoid some Android OS level availability requirements


private fun ProductVo.createPrice(): Price =
Price(
private fun ProductVo.createTieredSubscriptionPricingPhase(): PricingPhase? {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extracted the price creation logic from ProductVo.createPrice() to createPriceFromGalaxyData()` so it can be reused


@SuppressWarnings("MagicNumber", "ReturnCount")
private fun ProductVo.createPeriod(): Period? {
private fun ProductVo.createPeriod(): Period? = createPeriodFromGalaxyData(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extracted the period creation logic from ProductVo.createPeriod() to createPeriodFromGalaxyData()` so it can be reused

@tonidero tonidero left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! just a comment on something I think we should fix, but could be done in a separate PR

// Here, we manually build the formatted string instead of using ProductVo.itemPriceString
// because itemPriceString doesn't include the decimal values if the amount is an integer with no decimal value.
// This way, we can get strings like "$3.00" instead of "$3"
formatted = "%s%.2f".format(currencyUnit, itemPrice),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed this in previous PRs.... But I think we should use itemPriceString if available? Note that there are currencies where there are no cents or that it's preferred to show the price without cents when it's a whole number. We could try to handle it ourselves, but I would probably default to what the Galaxy store provides normally.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that makes sense! Updated to use itemPriceString in 9992e97

@fire-at-will fire-at-will merged commit 0220203 into samsung-dev Dec 19, 2025
0 of 2 checks passed
@fire-at-will fire-at-will deleted the include-intro-offers-in-pricing-phases branch December 19, 2025 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr:feat A new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants