Skip to content
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

MBL-1744: Refactor Fix Pledge Flow #2142

Merged
merged 9 commits into from
Oct 7, 2024
Merged

MBL-1744: Refactor Fix Pledge Flow #2142

merged 9 commits into from
Oct 7, 2024

Conversation

Arkariang
Copy link
Contributor

@Arkariang Arkariang commented Oct 2, 2024

📲 What

Refactor of Fix Pledge flow

🤔 Why

  • Fix pledge flow is protected by feature flag, if feature flag enabled will load CrowdfundCheckoutFragment/Viewmodel, if feature flag is off will still use PledgeFragment/Viewmodel
  • Deprecating old PledgeFragment/Viewmodel
  • After reunifying checkout flows (crowdfund + late pledges) the only missing piece was fix-pledge
  • Fix pledge flow was likely broken on PledgeFragmentViewModel

🛠 How

  • Brought Fix pledge flow to CrowdfundViewModel
  • UpdateBacking mutation only receives paymentSourceId when fixing a pledge.

👀 See

  • On the video you can see how attempting the failing card will produce an error, but adding/selecting a new payment method will fix the state of the pledge
FixPledgeFlowWorking.mp4

| | |

📋 QA

  • In a test project pledge with stripe's test card 4000000000000341 then get the project to collect, (the card will fail due to insufficient funds), and fix pledge flow will be available.

Story 📖

MBL-1744

@@ -175,6 +176,9 @@ class ProjectPageActivity :
env
}

val ffClient = requireNotNull(environment?.featureFlagClient())
ffClient.activate(this)
Copy link
Contributor Author

@Arkariang Arkariang Oct 2, 2024

Choose a reason for hiding this comment

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

calling activate when the activity is loaded will minimize the fist installation gap when the information requested to firebase remote config has not yet been applied.

@codecov-commenter
Copy link

codecov-commenter commented Oct 2, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.50%. Comparing base (08e4f22) to head (acd096a).
Report is 1 commits behind head on master.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2142      +/-   ##
============================================
+ Coverage     67.48%   67.50%   +0.02%     
- Complexity     2221     2222       +1     
============================================
  Files           368      368              
  Lines         22889    22893       +4     
  Branches       3294     3294              
============================================
+ Hits          15446    15454       +8     
+ Misses         5689     5685       -4     
  Partials       1754     1754              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Arkariang Arkariang marked this pull request as ready for review October 3, 2024 16:21
@Arkariang Arkariang requested a review from mtgriego October 3, 2024 16:21
@Arkariang Arkariang self-assigned this Oct 3, 2024
@Arkariang Arkariang added the Pledge Redemption PRs related to Pledge Redemption 2024 label Oct 3, 2024
@@ -441,9 +446,14 @@ class CrowdfundCheckoutViewModel(val environment: Environment, bundle: Bundle? =
selectedPaymentMethod
)
}
PledgeReason.FIX_PLEDGE, // Managed on PledgeFragment/ViewModel
PledgeReason.FIX_PLEDGE -> {
// - Fix pledge should NOT send amounts/rewardId's/locationId ONLY selected paymentMethod
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

Copy link
Contributor

@leighdouglas leighdouglas left a comment

Choose a reason for hiding this comment

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

🎉

@Arkariang Arkariang merged commit b8f0062 into master Oct 7, 2024
3 checks passed
@Arkariang Arkariang deleted the imartin/MBL-1744 branch October 7, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pledge Redemption PRs related to Pledge Redemption 2024
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants