-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Initial Setup for wallet Transfer #6852
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
Merged
marcaaron
merged 8 commits into
Expensify:main
from
parasharrajat:trans-amount-scaffold
Dec 21, 2021
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
881d7be
Add icons
parasharrajat c29736a
add routes
parasharrajat e71e8b5
Scaffold the transfer wallet balance logic
parasharrajat fa88d6d
refactor PaymentMethod list
parasharrajat 98b569a
fix issues and link Transfer walltet balance page with PaymentsPage
parasharrajat 16088b6
Remove extra data from paymentMethods object & fix routes
parasharrajat d1143f3
Merge branch 'main' of github.com:Expensify/Expensify.cash into trans…
parasharrajat 30688a9
hide the transfer page until ready
parasharrajat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| import _ from 'underscore'; | ||
| import lodashGet from 'lodash/get'; | ||
| import * as Expensicons from '../components/Icon/Expensicons'; | ||
| import getBankIcon from '../components/Icon/BankIcons'; | ||
| import CONST from '../CONST'; | ||
| import * as Localize from './Localize'; | ||
|
|
||
| /** | ||
| * Get the PaymentMethods list | ||
| * @param {Array} bankAccountList | ||
| * @param {Array} cardList | ||
| * @param {String} [payPalMeUsername=''] | ||
| * @returns {Array<PaymentMethod>} | ||
| */ | ||
| function getPaymentMethods(bankAccountList, cardList, payPalMeUsername = '') { | ||
| const combinedPaymentMethods = []; | ||
|
|
||
| _.each(bankAccountList, (bankAccount) => { | ||
| // Add all bank accounts besides the wallet | ||
| if (bankAccount.type === CONST.BANK_ACCOUNT_TYPES.WALLET) { | ||
| return; | ||
| } | ||
|
|
||
| const formattedBankAccountNumber = bankAccount.accountNumber | ||
| ? `${Localize.translateLocal('paymentMethodList.accountLastFour')} ${bankAccount.accountNumber.slice(-4) | ||
| }` | ||
| : null; | ||
| const {icon, iconSize} = getBankIcon(lodashGet(bankAccount, 'additionalData.bankName', '')); | ||
| combinedPaymentMethods.push({ | ||
| title: bankAccount.addressName, | ||
| description: formattedBankAccountNumber, | ||
| methodID: bankAccount.bankAccountID, | ||
| icon, | ||
| iconSize, | ||
| key: `bankAccount-${bankAccount.bankAccountID}`, | ||
| }); | ||
| }); | ||
|
|
||
| _.each(cardList, (card) => { | ||
| const formattedCardNumber = card.cardNumber | ||
| ? `${Localize.translateLocal('paymentMethodList.cardLastFour')} ${card.cardNumber.slice(-4)}` | ||
| : null; | ||
| const {icon, iconSize} = getBankIcon(card.bank, true); | ||
| combinedPaymentMethods.push({ | ||
| title: card.addressName, | ||
| description: formattedCardNumber, | ||
| methodID: card.cardNumber, | ||
|
marcaaron marked this conversation as resolved.
|
||
| icon, | ||
| iconSize, | ||
| key: `card-${card.cardNumber}`, | ||
| }); | ||
| }); | ||
|
|
||
| if (payPalMeUsername) { | ||
| combinedPaymentMethods.push({ | ||
| title: 'PayPal.me', | ||
| methodID: CONST.PAYMENT_METHODS.PAYPAL, | ||
|
marcaaron marked this conversation as resolved.
|
||
| description: payPalMeUsername, | ||
| icon: Expensicons.PayPal, | ||
| key: 'payPalMePaymentMethod', | ||
| }); | ||
| } | ||
|
|
||
| return combinedPaymentMethods; | ||
| } | ||
|
|
||
| export default { | ||
| getPaymentMethods, | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import React from 'react'; | ||
| import HeaderWithCloseButton from '../../../components/HeaderWithCloseButton'; | ||
| import ScreenWrapper from '../../../components/ScreenWrapper'; | ||
| import Navigation from '../../../libs/Navigation/Navigation'; | ||
| import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize'; | ||
| import KeyboardAvoidingView from '../../../components/KeyboardAvoidingView'; | ||
|
|
||
| const propTypes = { | ||
| ...withLocalizePropTypes, | ||
| }; | ||
|
|
||
| const ChooseTransferAccountPage = props => ( | ||
| <ScreenWrapper> | ||
| <KeyboardAvoidingView> | ||
| <HeaderWithCloseButton | ||
| title={props.translate('chooseTransferAccountPage.chooseAccount')} | ||
| shouldShowBackButton | ||
| onBackButtonPress={() => Navigation.goBack()} | ||
| onCloseButtonPress={() => Navigation.dismissModal()} | ||
| /> | ||
| </KeyboardAvoidingView> | ||
| </ScreenWrapper> | ||
| ); | ||
|
|
||
| ChooseTransferAccountPage.propTypes = propTypes; | ||
|
|
||
| export default withLocalize(ChooseTransferAccountPage); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.