Add ChooseTransferAccountPage and allow selecting accounts for wallet transfer#7200
Conversation
|
I didn't do these steps
I used MenuItem directly as there was no need to add Popover and disabled the add Payment method button from the paymentMethodList via a prop. There was no new logic needed for the SelectablePaymentMethodList so I used passed the props to filter the list and show the checkboxes. I don't see any other way of creating a component from |
|
cc: @marcaaron |
|
Updated. |
stitesExpensify
left a comment
There was a problem hiding this comment.
Testing went pretty well, it's looking good! One bug I found was that when you click add debit card, it always sends you to the add bank account page
|
Updated @stitesExpensify @marcaaron . |
stitesExpensify
left a comment
There was a problem hiding this comment.
Code looks pretty good to me. I found 2 more bugs while testing though.
- If you have 2 accounts and go to the transfer page, then click the ACH button, neither account is selected even though one was selected on the main page
- If you have a debit card set as your default, it is not shown on the main transfer page
|
How can I set the default Payment Method? @stitesExpensify |
|
The You can substitute the |
|
Ok. Fixed both issues.
Updated. cc: @stitesExpensify |
|
I'm still running into some issues while testing. Debit cards seem to work, but if I make a bank account my default the selected account won't change 2022-01-18_18-06-34.mp4 |
|
Interesting issue. I can't think of the reason why this is happening but I have two accounts now and I will try to test it. |
|
Finally, fixed. Thanks for catching these issues. I was doing the wrong matching to get the SelectedAccount. It was picking the Defaultaccount if that comes before in the position the selected account in the payment method Array. Took me some time to figure it out. Lesson learned: Always criticize your own code. Ready for review @marcaaron @stitesExpensify |
|
This is ready @marcaaron @stitesExpensify . Sorry for the ping. |
|
No worries, but there are guidelines here about when it is appropriate to ping if you need a reminder. |
marcaaron
left a comment
There was a problem hiding this comment.
Approving since the code is acceptable. Left some non blocking comments and ideas for improvements that can potentially be addressed in follow ups.
| : account.fundID, | ||
| ); | ||
| Navigation.navigate(ROUTES.SETTINGS_PAYMENTS_TRANSFER_BALANCE); | ||
| }; |
There was a problem hiding this comment.
NAB, this method isn't using props so we are redeclaring it on every render. Not that this will make a huge difference performance-wise, but it feels like this is not the correct scope to declare it.
There was a problem hiding this comment.
Yeah, I agree but I didn't see any example of such a functional component. Where should I move this. Outside the component in the same file?
There was a problem hiding this comment.
Yeah outside the component in the same file would work. Also maybe a good sign that it should be an action instead of a component method.
| ? account.bankAccountID | ||
| : account.fundID, | ||
| ); | ||
| Navigation.navigate(ROUTES.SETTINGS_PAYMENTS_TRANSFER_BALANCE); |
There was a problem hiding this comment.
If we are going back can we just do Navigation.goBack() ?
There was a problem hiding this comment.
Whatever we do maybe it should be consistent because we are using Navigation.goBack() here
| shouldShowSelectedState | ||
| filterType={props.walletTransfer.filterPaymentMethodType} | ||
| selectedMethodID={props.walletTransfer.selectedAccountID} | ||
| shouldShowAddPaymentMethodButton={false} |
There was a problem hiding this comment.
NAB, but it would be better to eventually find the case where we DO want to show an add payment method button and show one next to the list instead of inside of it. Now we have this list that must specify "no thanks, I don't need this". And in this case we just shows a very similar button below which could be confusing.
Maybe a good follow up issue to create and have someone fix up.
There was a problem hiding this comment.
Yeah, I was thinking th same but then it would unnecessary refactor for this PR so I left it as it is.
| PaymentMethods.saveWalletTransferAccountTypeAndID( | ||
| selectedAccount.accountType, | ||
| selectedAccount.methodID, | ||
| ); |
There was a problem hiding this comment.
NAB, the more I look at this the more wrong it seems. We are saving data that can be derived from looking at other data and just sort of seems like stuff this component shouldn't be responsible for.
Maybe it says "when I am first loaded then set the most likely default payment method", but I don't think it would be this component's responsibility to filter everything.
There was a problem hiding this comment.
Yeah that is true. Let me see if I can clean this up bit.
| } | ||
|
|
||
| render() { | ||
| const selectedAccount = this.getSelectedPaymentMethodAccount(); |
There was a problem hiding this comment.
NAB, feels like we are unnecessarily filtering through all the payment methods to derive this and giving a lot of responsibility to this component.
There was a problem hiding this comment.
e.g. if we are initializing the payment method type in walletTransfer. accountType and it is based on the value in getSelectedPaymentMethodAccount() then we should be able to just look in walletTransfer? Or no?
There was a problem hiding this comment.
When we come back from Choose Transfer Account screen. This helps in picking the selected method. Either we should do that in componentDidUpdate or here.
There was a problem hiding this comment.
Yeah I'm not sure that's easy to see or why that would be the case. It maybe works, but the whole interaction between the different sets of data and why we are filtering them on every render is confusing.
stitesExpensify
left a comment
There was a problem hiding this comment.
Code looks good, and it tests well! Nice job 😄
|
✋ 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 @stitesExpensify in version: 1.1.32-1 🚀
|
|
🚀 Deployed to production by @roryabraham in version: 1.1.33-3 🚀
|


Details
Fixed Issues
$ #3922
Tests | QA Steps
Open Payments page.
Click TransferBalance Link.
Confirm that the transfer button is disabled if the following conditions are true.
i. Transfer Amount is less than $ 0.30.
ii. Which Account is not selected.
Click instant Mode.
It should take you to the new page where you will select an account. This page should show you Debit cards only and Add Debit Card Button.
Clicking
+ Add Debit CardButton opens a new page to add Debit Card.From the Select Account page, click on the any debit card.
You should be taken to the old page where you can see the selected debit card as
Which account?If your balance is > Fee then
TransferButton should be active and it should show the transfer amount - fee.Click 1-3 Business Days Mode.
It should take you to the new page where you will select an account. This page should show you Bank Accounts only and Add bank account Button.
Clicking
+ Add bank AccountButton opens a new page to add bank Account.From the Select Account page, click on any bank account.
You should be taken to the old page where you can see the selected bank account card as
Which account?If your balance is > Fee then
TransferButton should be active and it should show the transfer amount - fee.If your balance is > Fee and which account is set.
i. Click Transfer button.
ii. Now you should be taken to the Payments Page and a confirm modal should be shown.
Tested On
Screenshots
Web | Desktop
output_file.mp4
Mobile Web
iOS
Android