diff --git a/src/CONST.ts b/src/CONST.ts index 762186439cec..93a17ac3c70d 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1026,7 +1026,6 @@ const CONST = { }, PAYMENT_METHODS: { - PAYPAL: 'payPalMe', DEBIT_CARD: 'debitCard', BANK_ACCOUNT: 'bankAccount', }, @@ -1042,7 +1041,6 @@ const CONST = { PAYMENT_TYPE: { ELSEWHERE: 'Elsewhere', EXPENSIFY: 'Expensify', - PAYPAL_ME: 'PayPal.me', VBBA: 'ACH', }, MONEY_REQUEST_TYPE: { @@ -1201,7 +1199,6 @@ const CONST = { CARD_NUMBER: /^[0-9]{15,16}$/, CARD_SECURITY_CODE: /^[0-9]{3,4}$/, CARD_EXPIRATION_DATE: /^(0[1-9]|1[0-2])([^0-9])?([0-9]{4}|([0-9]{2}))$/, - PAYPAL_ME_USERNAME: /^[a-zA-Z0-9]{1,20}$/, ROOM_NAME: /^#[a-z0-9à-ÿ-]{1,80}$/, // eslint-disable-next-line max-len, no-misleading-character-class @@ -2532,32 +2529,6 @@ const CONST = { SEARCH_ISSUES: 'https://github.com/Expensify/App/issues', }, - PAYPAL_SUPPORTED_CURRENCIES: [ - 'AUD', - 'BRL', - 'CAD', - 'CZK', - 'DKK', - 'EUR', - 'HKD', - 'HUF', - 'ILS', - 'JPY', - 'MYR', - 'MXN', - 'TWD', - 'NZD', - 'NOK', - 'PHP', - 'PLN', - 'GBP', - 'RUB', - 'SGD', - 'SEK', - 'CHF', - 'THB', - 'USD', - ], CONCIERGE_TRAVEL_URL: 'https://community.expensify.com/discussion/7066/introducing-concierge-travel', SCREEN_READER_STATES: { ALL: 'all', diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 80afc4d5ffee..b8f2f0a8a266 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -91,9 +91,6 @@ const ONYXKEYS = { SHOW_DOWNLOAD_APP_BANNER: 'showDownloadAppBanner', /** NVP keys - * Contains the user's payPalMe data */ - PAYPAL: 'paypal', - /** Contains the user preference for the LHN priority mode */ NVP_PRIORITY_MODE: 'nvp_priorityMode', @@ -284,7 +281,6 @@ const ONYXKEYS = { MONEY_REQUEST_AMOUNT_FORM: 'moneyRequestAmountForm', MONEY_REQUEST_DATE_FORM: 'moneyRequestCreatedForm', NEW_CONTACT_METHOD_FORM: 'newContactMethodForm', - PAYPAL_FORM: 'payPalForm', WAYPOINT_FORM: 'waypointForm', WAYPOINT_FORM_DRAFT: 'waypointFormDraft', SETTINGS_STATUS_SET_FORM: 'settingsStatusSetForm', @@ -328,7 +324,6 @@ type OnyxValues = { [ONYXKEYS.LOGIN_LIST]: OnyxTypes.Login; [ONYXKEYS.SESSION]: OnyxTypes.Session; [ONYXKEYS.BETAS]: OnyxTypes.Beta[]; - [ONYXKEYS.PAYPAL]: OnyxTypes.Paypal; [ONYXKEYS.NVP_PRIORITY_MODE]: ValueOf; [ONYXKEYS.NVP_BLOCKED_FROM_CONCIERGE]: OnyxTypes.BlockedFromConcierge; [ONYXKEYS.NVP_PRIVATE_PUSH_NOTIFICATION_ID]: string; @@ -420,7 +415,6 @@ type OnyxValues = { [ONYXKEYS.FORMS.MONEY_REQUEST_DATE_FORM]: OnyxTypes.Form; [ONYXKEYS.FORMS.MONEY_REQUEST_DATE_FORM]: OnyxTypes.Form; [ONYXKEYS.FORMS.NEW_CONTACT_METHOD_FORM]: OnyxTypes.Form; - [ONYXKEYS.FORMS.PAYPAL_FORM]: OnyxTypes.Form; [ONYXKEYS.FORMS.WAYPOINT_FORM]: OnyxTypes.Form; [ONYXKEYS.FORMS.WAYPOINT_FORM_DRAFT]: OnyxTypes.Form; [ONYXKEYS.FORMS.SETTINGS_STATUS_SET_FORM]: OnyxTypes.Form; diff --git a/src/ROUTES.ts b/src/ROUTES.ts index 9459708c893b..2c37116db395 100644 --- a/src/ROUTES.ts +++ b/src/ROUTES.ts @@ -48,7 +48,6 @@ export default { SETTINGS_ABOUT: 'settings/about', SETTINGS_APP_DOWNLOAD_LINKS: 'settings/about/app-download-links', SETTINGS_WALLET: 'settings/wallet', - SETTINGS_ADD_PAYPAL_ME: 'settings/wallet/add-paypal-me', SETTINGS_ADD_DEBIT_CARD: 'settings/wallet/add-debit-card', SETTINGS_ADD_BANK_ACCOUNT: 'settings/wallet/add-bank-account', SETTINGS_ENABLE_PAYMENTS: 'settings/wallet/enable-payments', diff --git a/src/components/AddPaymentMethodMenu.js b/src/components/AddPaymentMethodMenu.js index 7f1544a758f4..399247a35676 100644 --- a/src/components/AddPaymentMethodMenu.js +++ b/src/components/AddPaymentMethodMenu.js @@ -10,7 +10,6 @@ import withWindowDimensions from './withWindowDimensions'; import Permissions from '../libs/Permissions'; import PopoverMenu from './PopoverMenu'; import refPropTypes from './refPropTypes'; -import paypalMeDataPropTypes from './paypalMeDataPropTypes'; const propTypes = { /** Should the component be visible? */ @@ -25,12 +24,6 @@ const propTypes = { vertical: PropTypes.number, }), - /** Account details for PayPal.Me */ - payPalMeData: paypalMeDataPropTypes, - - /** Should we show the Paypal option */ - shouldShowPaypal: PropTypes.bool, - /** List of betas available to current user */ betas: PropTypes.arrayOf(PropTypes.string), @@ -42,8 +35,6 @@ const propTypes = { const defaultProps = { anchorPosition: {}, - payPalMeData: {}, - shouldShowPaypal: true, betas: [], anchorRef: () => {}, }; @@ -73,15 +64,6 @@ function AddPaymentMethodMenu(props) { }, ] : []), - ...(props.shouldShowPaypal && !props.payPalMeData.description - ? [ - { - text: props.translate('common.payPalMe'), - icon: Expensicons.PayPal, - onSelected: () => props.onItemSelected(CONST.PAYMENT_METHODS.PAYPAL), - }, - ] - : []), ]} withoutOverlay /> @@ -96,9 +78,6 @@ export default compose( withWindowDimensions, withLocalize, withOnyx({ - payPalMeData: { - key: ONYXKEYS.PAYPAL, - }, betas: { key: ONYXKEYS.BETAS, }, diff --git a/src/components/ButtonWithDropdownMenu.js b/src/components/ButtonWithDropdownMenu.js index 62eeb3030619..54d6c0deac5a 100644 --- a/src/components/ButtonWithDropdownMenu.js +++ b/src/components/ButtonWithDropdownMenu.js @@ -32,7 +32,7 @@ const propTypes = { style: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.object), PropTypes.object]), /** Menu options to display */ - /** e.g. [{text: 'Pay with Expensify', icon: Wallet}, {text: 'PayPal', icon: PayPal}] */ + /** e.g. [{text: 'Pay with Expensify', icon: Wallet}] */ options: PropTypes.arrayOf( PropTypes.shape({ value: PropTypes.string.isRequired, diff --git a/src/components/Icon/Expensicons.js b/src/components/Icon/Expensicons.js index 42db57068edc..a0c8b72d755a 100644 --- a/src/components/Icon/Expensicons.js +++ b/src/components/Icon/Expensicons.js @@ -82,7 +82,6 @@ import NewWorkspace from '../../../assets/images/new-workspace.svg'; import Offline from '../../../assets/images/offline.svg'; import OfflineCloud from '../../../assets/images/offline-cloud.svg'; import Paperclip from '../../../assets/images/paperclip.svg'; -import PayPal from '../../../assets/images/paypal.svg'; import Paycheck from '../../../assets/images/paycheck.svg'; import Pencil from '../../../assets/images/pencil.svg'; import Phone from '../../../assets/images/phone.svg'; @@ -216,7 +215,6 @@ export { Offline, OfflineCloud, Paperclip, - PayPal, Paycheck, Pencil, Phone, diff --git a/src/components/KYCWall/BaseKYCWall.js b/src/components/KYCWall/BaseKYCWall.js index 4684901e47b1..ebf115c5de59 100644 --- a/src/components/KYCWall/BaseKYCWall.js +++ b/src/components/KYCWall/BaseKYCWall.js @@ -142,7 +142,6 @@ class KYCWall extends React.Component { vertical: this.state.anchorPositionVertical, horizontal: this.state.anchorPositionHorizontal, }} - shouldShowPaypal={false} onItemSelected={(item) => { this.setState({shouldShowAddPaymentMenu: false}); if (item === CONST.PAYMENT_METHODS.BANK_ACCOUNT) { diff --git a/src/components/MoneyReportHeader.js b/src/components/MoneyReportHeader.js index 06a7f0b57b8e..d78f289f184b 100644 --- a/src/components/MoneyReportHeader.js +++ b/src/components/MoneyReportHeader.js @@ -79,7 +79,6 @@ function MoneyReportHeader({session, personalDetails, policy, chatReport, report return isManager && !isApproved && !isSettled; }, [policyType, isManager, isApproved, isSettled]); const bankAccountRoute = ReportUtils.getBankAccountRoute(chatReport); - const shouldShowPaypal = Boolean(lodashGet(personalDetails, [moneyRequestReport.managerID, 'payPalMeAddress'])); const formattedAmount = CurrencyUtils.convertToDisplayString(reportTotal, moneyRequestReport.currency); return ( @@ -99,7 +98,6 @@ function MoneyReportHeader({session, personalDetails, policy, chatReport, report IOU.payMoneyRequest(paymentType, chatReport, moneyRequestReport)} @@ -128,7 +126,6 @@ function MoneyReportHeader({session, personalDetails, policy, chatReport, report IOU.payMoneyRequest(paymentType, chatReport, moneyRequestReport)} diff --git a/src/components/MoneyRequestConfirmationList.js b/src/components/MoneyRequestConfirmationList.js index da98d324681e..8b2d3c5c8be9 100755 --- a/src/components/MoneyRequestConfirmationList.js +++ b/src/components/MoneyRequestConfirmationList.js @@ -385,13 +385,11 @@ function MoneyRequestConfirmationList(props) { const shouldShowSettlementButton = props.iouType === CONST.IOU.MONEY_REQUEST_TYPE.SEND; const shouldDisableButton = selectedParticipants.length === 0; - const recipient = props.selectedParticipants[0] || {}; return shouldShowSettlementButton ? ( ); - }, [confirm, props.selectedParticipants, props.bankAccountRoute, props.iouCurrencyCode, props.iouType, props.isReadOnly, props.policyID, selectedParticipants, splitOrRequestOptions]); + }, [confirm, props.bankAccountRoute, props.iouCurrencyCode, props.iouType, props.isReadOnly, props.policyID, selectedParticipants, splitOrRequestOptions]); return ( { switch (lodashGet(props.action, 'originalMessage.paymentType', '')) { - case CONST.IOU.PAYMENT_TYPE.PAYPAL_ME: - return props.translate('iou.settledPaypalMe'); - case CONST.IOU.PAYMENT_TYPE.ELSEWHERE: - return props.translate('iou.settledElsewhere'); case CONST.IOU.PAYMENT_TYPE.EXPENSIFY: return props.translate('iou.settledExpensify'); default: - return ''; + return props.translate('iou.settledElsewhere'); } }; @@ -249,7 +246,7 @@ function MoneyRequestPreview(props) { {getPreviewHeaderText()} - {Boolean(getSettledMessage()) && ( + {isSettled && ( <> (method.value === paymentMethod ? 0 : 1)); } return buttonOptions; - }, [betas, currency, formattedAmount, iouReport, nvp_lastPaymentMethod, policyID, shouldShowPaymentOptions, shouldShowPaypal, translate]); + }, [betas, currency, formattedAmount, iouReport, nvp_lastPaymentMethod, policyID, shouldShowPaymentOptions, translate]); const selectPaymentType = (event, iouPaymentType, triggerKYCFlow) => { if (iouPaymentType === CONST.IOU.PAYMENT_TYPE.EXPENSIFY || iouPaymentType === CONST.IOU.PAYMENT_TYPE.VBBA) { diff --git a/src/components/optionPropTypes.js b/src/components/optionPropTypes.js index bb1a7a073b61..709298036f07 100644 --- a/src/components/optionPropTypes.js +++ b/src/components/optionPropTypes.js @@ -68,6 +68,4 @@ export default PropTypes.shape({ brickRoadIndicator: PropTypes.oneOf([CONST.BRICK_ROAD_INDICATOR_STATUS.ERROR, '']), phoneNumber: PropTypes.string, - - payPalMeAddress: PropTypes.string, }); diff --git a/src/components/paypalMeDataPropTypes.js b/src/components/paypalMeDataPropTypes.js deleted file mode 100644 index 5498186748a5..000000000000 --- a/src/components/paypalMeDataPropTypes.js +++ /dev/null @@ -1,15 +0,0 @@ -import PropTypes from 'prop-types'; - -export default PropTypes.shape({ - /** This is always 'PayPal.me' */ - title: PropTypes.string, - - /** The paypalMe address */ - description: PropTypes.string, - - /** This is always 'payPalMe' */ - methodID: PropTypes.string, - - /** This is always 'payPalMe' */ - accountType: PropTypes.string, -}); diff --git a/src/languages/en.ts b/src/languages/en.ts index 9c44b4356a31..d8d1be5ae097 100755 --- a/src/languages/en.ts +++ b/src/languages/en.ts @@ -25,7 +25,6 @@ import type { ReportArchiveReasonsPolicyDeletedParams, RequestCountParams, SettleExpensifyCardParams, - SettlePaypalMeParams, RequestAmountParams, SplitAmountParams, AmountEachParams, @@ -37,7 +36,6 @@ import type { WaitingOnBankAccountParams, SettledAfterAddedBankAccountParams, PaidElsewhereWithAmountParams, - PaidUsingPaypalWithAmountParams, PaidWithExpensifyWithAmountParams, ThreadRequestReportNameParams, ThreadSentMoneyReportNameParams, @@ -206,7 +204,6 @@ export default { done: 'Done', more: 'More', debitCard: 'Debit card', - payPalMe: 'PayPal.me', bankAccount: 'Bank account', join: 'Join', decline: 'Decline', @@ -518,10 +515,8 @@ export default { deleteConfirmation: 'Are you sure that you want to delete this request?', settledExpensify: 'Paid', settledElsewhere: 'Paid elsewhere', - settledPaypalMe: 'Paid using Paypal.me', settleExpensify: ({formattedAmount}: SettleExpensifyCardParams) => `Pay ${formattedAmount} with Expensify`, payElsewhere: 'Pay elsewhere', - settlePaypalMe: ({formattedAmount}: SettlePaypalMeParams) => `Pay ${formattedAmount} with PayPal.me`, requestAmount: ({amount}: RequestAmountParams) => `request ${amount}`, splitAmount: ({amount}: SplitAmountParams) => `split ${amount}`, amountEach: ({amount}: AmountEachParams) => `${amount} each`, @@ -535,7 +530,6 @@ export default { settledAfterAddedBankAccount: ({submitterDisplayName, amount}: SettledAfterAddedBankAccountParams) => `${submitterDisplayName} added a bank account. The ${amount} payment has been made.`, paidElsewhereWithAmount: ({amount}: PaidElsewhereWithAmountParams) => `paid ${amount} elsewhere`, - paidUsingPaypalWithAmount: ({amount}: PaidUsingPaypalWithAmountParams) => `paid ${amount} using Paypal.me`, paidWithExpensifyWithAmount: ({amount}: PaidWithExpensifyWithAmountParams) => `paid ${amount} with Expensify`, noReimbursableExpenses: 'This report has an invalid amount', pendingConversionMessage: "Total will update when you're back online", @@ -761,18 +755,6 @@ export default { notesUnavailable: 'No notes found for the user', composerLabel: 'Notes', }, - addPayPalMePage: { - enterYourUsernameToGetPaidViaPayPal: 'Get paid back via PayPal.', - payPalMe: 'PayPal.me/', - yourPayPalUsername: 'Your PayPal username', - addPayPalAccount: 'Add PayPal account', - growlMessageOnSave: 'Your PayPal username was successfully added', - updatePaypalAccount: 'Save PayPal account', - growlMessageOnUpdate: 'Your PayPal username was successfully saved', - formatError: 'Invalid PayPal.me username', - checkListOf: 'Check the list of ', - supportedCurrencies: 'supported currencies', - }, addDebitCardPage: { addADebitCard: 'Add a debit card', nameOnCard: 'Name on card', @@ -802,7 +784,6 @@ export default { setDefaultSuccess: 'Default payment method set!', deleteAccount: 'Delete account', deleteConfirmation: 'Are you sure that you want to delete this account?', - deletePayPalSuccess: 'PayPal.me successfully deleted', error: { notOwnerOfBankAccount: 'There was an error setting this bank account as your default payment method.', invalidBankAccount: 'This bank account is temporarily suspended.', diff --git a/src/languages/es.ts b/src/languages/es.ts index a50b6821fc34..735f8a416cc0 100644 --- a/src/languages/es.ts +++ b/src/languages/es.ts @@ -25,7 +25,6 @@ import type { ReportArchiveReasonsPolicyDeletedParams, RequestCountParams, SettleExpensifyCardParams, - SettlePaypalMeParams, RequestAmountParams, SplitAmountParams, AmountEachParams, @@ -37,7 +36,6 @@ import type { WaitingOnBankAccountParams, SettledAfterAddedBankAccountParams, PaidElsewhereWithAmountParams, - PaidUsingPaypalWithAmountParams, PaidWithExpensifyWithAmountParams, ThreadRequestReportNameParams, ThreadSentMoneyReportNameParams, @@ -196,7 +194,6 @@ export default { done: 'Listo', more: 'Más', debitCard: 'Tarjeta de débito', - payPalMe: 'PayPal.me', bankAccount: 'Cuenta bancaria', join: 'Unirse', decline: 'Rechazar', @@ -510,10 +507,8 @@ export default { deleteConfirmation: '¿Estás seguro de que quieres eliminar este pedido?', settledExpensify: 'Pagado', settledElsewhere: 'Pagado de otra forma', - settledPaypalMe: 'Pagado con PayPal.me', settleExpensify: ({formattedAmount}: SettleExpensifyCardParams) => `Pagar ${formattedAmount} con Expensify`, payElsewhere: 'Pagar de otra forma', - settlePaypalMe: ({formattedAmount}: SettlePaypalMeParams) => `Pagar ${formattedAmount} con PayPal.me`, requestAmount: ({amount}: RequestAmountParams) => `solicitar ${amount}`, splitAmount: ({amount}: SplitAmountParams) => `dividir ${amount}`, amountEach: ({amount}: AmountEachParams) => `${amount} cada uno`, @@ -527,7 +522,6 @@ export default { settledAfterAddedBankAccount: ({submitterDisplayName, amount}: SettledAfterAddedBankAccountParams) => `${submitterDisplayName} añadió una cuenta bancaria. El pago de ${amount} se ha realizado.`, paidElsewhereWithAmount: ({amount}: PaidElsewhereWithAmountParams) => `pagó ${amount} de otra forma`, - paidUsingPaypalWithAmount: ({amount}: PaidUsingPaypalWithAmountParams) => `pagó ${amount} con PayPal.me`, paidWithExpensifyWithAmount: ({amount}: PaidWithExpensifyWithAmountParams) => `pagó ${amount} con Expensify`, noReimbursableExpenses: 'El importe de este informe no es válido', pendingConversionMessage: 'El total se actualizará cuando estés online', @@ -756,18 +750,6 @@ export default { notesUnavailable: 'No se han encontrado notas para el usuario', composerLabel: 'Notas', }, - addPayPalMePage: { - enterYourUsernameToGetPaidViaPayPal: 'Recibe pagos vía PayPal.', - payPalMe: 'PayPal.me/', - yourPayPalUsername: 'Tu usuario de PayPal', - addPayPalAccount: 'Añadir cuenta de PayPal', - growlMessageOnSave: 'Tu nombre de usuario de PayPal se añadió correctamente', - updatePaypalAccount: 'Guardar cuenta PayPal', - growlMessageOnUpdate: 'Su nombre de usuario de PayPal se guardó con éxito', - formatError: 'Usuario PayPal.me no válido', - checkListOf: 'Consulta la lista de ', - supportedCurrencies: 'monedas admitidas', - }, addDebitCardPage: { addADebitCard: 'Añadir una tarjeta de débito', nameOnCard: 'Nombre en la tarjeta', @@ -797,7 +779,6 @@ export default { setDefaultSuccess: 'Método de pago configurado', deleteAccount: 'Eliminar cuenta', deleteConfirmation: '¿Estás seguro de que quieres eliminar esta cuenta?', - deletePayPalSuccess: 'PayPal.me eliminada correctamente', error: { notOwnerOfBankAccount: 'Ha ocurrido un error al establecer esta cuenta bancaria como método de pago predeterminado.', invalidBankAccount: 'Esta cuenta bancaria está temporalmente suspendida.', diff --git a/src/languages/types.ts b/src/languages/types.ts index 565b5933b989..86813841f177 100644 --- a/src/languages/types.ts +++ b/src/languages/types.ts @@ -100,8 +100,6 @@ type SettleExpensifyCardParams = { formattedAmount: string; }; -type SettlePaypalMeParams = {formattedAmount: string}; - type RequestAmountParams = {amount: number}; type SplitAmountParams = {amount: number}; @@ -126,8 +124,6 @@ type SettledAfterAddedBankAccountParams = {submitterDisplayName: string; amount: type PaidElsewhereWithAmountParams = {amount: string}; -type PaidUsingPaypalWithAmountParams = {amount: string}; - type PaidWithExpensifyWithAmountParams = {amount: string}; type ThreadRequestReportNameParams = {formattedAmount: string; comment: string}; @@ -260,7 +256,6 @@ export type { ReportArchiveReasonsPolicyDeletedParams, RequestCountParams, SettleExpensifyCardParams, - SettlePaypalMeParams, RequestAmountParams, SplitAmountParams, AmountEachParams, @@ -273,7 +268,6 @@ export type { WaitingOnBankAccountParams, SettledAfterAddedBankAccountParams, PaidElsewhereWithAmountParams, - PaidUsingPaypalWithAmountParams, PaidWithExpensifyWithAmountParams, ThreadRequestReportNameParams, ThreadSentMoneyReportNameParams, diff --git a/src/libs/E2E/apiMocks/openApp.js b/src/libs/E2E/apiMocks/openApp.js index 745c1952f07d..d50f4462cfd9 100644 --- a/src/libs/E2E/apiMocks/openApp.js +++ b/src/libs/E2E/apiMocks/openApp.js @@ -1094,7 +1094,6 @@ export default () => ({ }, firstName: '', lastName: '', - payPalMeAddress: 'qwerty', phoneNumber: '', validated: true, }, @@ -1110,7 +1109,6 @@ export default () => ({ }, firstName: '"Chat N', lastName: 'Laz"', - payPalMeAddress: '', phoneNumber: '', validated: true, }, @@ -1126,7 +1124,6 @@ export default () => ({ }, firstName: '', lastName: '', - payPalMeAddress: '', phoneNumber: '', validated: true, }, @@ -1142,7 +1139,6 @@ export default () => ({ }, firstName: '123', lastName: 'Ios', - payPalMeAddress: 'Wwerty', phoneNumber: '', validated: true, }, @@ -1158,7 +1154,6 @@ export default () => ({ }, firstName: 'Qqq', lastName: 'Qqq', - payPalMeAddress: '', phoneNumber: '', validated: true, }, @@ -1174,7 +1169,6 @@ export default () => ({ }, firstName: 'Main', lastName: 'Ios🏴󠁧󠁢󠁳󠁣󠁴󠁿ios', - payPalMeAddress: '', phoneNumber: '', validated: true, }, @@ -1190,7 +1184,6 @@ export default () => ({ }, firstName: '0604', lastName: 'Lsn', - payPalMeAddress: '12345', phoneNumber: '', validated: true, }, @@ -1206,7 +1199,6 @@ export default () => ({ }, firstName: '07 04 0704', lastName: 'Lsn lsn', - payPalMeAddress: '', phoneNumber: '', validated: true, }, @@ -1222,7 +1214,6 @@ export default () => ({ }, firstName: 'Katya', lastName: 'Becciv', - payPalMeAddress: 'testing', phoneNumber: '', validated: true, }, @@ -1238,7 +1229,6 @@ export default () => ({ }, firstName: 'Katie', lastName: 'Becciv', - payPalMeAddress: 'kbecciv', phoneNumber: '', validated: true, }, @@ -1254,7 +1244,6 @@ export default () => ({ }, firstName: '11', lastName: '11', - payPalMeAddress: '', phoneNumber: '', validated: true, }, @@ -1270,7 +1259,6 @@ export default () => ({ }, firstName: '"First"', lastName: '', - payPalMeAddress: '444555', phoneNumber: '', validated: true, }, @@ -1286,7 +1274,6 @@ export default () => ({ }, firstName: 'bernardo', lastName: 'utest', - payPalMeAddress: '', phoneNumber: '', validated: false, }, @@ -1302,7 +1289,6 @@ export default () => ({ }, firstName: 'Chat', lastName: 'HT', - payPalMeAddress: '111', phoneNumber: '', validated: true, }, @@ -1318,7 +1304,6 @@ export default () => ({ }, firstName: '', lastName: '', - payPalMeAddress: '', phoneNumber: '', validated: true, }, @@ -1334,7 +1319,6 @@ export default () => ({ }, firstName: '', lastName: '', - payPalMeAddress: '', phoneNumber: '', validated: true, }, @@ -1350,7 +1334,6 @@ export default () => ({ }, firstName: '', lastName: '', - payPalMeAddress: '', phoneNumber: '', validated: true, localCurrencyCode: 'USD', @@ -1367,7 +1350,6 @@ export default () => ({ }, firstName: '', lastName: '', - payPalMeAddress: '', phoneNumber: '', validated: true, }, @@ -1383,7 +1365,6 @@ export default () => ({ }, firstName: '', lastName: '', - payPalMeAddress: '', phoneNumber: '', validated: true, }, @@ -1399,7 +1380,6 @@ export default () => ({ }, firstName: 'Applause', lastName: 'Main Account', - payPalMeAddress: 'ss', phoneNumber: '', validated: true, }, @@ -1415,7 +1395,6 @@ export default () => ({ }, firstName: 'Christoph', lastName: 'Pader', - payPalMeAddress: '', phoneNumber: '', validated: true, }, @@ -1431,7 +1410,6 @@ export default () => ({ }, firstName: 'Concierge', lastName: '', - payPalMeAddress: '', phoneNumber: '', validated: true, }, @@ -1447,7 +1425,6 @@ export default () => ({ }, firstName: 'Chat S', lastName: '', - payPalMeAddress: '', phoneNumber: '', validated: true, }, @@ -1463,7 +1440,6 @@ export default () => ({ }, firstName: 'Tayla', lastName: 'Simmons', - payPalMeAddress: '', phoneNumber: '', validated: true, }, @@ -2162,7 +2138,6 @@ export default () => ({ cachedTotal: '($1,473.11)', total: 147311, stateNum: 1, - submitterPayPalMeAddress: '', hasOutstandingIOU: true, }, report_4249286573496381: { @@ -2175,7 +2150,6 @@ export default () => ({ cachedTotal: '($212.78)', total: 21278, stateNum: 1, - submitterPayPalMeAddress: '', hasOutstandingIOU: true, }, }, diff --git a/src/libs/Navigation/AppNavigator/ModalStackNavigators.js b/src/libs/Navigation/AppNavigator/ModalStackNavigators.js index c5bb02354641..392781a777db 100644 --- a/src/libs/Navigation/AppNavigator/ModalStackNavigators.js +++ b/src/libs/Navigation/AppNavigator/ModalStackNavigators.js @@ -550,13 +550,6 @@ const SettingsModalStackNavigator = createModalStackNavigator([ }, name: 'Settings_Wallet_Choose_Transfer_Account', }, - { - getComponent: () => { - const SettingsAddPayPalMePage = require('../../../pages/settings/Wallet/AddPayPalMePage').default; - return SettingsAddPayPalMePage; - }, - name: 'Settings_Add_Paypal_Me', - }, { getComponent: () => { const EnablePaymentsPage = require('../../../pages/EnablePayments/EnablePaymentsPage').default; diff --git a/src/libs/Navigation/linkingConfig.js b/src/libs/Navigation/linkingConfig.js index 14ee2b895831..11d21d6d005c 100644 --- a/src/libs/Navigation/linkingConfig.js +++ b/src/libs/Navigation/linkingConfig.js @@ -85,10 +85,6 @@ export default { path: ROUTES.SETTINGS_WALLET_CHOOSE_TRANSFER_ACCOUNT, exact: true, }, - Settings_Add_Paypal_Me: { - path: ROUTES.SETTINGS_ADD_PAYPAL_ME, - exact: true, - }, Settings_Add_Debit_Card: { path: ROUTES.SETTINGS_ADD_DEBIT_CARD, exact: true, diff --git a/src/libs/OptionsListUtils.js b/src/libs/OptionsListUtils.js index 7629a1acc0a6..8705d9f78004 100644 --- a/src/libs/OptionsListUtils.js +++ b/src/libs/OptionsListUtils.js @@ -228,7 +228,6 @@ function getParticipantsOptions(participants, personalDetails) { id: detail.accountID, }, ], - payPalMeAddress: lodashGet(detail, 'payPalMeAddress', ''), phoneNumber: lodashGet(detail, 'phoneNumber', ''), selected: participant.selected, }; @@ -446,7 +445,6 @@ function createOption(accountIDs, personalDetails, report, reportActions = {}, { login: null, reportID: null, phoneNumber: null, - payPalMeAddress: null, hasDraftComment: false, keyForList: null, searchText: null, @@ -540,7 +538,6 @@ function createOption(accountIDs, personalDetails, report, reportActions = {}, { result.login = personalDetail.login; result.accountID = Number(personalDetail.accountID); result.phoneNumber = personalDetail.phoneNumber; - result.payPalMeAddress = personalDetail.payPalMeAddress; } result.text = reportName; diff --git a/src/libs/PaymentUtils.js b/src/libs/PaymentUtils.js index c211f9538960..67d7c74869fc 100644 --- a/src/libs/PaymentUtils.js +++ b/src/libs/PaymentUtils.js @@ -1,7 +1,6 @@ import _ from 'underscore'; import lodashGet from 'lodash/get'; import BankAccount from './models/BankAccount'; -import * as Expensicons from '../components/Icon/Expensicons'; import getBankIcon from '../components/Icon/BankIcons'; import CONST from '../CONST'; import * as Localize from './Localize'; @@ -26,14 +25,11 @@ function hasExpensifyPaymentMethod(fundList = [], bankAccountList = []) { } /** - * @param {String} [accountType] - one of {'bankAccount', 'debitCard', 'payPalMe'} + * @param {String} [accountType] - one of {'bankAccount', 'debitCard'} * @param {Object} account * @returns {String} */ function getPaymentMethodDescription(accountType, account) { - if (accountType === CONST.PAYMENT_METHODS.PAYPAL) { - return account.username; - } if (accountType === CONST.PAYMENT_METHODS.BANK_ACCOUNT) { return `${Localize.translateLocal('paymentMethodList.accountLastFour')} ${account.accountNumber.slice(-4)}`; } @@ -47,10 +43,9 @@ function getPaymentMethodDescription(accountType, account) { * Get the PaymentMethods list * @param {Array} bankAccountList * @param {Array} fundList - * @param {Object} [payPalMeData = null] * @returns {Array} */ -function formatPaymentMethods(bankAccountList, fundList, payPalMeData = null) { +function formatPaymentMethods(bankAccountList, fundList) { const combinedPaymentMethods = []; _.each(bankAccountList, (bankAccount) => { @@ -82,14 +77,6 @@ function formatPaymentMethods(bankAccountList, fundList, payPalMeData = null) { }); }); - if (!_.isEmpty(payPalMeData)) { - combinedPaymentMethods.push({ - ...payPalMeData, - description: getPaymentMethodDescription(payPalMeData.accountType, payPalMeData.accountData), - icon: Expensicons.PayPal, - }); - } - return combinedPaymentMethods; } diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index f24959c4bac2..8fdae7593b3d 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -1446,11 +1446,9 @@ function getReportPreviewMessage(report, reportAction = {}, shouldConsiderReceip } if (isSettled(report.reportID)) { - // A settled report preview message can come in three formats "paid ... using Paypal.me", "paid ... elsewhere" or "paid ... with Expensify" + // A settled report preview message can come in three formats "paid ... elsewhere" or "paid ... with Expensify" let translatePhraseKey = 'iou.paidElsewhereWithAmount'; - if (reportAction.originalMessage.paymentType === CONST.IOU.PAYMENT_TYPE.PAYPAL_ME || reportActionMessage.match(/ PayPal.me$/)) { - translatePhraseKey = 'iou.paidUsingPaypalWithAmount'; - } else if ( + if ( _.contains([CONST.IOU.PAYMENT_TYPE.VBBA, CONST.IOU.PAYMENT_TYPE.EXPENSIFY], reportAction.originalMessage.paymentType) || reportActionMessage.match(/ (with Expensify|using Expensify)$/) ) { @@ -2001,7 +1999,7 @@ function buildOptimisticExpenseReport(chatReportID, policyID, payeeAccountID, to * @param {Number} total - IOU total in cents * @param {String} comment - IOU comment * @param {String} currency - IOU currency - * @param {String} paymentType - IOU paymentMethodType. Can be oneOf(Elsewhere, Expensify, PayPal.me) + * @param {String} paymentType - IOU paymentMethodType. Can be oneOf(Elsewhere, Expensify) * @param {Boolean} isSettlingUp - Whether we are settling up an IOU * @returns {Array} */ @@ -2013,15 +2011,12 @@ function getIOUReportActionMessage(iouReportID, type, total, comment, currency, let paymentMethodMessage; switch (paymentType) { - case CONST.IOU.PAYMENT_TYPE.ELSEWHERE: - paymentMethodMessage = ' elsewhere'; - break; case CONST.IOU.PAYMENT_TYPE.VBBA: case CONST.IOU.PAYMENT_TYPE.EXPENSIFY: paymentMethodMessage = ' with Expensify'; break; default: - paymentMethodMessage = ` using ${paymentType}`; + paymentMethodMessage = ` elsewhere`; break; } @@ -2065,7 +2060,7 @@ function getIOUReportActionMessage(iouReportID, type, total, comment, currency, * @param {String} comment - User comment for the IOU. * @param {Array} participants - An array with participants details. * @param {String} [transactionID] - Not required if the IOUReportAction type is 'pay' - * @param {String} [paymentType] - Only required if the IOUReportAction type is 'pay'. Can be oneOf(elsewhere, payPal, Expensify). + * @param {String} [paymentType] - Only required if the IOUReportAction type is 'pay'. Can be oneOf(elsewhere, Expensify). * @param {String} [iouReportID] - Only required if the IOUReportActions type is oneOf(decline, cancel, pay). Generates a randomID as default. * @param {Boolean} [isSettlingUp] - Whether we are settling up an IOU. * @param {Boolean} [isSendMoneyFlow] - Whether this is send money flow diff --git a/src/libs/SidebarUtils.js b/src/libs/SidebarUtils.js index 118035f9f605..a3e57a9dc252 100644 --- a/src/libs/SidebarUtils.js +++ b/src/libs/SidebarUtils.js @@ -205,7 +205,6 @@ function getOptionData(report, reportActions, personalDetails, preferredLocale, statusNum: null, stateNum: null, phoneNumber: null, - payPalMeAddress: null, isUnread: null, isUnreadWithMention: null, hasDraftComment: false, @@ -345,7 +344,6 @@ function getOptionData(report, reportActions, personalDetails, preferredLocale, result.accountID = personalDetail.accountID; result.login = personalDetail.login; result.phoneNumber = personalDetail.phoneNumber; - result.payPalMeAddress = personalDetail.payPalMeAddress; } const reportName = ReportUtils.getReportName(report, policy); diff --git a/src/libs/ValidationUtils.js b/src/libs/ValidationUtils.js index 81b91e2101be..ed9ac5f707a1 100644 --- a/src/libs/ValidationUtils.js +++ b/src/libs/ValidationUtils.js @@ -190,15 +190,6 @@ function isValidSSNFullNine(ssnFull9) { return CONST.REGEX.SSN_FULL_NINE.test(ssnFull9); } -/** - * - * @param {String} paypalUsername - * @returns {Boolean} - */ -function isValidPaypalUsername(paypalUsername) { - return Boolean(paypalUsername) && CONST.REGEX.PAYPAL_ME_USERNAME.test(paypalUsername); -} - /** * Validate that a date meets the minimum age requirement. * @@ -475,7 +466,6 @@ export { validateIdentity, isValidTwoFactorCode, isNumericWithSpecialChars, - isValidPaypalUsername, isValidRoutingNumber, isValidSSNLastFour, isValidSSNFullNine, diff --git a/src/libs/actions/IOU.js b/src/libs/actions/IOU.js index 3cefcd00ed60..348c3aa2fc9b 100644 --- a/src/libs/actions/IOU.js +++ b/src/libs/actions/IOU.js @@ -8,7 +8,6 @@ import ROUTES from '../../ROUTES'; import ONYXKEYS from '../../ONYXKEYS'; import Navigation from '../Navigation/Navigation'; import * as Localize from '../Localize'; -import asyncOpenURL from '../asyncOpenURL'; import * as API from '../API'; import * as ReportUtils from '../ReportUtils'; import * as CurrencyUtils from '../CurrencyUtils'; @@ -1397,16 +1396,6 @@ function deleteMoneyRequest(transactionID, reportAction, isSingleTransactionView } } -/** - * @param {Number} amount - * @param {String} submitterPayPalMeAddress - * @param {String} currency - * @returns {String} - */ -function buildPayPalPaymentUrl(amount, submitterPayPalMeAddress, currency) { - return `https://paypal.me/${submitterPayPalMeAddress}/${Math.abs(amount) / 100}${currency}`; -} - /** * @param {Object} report * @param {Number} amount @@ -1787,26 +1776,6 @@ function sendMoneyWithWallet(report, amount, currency, comment, managerID, recip Report.notifyNewAction(params.chatReportID, managerID); } -/** - * @param {Object} report - * @param {Number} amount - * @param {String} currency - * @param {String} comment - * @param {String} managerID - Account ID of the person sending the money - * @param {Object} recipient - The user receiving the money - */ -function sendMoneyViaPaypal(report, amount, currency, comment, managerID, recipient) { - const {params, optimisticData, successData, failureData} = getSendMoneyParams(report, amount, currency, comment, CONST.IOU.PAYMENT_TYPE.PAYPAL_ME, managerID, recipient); - - API.write('SendMoneyViaPaypal', params, {optimisticData, successData, failureData}); - - resetMoneyRequestInfo(); - Navigation.dismissModal(params.chatReportID); - Report.notifyNewAction(params.chatReportID, managerID); - - asyncOpenURL(Promise.resolve(), buildPayPalPaymentUrl(amount, recipient.payPalMeAddress, currency)); -} - function approveMoneyRequest(expenseReport) { const optimisticApprovedReportAction = ReportUtils.buildOptimisticApprovedReportAction(expenseReport.total, expenseReport.currency, expenseReport.reportID); @@ -1870,7 +1839,6 @@ function payMoneyRequest(paymentType, chatReport, iouReport) { const recipient = { login: iouReport.ownerEmail, accountID: iouReport.ownerAccountID, - payPalMeAddress: iouReport.submitterPayPalMeAddress, }; const {params, optimisticData, successData, failureData} = getPayMoneyRequestParams(chatReport, iouReport, recipient, paymentType); @@ -1880,9 +1848,6 @@ function payMoneyRequest(paymentType, chatReport, iouReport) { API.write(apiCommand, params, {optimisticData, successData, failureData}); Navigation.dismissModal(chatReport.reportID); - if (paymentType === CONST.IOU.PAYMENT_TYPE.PAYPAL_ME) { - asyncOpenURL(Promise.resolve(), buildPayPalPaymentUrl(iouReport.total, recipient.payPalMeAddress, iouReport.currency)); - } } /** @@ -2018,7 +1983,6 @@ export { splitBillAndOpenReport, requestMoney, sendMoneyElsewhere, - sendMoneyViaPaypal, approveMoneyRequest, payMoneyRequest, sendMoneyWithWallet, diff --git a/src/libs/actions/PaymentMethods.js b/src/libs/actions/PaymentMethods.js index 95148c1d4367..17fec65078ed 100644 --- a/src/libs/actions/PaymentMethods.js +++ b/src/libs/actions/PaymentMethods.js @@ -4,18 +4,10 @@ import Onyx from 'react-native-onyx'; import ONYXKEYS from '../../ONYXKEYS'; import * as API from '../API'; import CONST from '../../CONST'; -import Growl from '../Growl'; -import * as Localize from '../Localize'; import Navigation from '../Navigation/Navigation'; import * as CardUtils from '../CardUtils'; -import * as User from './User'; import ROUTES from '../../ROUTES'; -function deletePayPalMe() { - User.deletePaypalMeAddress(); - Growl.show(Localize.translateLocal('walletPage.deletePayPalSuccess'), CONST.GROWL.SUCCESS, 3000); -} - /** * Sets up a ref to an instance of the KYC Wall component. */ @@ -344,7 +336,6 @@ function deletePaymentCard(fundID) { } export { - deletePayPalMe, deletePaymentCard, addPaymentCard, openWalletPage, diff --git a/src/libs/actions/User.js b/src/libs/actions/User.js index 7482c13268e4..8f6c7861d8aa 100644 --- a/src/libs/actions/User.js +++ b/src/libs/actions/User.js @@ -8,8 +8,6 @@ import CONST from '../../CONST'; import Navigation from '../Navigation/Navigation'; import ROUTES from '../../ROUTES'; import * as Pusher from '../Pusher/pusher'; -import Growl from '../Growl'; -import * as Localize from '../Localize'; import * as Link from './Link'; import * as SequentialQueue from '../Network/SequentialQueue'; import PusherUtils from '../PusherUtils'; @@ -465,64 +463,6 @@ function isBlockedFromConcierge(blockedFromConciergeNVP) { return moment().isBefore(moment(blockedFromConciergeNVP.expiresAt), 'day'); } -/** - * Adds a paypal.me address for the user - * - * @param {String} address - */ -function addPaypalMeAddress(address) { - const optimisticData = [ - { - onyxMethod: Onyx.METHOD.MERGE, - key: ONYXKEYS.PAYPAL, - value: { - title: 'PayPal.me', - description: address, - methodID: CONST.PAYMENT_METHODS.PAYPAL, - key: 'payPalMePaymentMethod', - accountType: CONST.PAYMENT_METHODS.PAYPAL, - accountData: { - username: address, - }, - isDefault: false, - }, - }, - ]; - API.write( - 'AddPaypalMeAddress', - { - value: address, - }, - {optimisticData}, - ); -} - -/** - * Deletes a paypal.me address for the user - * - */ -function deletePaypalMeAddress() { - const optimisticData = [ - { - onyxMethod: Onyx.METHOD.MERGE, - key: ONYXKEYS.PAYPAL, - value: {pendingAction: CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE}, - }, - ]; - - // Success data required for Android, more info here https://github.com/Expensify/App/pull/17903#discussion_r1175763081 - const successData = [ - { - onyxMethod: Onyx.METHOD.SET, - key: ONYXKEYS.PAYPAL, - value: {}, - }, - ]; - - API.write('DeletePaypalMeAddress', {}, {optimisticData, successData}); - Growl.show(Localize.translateLocal('walletPage.deletePayPalSuccess'), CONST.GROWL.SUCCESS, 3000); -} - function triggerNotifications(onyxUpdates) { _.each(onyxUpdates, (update) => { if (!update.shouldNotify) { @@ -921,8 +861,6 @@ export { joinScreenShare, clearScreenShareRequest, generateStatementPDF, - deletePaypalMeAddress, - addPaypalMeAddress, updateChatPriorityMode, setContactMethodAsDefault, updateTheme, diff --git a/src/pages/iou/steps/MoneyRequestConfirmPage.js b/src/pages/iou/steps/MoneyRequestConfirmPage.js index 38a5b9c82c07..dcc9aa6c9827 100644 --- a/src/pages/iou/steps/MoneyRequestConfirmPage.js +++ b/src/pages/iou/steps/MoneyRequestConfirmPage.js @@ -246,11 +246,6 @@ function MoneyRequestConfirmPage(props) { return; } - if (paymentMethodType === CONST.IOU.PAYMENT_TYPE.PAYPAL_ME) { - IOU.sendMoneyViaPaypal(props.report, props.iou.amount, currency, trimmedComment, props.currentUserPersonalDetails.accountID, participant); - return; - } - if (paymentMethodType === CONST.IOU.PAYMENT_TYPE.EXPENSIFY) { IOU.sendMoneyWithWallet(props.report, props.iou.amount, currency, trimmedComment, props.currentUserPersonalDetails.accountID, participant); } diff --git a/src/pages/settings/Wallet/AddPayPalMePage.js b/src/pages/settings/Wallet/AddPayPalMePage.js deleted file mode 100644 index 38eae4d46bbc..000000000000 --- a/src/pages/settings/Wallet/AddPayPalMePage.js +++ /dev/null @@ -1,142 +0,0 @@ -import React, {useRef, useCallback} from 'react'; -import {View} from 'react-native'; -import _ from 'underscore'; -import {withOnyx} from 'react-native-onyx'; -import lodashGet from 'lodash/get'; -import CONST from '../../../CONST'; -import ROUTES from '../../../ROUTES'; -import compose from '../../../libs/compose'; -import ONYXKEYS from '../../../ONYXKEYS'; -import HeaderWithBackButton from '../../../components/HeaderWithBackButton'; -import TextLink from '../../../components/TextLink'; -import Text from '../../../components/Text'; -import ScreenWrapper from '../../../components/ScreenWrapper'; -import Navigation from '../../../libs/Navigation/Navigation'; -import styles from '../../../styles/styles'; -import withLocalize, {withLocalizePropTypes} from '../../../components/withLocalize'; -import Form from '../../../components/Form'; -import Growl from '../../../libs/Growl'; -import TextInput from '../../../components/TextInput'; -import * as ValidationUtils from '../../../libs/ValidationUtils'; -import * as User from '../../../libs/actions/User'; -import Icon from '../../../components/Icon'; -import * as Expensicons from '../../../components/Icon/Expensicons'; -import variables from '../../../styles/variables'; -import PressableWithoutFeedback from '../../../components/Pressable/PressableWithoutFeedback'; -import paypalMeDataPropTypes from '../../../components/paypalMeDataPropTypes'; -import * as Link from '../../../libs/actions/Link'; - -const propTypes = { - /** Account details for PayPal.Me */ - payPalMeData: paypalMeDataPropTypes, - - ...withLocalizePropTypes, -}; - -const defaultProps = { - payPalMeData: {}, -}; - -const validate = (values) => { - const requiredFields = ['payPalMeUsername']; - const errors = ValidationUtils.getFieldRequiredErrors(values, requiredFields); - - if (values.payPalMeUsername && !ValidationUtils.isValidPaypalUsername(values.payPalMeUsername)) { - errors.payPalMeUsername = 'addPayPalMePage.formatError'; - } - - return errors; -}; - -function AddPayPalMePage(props) { - const payPalMeInput = useRef(null); - - const hasPaypalAccount = !_.isEmpty(props.payPalMeData); - - const growlMessageOnSave = props.translate(hasPaypalAccount ? 'addPayPalMePage.growlMessageOnUpdate' : 'addPayPalMePage.growlMessageOnSave'); - - /** - * Sets the payPalMe username and error data for the current user - */ - const setPayPalMeData = useCallback( - (values) => { - User.addPaypalMeAddress(values.payPalMeUsername); - Growl.show(growlMessageOnSave, CONST.GROWL.SUCCESS, 3000); - Navigation.goBack(ROUTES.SETTINGS_WALLET); - }, - [growlMessageOnSave], - ); - - return ( - payPalMeInput.current && payPalMeInput.current.focus()} - > - Navigation.goBack(ROUTES.SETTINGS_WALLET)} - /> -
- {props.translate('addPayPalMePage.enterYourUsernameToGetPaidViaPayPal')} - (payPalMeInput.current = ref)} - label={props.translate('addPayPalMePage.payPalMe')} - accessibilityLabel={props.translate('addPayPalMePage.payPalMe')} - accessibilityRole={CONST.ACCESSIBILITY_ROLE.TEXT} - autoCompleteType="off" - autoCorrect={false} - placeholder={props.translate('addPayPalMePage.yourPayPalUsername')} - returnKeyType="done" - defaultValue={lodashGet(props.payPalMeData, 'accountData.username', '')} - /> - - {props.translate('addPayPalMePage.checkListOf')} - Link.openExternalLink('https://developer.paypal.com/docs/reports/reference/paypal-supported-currencies')} - > - - - {props.translate('addPayPalMePage.supportedCurrencies')} - - - - - - - - -
- ); -} - -AddPayPalMePage.propTypes = propTypes; -AddPayPalMePage.defaultProps = defaultProps; -AddPayPalMePage.displayName = 'AddPayPalMePage'; - -export default compose( - withLocalize, - withOnyx({ - payPalMeData: { - key: ONYXKEYS.PAYPAL, - }, - }), -)(AddPayPalMePage); diff --git a/src/pages/settings/Wallet/PaymentMethodList.js b/src/pages/settings/Wallet/PaymentMethodList.js index 94bcf9f87078..d757db370b05 100644 --- a/src/pages/settings/Wallet/PaymentMethodList.js +++ b/src/pages/settings/Wallet/PaymentMethodList.js @@ -16,7 +16,6 @@ import ONYXKEYS from '../../../ONYXKEYS'; import CONST from '../../../CONST'; import * as Expensicons from '../../../components/Icon/Expensicons'; import bankAccountPropTypes from '../../../components/bankAccountPropTypes'; -import paypalMeDataPropTypes from '../../../components/paypalMeDataPropTypes'; import cardPropTypes from '../../../components/cardPropTypes'; import * as PaymentUtils from '../../../libs/PaymentUtils'; import FormAlertWrapper from '../../../components/FormAlertWrapper'; @@ -28,9 +27,6 @@ const propTypes = { /** What to do when a menu item is pressed */ onPress: PropTypes.func.isRequired, - /** Account details for PayPal.Me */ - payPalMeData: paypalMeDataPropTypes, - /** List of bank accounts */ bankAccountList: PropTypes.objectOf(bankAccountPropTypes), @@ -77,7 +73,6 @@ const propTypes = { }; const defaultProps = { - payPalMeData: {}, bankAccountList: {}, fundList: null, userWallet: { @@ -149,14 +144,13 @@ function isPaymentMethodActive(actionPaymentMethodType, activePaymentMethodID, p return paymentMethod.accountType === actionPaymentMethodType && paymentMethod.methodID === activePaymentMethodID; } function PaymentMethodList(props) { - const {actionPaymentMethodType, activePaymentMethodID, bankAccountList, fundList, filterType, network, onPress, payPalMeData, shouldShowSelectedState, selectedMethodID, translate} = - props; + const {actionPaymentMethodType, activePaymentMethodID, bankAccountList, fundList, filterType, network, onPress, shouldShowSelectedState, selectedMethodID, translate} = props; const filteredPaymentMethods = useMemo(() => { const paymentCardList = fundList || {}; // Hide any billing cards that are not P2P debit cards for now because you cannot make them your default method, or delete them const filteredCardList = _.filter(paymentCardList, (card) => card.accountData.additionalData.isP2PDebitCard); - let combinedPaymentMethods = PaymentUtils.formatPaymentMethods(bankAccountList, filteredCardList, payPalMeData); + let combinedPaymentMethods = PaymentUtils.formatPaymentMethods(bankAccountList, filteredCardList); if (!_.isEmpty(filterType)) { combinedPaymentMethods = _.filter(combinedPaymentMethods, (paymentMethod) => paymentMethod.accountType === filterType); @@ -180,7 +174,7 @@ function PaymentMethodList(props) { })); return combinedPaymentMethods; - }, [actionPaymentMethodType, activePaymentMethodID, bankAccountList, filterType, network, onPress, payPalMeData, fundList]); + }, [actionPaymentMethodType, activePaymentMethodID, bankAccountList, filterType, network, onPress, fundList]); /** * Render placeholder when there are no payments methods @@ -274,9 +268,6 @@ export default compose( isLoadingPaymentMethods: { key: ONYXKEYS.IS_LOADING_PAYMENT_METHODS, }, - payPalMeData: { - key: ONYXKEYS.PAYPAL, - }, userWallet: { key: ONYXKEYS.USER_WALLET, }, diff --git a/src/pages/settings/Wallet/WalletPage/BaseWalletPage.js b/src/pages/settings/Wallet/WalletPage/BaseWalletPage.js index 1393892b6ef0..be40ef1af495 100644 --- a/src/pages/settings/Wallet/WalletPage/BaseWalletPage.js +++ b/src/pages/settings/Wallet/WalletPage/BaseWalletPage.js @@ -89,9 +89,6 @@ function BaseWalletPage(props) { }, [windowWidth]); const getSelectedPaymentMethodID = useCallback(() => { - if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.PAYPAL) { - return CONST.PAYMENT_METHODS.PAYPAL; - } if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.BANK_ACCOUNT) { return paymentMethod.selectedPaymentMethod.bankAccountID; } @@ -138,14 +135,7 @@ function BaseWalletPage(props) { // The delete/default menu if (accountType) { let formattedSelectedPaymentMethod; - if (accountType === CONST.PAYMENT_METHODS.PAYPAL) { - formattedSelectedPaymentMethod = { - title: 'PayPal.me', - icon: account.icon, - description: PaymentUtils.getPaymentMethodDescription(accountType, account), - type: CONST.PAYMENT_METHODS.PAYPAL, - }; - } else if (accountType === CONST.PAYMENT_METHODS.BANK_ACCOUNT) { + if (accountType === CONST.PAYMENT_METHODS.BANK_ACCOUNT) { formattedSelectedPaymentMethod = { title: account.addressName, icon: account.icon, @@ -190,11 +180,6 @@ function BaseWalletPage(props) { const addPaymentMethodTypePressed = (paymentType) => { hideAddPaymentMenu(); - if (paymentType === CONST.PAYMENT_METHODS.PAYPAL) { - Navigation.navigate(ROUTES.SETTINGS_ADD_PAYPAL_ME); - return; - } - if (paymentType === CONST.PAYMENT_METHODS.DEBIT_CARD) { Navigation.navigate(ROUTES.SETTINGS_ADD_DEBIT_CARD); return; @@ -241,9 +226,7 @@ function BaseWalletPage(props) { ]); const deletePaymentMethod = useCallback(() => { - if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.PAYPAL) { - PaymentMethods.deletePayPalMe(); - } else if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.BANK_ACCOUNT) { + if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.BANK_ACCOUNT) { BankAccounts.deletePaymentBankAccount(paymentMethod.selectedPaymentMethod.bankAccountID); } else if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.DEBIT_CARD) { PaymentMethods.deletePaymentCard(paymentMethod.selectedPaymentMethod.fundID); @@ -254,11 +237,6 @@ function BaseWalletPage(props) { Navigation.navigate(ROUTES.SETTINGS_WALLET_TRANSFER_BALANCE); }; - const navigateToAddPaypalRoute = () => { - Navigation.navigate(ROUTES.SETTINGS_ADD_PAYPAL_ME); - setShouldShowDefaultDeleteMenu(false); - }; - const listHeaderComponent = useCallback( () => ( <> @@ -350,8 +328,6 @@ function BaseWalletPage(props) { shouldResetPaymentMethodData = true; } else if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.DEBIT_CARD && _.isEmpty(props.fundList[paymentMethod.methodID])) { shouldResetPaymentMethodData = true; - } else if (paymentMethod.selectedPaymentMethodType === CONST.PAYMENT_METHODS.PAYPAL && _.isEmpty(props.payPalMeData)) { - shouldResetPaymentMethodData = true; } if (shouldResetPaymentMethodData) { // Close corresponding selected payment method modals which are open @@ -359,13 +335,11 @@ function BaseWalletPage(props) { hideDefaultDeleteMenu(); } } - }, [hideDefaultDeleteMenu, paymentMethod.methodID, paymentMethod.selectedPaymentMethodType, props.bankAccountList, props.fundList, props.payPalMeData, shouldShowDefaultDeleteMenu]); + }, [hideDefaultDeleteMenu, paymentMethod.methodID, paymentMethod.selectedPaymentMethodType, props.bankAccountList, props.fundList, shouldShowDefaultDeleteMenu]); - const isPayPalMeSelected = paymentMethod.formattedSelectedPaymentMethod.type === CONST.PAYMENT_METHODS.PAYPAL; const shouldShowMakeDefaultButton = !paymentMethod.isSelectedPaymentMethodDefault && Permissions.canUseWallet(props.betas) && - !isPayPalMeSelected && !(paymentMethod.formattedSelectedPaymentMethod.type === CONST.PAYMENT_METHODS.BANK_ACCOUNT && paymentMethod.selectedPaymentMethod.type === CONST.BANK_ACCOUNT.TYPE.BUSINESS); // Determines whether or not the modal popup is mounted from the bottom of the screen instead of the side mount on Web or Desktop screens @@ -438,14 +412,6 @@ function BaseWalletPage(props) { text={translate('walletPage.setDefaultConfirmation')} /> )} - {isPayPalMeSelected && ( -