[WEB-4279] Discount line items in native wallets#905
Merged
Conversation
94864d1 to
b98cf35
Compare
b98cf35 to
f7c1e25
Compare
c95f724 to
f0d1c08
Compare
4b28bc3 to
199971b
Compare
dfae563 to
2fc7e4e
Compare
910863e to
1c6bf2f
Compare
da473ab to
1f3a50a
Compare
vicfergar
approved these changes
Jun 8, 2026
Contributor
|
LGTM, although I wasn’t able to test it on an iPhone. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 717afe2. Configure here.
RCGitBot
added a commit
that referenced
this pull request
Jun 16, 2026
**This is an automatic release.** ## RevenueCat SDK ### ✨ New Features * Add Slovenian support for paywalls (#932) via Monika Mateska (@MonikaMateska) * [WEB-4279] Discount line items in native wallets (#905) via James O'Donnell (@james-od) ## RevenueCatUI SDK ### ✨ New Features * WFL-217 | Add support for workflows endpoints (#913) via Rosie Watson (@RosieWatson) ### 🔄 Other Changes * [AUTOMATIC] Update generated error codes (#931) via RevenueCat Git Bot (@RCGitBot) * Danger: block manual edits to generated error codes (#930) via Álvaro Brey (@AlvaroBrey) * Add update-error-codes workflow (#926) via Álvaro Brey (@AlvaroBrey) * test(e2e): add full Paddle E2E coverage to webbilling-demo (WST-564) (#925) via Roger Solé (@rogersole) <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Version and changelog-only changes with no runtime logic modified in this PR. > > **Overview** > **Automatic release** that publishes **1.43.0** by aligning version metadata everywhere it is duplicated: `.version`, `package.json`, `src/helpers/constants.ts`, and the docs redirect in `scripts/docs/index.html` (1.42.4 → 1.43.0). > > `CHANGELOG.md` and `CHANGELOG.latest.md` are updated to document what ships in this release (already merged elsewhere): **Slovenian paywall locale**, **discount line items in native wallets**, **RevenueCatUI workflows endpoints**, regenerated error codes plus CI/Danger guardrails, and expanded Paddle E2E coverage in webbilling-demo. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit ef5e9f3. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Motivation / Description
This PR adds
lineItemsto the Native Wallet UIs.We intentionally do not add the
trialBilling/regularBillingfields to the Apple Pay box, like we do for free trials, due to complexity in ensuring we show the exactly correct start/end dates for the discount applying. This can be added in a follow up.It's worth noting that while this PR is large this is mostly tests+refactoring. The core concept is really just passing through the values and strings to the Express Checkout that we already determine equivalently in the pricing table in the base checkout.
I extracted a src/helpers/discount-breakdown-helper.ts util to share a common source for determining the line item values in the RC checkout line items and in the Wallet line items.
Note: On the changed stories - I think these are fine in that no localisation is better than bad localisation.
Note: If a reviewer has an iPhone I'd love to confirm that everything looks good with Apple Pay and taxes enabled in the line items. I wasn't able to get this tested locally.
Loom: https://www.loom.com/share/7f48c3beac9d4a659e5ab69b5d0c7299
Changes introduced
Linear ticket (if any)
Additional comments
Note
Medium Risk
Touches checkout wallet pricing and amount math; incorrect line-item totals can cause Stripe to drop items silently, though tests assert balancing.
Overview
Adds discount breakdown line items to Apple Pay / Google Pay (Stripe Express Checkout) so wallet UIs show product + discount rows that match the RC pricing table.
Introduces
discount-breakdown-helperto compute amount, display name, suffix (e.g.20% off for 3 months), and label from purchase-option discounts or applied promo codes.pricing-tableandproduct-infonow take a precomputedresolvedDiscountinstead of duplicating suffix/amount logic.StripeServicebuilds balancedlineItems(subtotal + negative discount) when a discount exists; subscription express options still use Apple Pay recurring/trial billing without discount-specific recurring fields.buildStripeExpressCheckoutOptionsForNonSubscriptionis new, and express purchase / payment entry wireresolvedDiscountfor both subscriptions and consumables. Wallet click resolve now passeslineItemsalongside Apple Pay config.Reviewed by Cursor Bugbot for commit 5baa600. Bugbot is set up for automated code reviews on this repo. Configure here.