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
[PAY-1954] Loading User Settings And Cancelling Payment Sheet #1738
Conversation
Kickstarter-iOS/Features/PaymentMethods/Controller/PaymentMethodsViewController.swift
Show resolved
Hide resolved
Kickstarter-iOS/Features/PaymentMethods/Controller/PaymentMethodsViewController.swift
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## main #1738 +/- ##
==========================================
+ Coverage 85.35% 88.98% +3.62%
==========================================
Files 1275 881 -394
Lines 114938 79425 -35513
Branches 30377 20877 -9500
==========================================
- Hits 98110 70678 -27432
+ Misses 15776 8004 -7772
+ Partials 1052 743 -309
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
…y-1954/loading-user-settings
…ickstarter/ios-oss into pay-1954/loading-user-settings
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.
LGTM 👍
📲 What
Due to the time required to get a setup intent token and for show the payment sheet. Also after the payment sheet is dismissed there is a lag between showing the newly created payment method. That lag is caused by the network to create the new payment source. We might want to let the user know that their actions are being process via a "loading" state.
There's also the necessity to cancel the payment sheet, if its about to be presented but another user action occurs to cancel its appearance (ie. click on "Add new card", click on "Edit" while waiting for the sheet to be presented.)
🤔 Why
User should know that any action taken while loading the payment sheet, cancels its appearance.
User should also know any action taken to change the state of the page will cancel the sheet's appearance.
🛠 How
New output on
PaymentMethodsViewModel
cancelAddNewCardLoadingState
to inform thePaymentMethodsFooterView
through a new delegate that only cancels the loading state on that view.The view itself has a button that whenever clicked and the feature flag is on, will show the loading state.
In the view model, all actions that cancel the loading state on the view go through
shouldCancelPaymentSheetAppearance
to updatecancelAddNewCardLoadingState
if they aretrue
. And they aretrue
only when user clicks, Edit, deletes an existing card or the payment methods get updated.👀 See
Before 🐛
Simulator.Screen.Recording.-.iPhone.8.-.2022-09-22.at.16.10.01.mp4
After 🦋
Simulator.Screen.Recording.-.iPhone.8.-.2022-09-22.at.16.04.35.mp4
| | |
✅ Acceptance criteria
⏰ TODO