[Home - For You] Tighten payment card required cases#84404
Conversation
|
🚧 @grgia has triggered a test Expensify/App build. You can view the workflow run here. |
This comment has been minimized.
This comment has been minimized.
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
trjExpensify
left a comment
There was a problem hiding this comment.
Discussing here, I'm not sure the team pricing check is the right one to suppress this time sensitive prompt. I think it's:
- Grandfathered users who are exempt from billing (NVP)
- Internal domains that are skipped in the billing logic (List of domains)
| @@ -594,6 +594,25 @@ function getSubscriptionPlanInfo( | |||
| }; | |||
| } | |||
|
|
|||
| function shouldShowTrialEndedUI( | |||
There was a problem hiding this comment.
Let's add tests for this util!
Reviewer Checklist
Screenshots/Videos |
|
LGTM! |
|
🎯 @ZhenjaHorbach, thanks for reviewing and testing this PR! 🎉 An E/App issue has been created to issue payment here: #84870. |
|
Is this still WIP or ready for review? |
|
Oh |
|
@ZhenjaHorbach good to go now, I'm just going to hold merging on web deploy |
|
JK its on staging now! |
|
Ready for review |
There was a problem hiding this comment.
Pull request overview
This PR tightens the conditions for showing the “Add Payment Card” time-sensitive offer on Home (and aligns the subscription banner logic) so it only appears for users who actually need to add a billing card—specifically targeting Team 2025 pricing and excluding grandfathered/internal/invoiced cases.
Changes:
- Gate the Home “Add payment card” offer behind Team 2025 pricing and a consolidated
shouldShowTrialEndedUI()decision helper. - Add
shouldShowTrialEndedUI()inSubscriptionUtilsand cover it with unit tests (owned paid policy, trial-ended, no card, not grandfathered/internal/invoicing). - Introduce Onyx/state plumbing for
isFromInternalDomainandnvp_private_grandfatheredFree, and use them in the UI decision.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/pages/home/TimeSensitiveSection/hooks/useTimeSensitiveOffers.ts |
Uses Team 2025 pricing + shouldShowTrialEndedUI() and new Onyx flags to decide whether to show the “Add payment card” offer. |
src/libs/SubscriptionUtils.ts |
Adds shouldShowTrialEndedUI() helper encapsulating trial-ended/banner eligibility checks. |
src/pages/settings/Subscription/CardSection/CardSection.tsx |
Aligns subscription banner display logic with shouldShowTrialEndedUI(). |
src/types/onyx/Account.ts |
Adds isFromInternalDomain to the Account Onyx type. |
src/selectors/Account.ts |
Adds isFromInternalDomainSelector for selector-based Onyx subscriptions. |
src/ONYXKEYS.ts |
Adds NVP_PRIVATE_GRANDFATHERED_FREE Onyx key and typing. |
tests/unit/hooks/useTimeSensitiveOffers.test.ts |
Updates hook tests to validate new add-payment-card gating and dependency call into shouldShowTrialEndedUI(). |
tests/unit/SubscriptionUtilsTest.ts |
Adds unit tests for shouldShowTrialEndedUI() across the key scenarios. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🚧 @Gonals has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/Gonals in version: 9.3.40-0 🚀
|
|
🚀 Deployed to staging by https://github.com/Gonals in version: 9.3.40-0 🚀
|



Explanation of Change
Only show the payment card time sensitive block to users on the new pricing plan.
https://expensify.slack.com/archives/C07HPDRELLD/p1772800036912489?thread_ts=1772658998.159109&cid=C07HPDRELLD
Confirmed no longer showing on my account:
Fixed Issues
$ #84767
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
QA Steps
1) Grandfathered user, trial ended, no payment card
Setup
Steps
Expected
2) New user, trial ended, no payment card
Setup
Steps
Expected
3) Any user, trial not ended
Setup
Steps
Expected
4) Any user, payment card already added
Setup
Steps
Expected
4) Any user, payment is via invoice feature
Setup
Steps
Expected
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari