[PAY-1954] Loading User Settings And Cancelling Payment Sheet
📲 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
...coming...
👀 See
Trello, screenshots, external resources?
| Before 🐛 | After 🦋 |
|---|---|
✅ Acceptance criteria
- [x] Add new card shows a loading state before and after the payment sheet appears.
- [x] Before payment sheet appears the loading state and appearance of the payment sheet can be cancelled by another user action (ie. Edit, delete of a card).
⏰ TODO
- [x] Add loading state to "Add new card"
- [ ] Write tests.