From 99ff7406c0ad74083539181f384686e051f2dde6 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Thu, 30 Jun 2022 23:42:04 +0200 Subject: [PATCH 1/7] Removing the Venmo payment option --- src/components/ButtonWithMenu.js | 2 +- src/components/SettlementButton.js | 56 ------------------------------ src/libs/actions/IOU.js | 17 +-------- src/pages/iou/IOUDetailsModal.js | 9 ----- src/pages/iou/IOUModal.js | 1 - 5 files changed, 2 insertions(+), 83 deletions(-) diff --git a/src/components/ButtonWithMenu.js b/src/components/ButtonWithMenu.js index e9fafa75095e..5e20ce5c2c1c 100644 --- a/src/components/ButtonWithMenu.js +++ b/src/components/ButtonWithMenu.js @@ -21,7 +21,7 @@ const propTypes = { isDisabled: PropTypes.bool, /** Menu options to display */ - /** e.g. [{text: 'Pay with Expensify', icon: Wallet}, {text: 'PayPal', icon: PayPal}, {text: 'Venmo', icon: Venmo}] */ + /** e.g. [{text: 'Pay with Expensify', icon: Wallet}, {text: 'PayPal', icon: PayPal}] */ options: PropTypes.arrayOf(PropTypes.shape({ value: PropTypes.string.isRequired, text: PropTypes.string.isRequired, diff --git a/src/components/SettlementButton.js b/src/components/SettlementButton.js index 2997d2cadc60..5c31191dbce2 100644 --- a/src/components/SettlementButton.js +++ b/src/components/SettlementButton.js @@ -24,15 +24,11 @@ const propTypes = { /** Should we show paypal option */ shouldShowPaypal: PropTypes.bool, - /** Associated phone login for the person we are sending money to */ - recipientPhoneNumber: PropTypes.string, - ...withLocalizePropTypes, }; const defaultProps = { currency: CONST.CURRENCY.USD, - recipientPhoneNumber: '', shouldShowPaypal: false, }; @@ -64,63 +60,11 @@ class SettlementButton extends React.Component { value: CONST.IOU.PAYMENT_TYPE.ELSEWHERE, }); - // Venmo requires an async call to the native layer to determine availability and will be added as an option if available. - this.checkVenmoAvailabilityPromise = null; - this.state = { buttonOptions, }; } - componentDidMount() { - this.addVenmoPaymentOptionToMenu(); - } - - componentWillUnmount() { - if (!this.checkVenmoAvailabilityPromise) { - return; - } - - this.checkVenmoAvailabilityPromise.cancel(); - this.checkVenmoAvailabilityPromise = null; - } - - /** - * @returns {Boolean} - */ - doesRecipientHaveValidPhoneLogin() { - return this.props.recipientPhoneNumber && ValidationUtils.isValidUSPhone(this.props.recipientPhoneNumber); - } - - /** - * Adds Venmo, if available, as the second option in the menu of payment options - */ - addVenmoPaymentOptionToMenu() { - if (this.props.currency !== CONST.CURRENCY.USD || !this.doesRecipientHaveValidPhoneLogin()) { - return; - } - - this.checkVenmoAvailabilityPromise = makeCancellablePromise(isAppInstalled('venmo')); - this.checkVenmoAvailabilityPromise - .promise - .then((isVenmoInstalled) => { - if (!isVenmoInstalled) { - return; - } - - this.setState(prevState => ({ - buttonOptions: [...prevState.buttonOptions.slice(0, 1), - { - text: this.props.translate('iou.settleVenmo'), - icon: Expensicons.Venmo, - value: CONST.IOU.PAYMENT_TYPE.VENMO, - }, - ...prevState.buttonOptions.slice(1), - ], - })); - }); - } - render() { return ( { diff --git a/src/pages/iou/IOUDetailsModal.js b/src/pages/iou/IOUDetailsModal.js index bd406810dc73..0835558d4423 100644 --- a/src/pages/iou/IOUDetailsModal.js +++ b/src/pages/iou/IOUDetailsModal.js @@ -91,13 +91,6 @@ class IOUDetailsModal extends Component { this.fetchData(); } - /** - * @returns {String} - */ - getSubmitterPhoneNumber() { - return _.first(lodashGet(this.props, 'iouReport.submitterPhoneNumbers', [])) || ''; - } - fetchData() { Report.fetchIOUReportByID(this.props.route.params.iouReportID, this.props.route.params.chatReportID, true); } @@ -113,7 +106,6 @@ class IOUDetailsModal extends Component { amount: this.props.iouReport.total, currency: this.props.iouReport.currency, requestorPayPalMeAddress: this.props.iouReport.submitterPayPalMeAddress, - requestorPhoneNumber: this.getSubmitterPhoneNumber(), }); } @@ -148,7 +140,6 @@ class IOUDetailsModal extends Component { this.performIOUPayment(paymentMethodType)} - recipientPhoneNumber={this.getSubmitterPhoneNumber()} shouldShowPaypal={Boolean(lodashGet(this.props, 'iouReport.submitterPayPalMeAddress'))} currency={lodashGet(this.props, 'iouReport.currency')} enablePaymentsRoute={ROUTES.IOU_DETAILS_ENABLE_PAYMENTS} diff --git a/src/pages/iou/IOUModal.js b/src/pages/iou/IOUModal.js index 561b8a328364..7a187fd56d77 100755 --- a/src/pages/iou/IOUModal.js +++ b/src/pages/iou/IOUModal.js @@ -302,7 +302,6 @@ class IOUModal extends Component { amount, currency, requestorPayPalMeAddress: this.state.participants[0].payPalMeAddress, - requestorPhoneNumber: this.state.participants[0].phoneNumber, comment, newIOUReportDetails, }) From 35b93ad5ccfd851894d06a00301aca8cfa6c3b97 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Thu, 30 Jun 2022 23:47:48 +0200 Subject: [PATCH 2/7] Removing other mentions of Venmo --- src/components/IOUConfirmationList.js | 1 - src/languages/en.js | 1 - src/languages/es.js | 1 - src/stories/ButtonWithDropdown.stories.js | 2 +- 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/components/IOUConfirmationList.js b/src/components/IOUConfirmationList.js index 96b26834f616..6f14ab005268 100755 --- a/src/components/IOUConfirmationList.js +++ b/src/components/IOUConfirmationList.js @@ -370,7 +370,6 @@ class IOUConfirmationList extends Component { isLoading={isLoading} onPress={this.confirm} shouldShowPaypal={Boolean(recipient.payPalMeAddress)} - recipientPhoneNumber={recipient.phoneNumber} enablePaymentsRoute={ROUTES.IOU_SEND_ENABLE_PAYMENTS} addBankAccountRoute={ROUTES.IOU_SEND_ADD_BANK_ACCOUNT} addDebitCardRoute={ROUTES.IOU_SEND_ADD_DEBIT_CARD} diff --git a/src/languages/en.js b/src/languages/en.js index 02bf873c3a9d..4f1579aafaf5 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -228,7 +228,6 @@ export default { settleExpensify: 'Pay with Expensify', settleElsewhere: 'I\'ll settle up elsewhere', settlePaypalMe: 'Pay with PayPal.me', - settleVenmo: 'Pay with Venmo', request: ({amount}) => `Request ${amount}`, youowe: ({owner}) => `You owe ${owner}`, youpaid: ({owner}) => `You paid ${owner}`, diff --git a/src/languages/es.js b/src/languages/es.js index d7751c630de9..fc4f6671b249 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -228,7 +228,6 @@ export default { settleExpensify: 'Pagar con Expensify', settleElsewhere: 'Voy a pagar de otra forma', settlePaypalMe: 'Pagar con PayPal.me', - settleVenmo: 'Pagar con Venmo', request: ({amount}) => `Solicitar ${amount}`, youowe: ({owner}) => `Le debes a ${owner}`, youpaid: ({owner}) => `Le pagaste a ${owner}`, diff --git a/src/stories/ButtonWithDropdown.stories.js b/src/stories/ButtonWithDropdown.stories.js index 5007649ed87f..9073a77e43b4 100644 --- a/src/stories/ButtonWithDropdown.stories.js +++ b/src/stories/ButtonWithDropdown.stories.js @@ -18,7 +18,7 @@ const Template = args => ; // See: https://storybook.js.org/docs/react/writing-stories/introduction#using-args const Default = Template.bind({}); Default.args = { - buttonText: 'Pay with Venmo', + buttonText: 'Pay with PayPal.me', }; export default story; From 4af229f7e6bcd9ab59addbc0b0577741659ef3a2 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Fri, 1 Jul 2022 00:06:39 +0200 Subject: [PATCH 3/7] Remove the Venmo query from Android manifesto --- android/app/src/main/AndroidManifest.xml | 9 --------- src/components/SettlementButton.js | 3 --- 2 files changed, 12 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 912aa6d5a9b0..a5d23081f6f2 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -7,15 +7,6 @@ - - - - - - - - Date: Fri, 1 Jul 2022 14:50:51 +0200 Subject: [PATCH 4/7] Remove the last Venmo mentions --- src/CONST.js | 1 - src/components/Icon/Expensicons.js | 2 -- src/languages/en.js | 2 -- src/languages/es.js | 2 -- src/pages/settings/Profile/LoginField.js | 9 +-------- 5 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/CONST.js b/src/CONST.js index 6d16d862b46d..56fe605c6de0 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -607,7 +607,6 @@ const CONST = { ELSEWHERE: 'Elsewhere', EXPENSIFY: 'Expensify', PAYPAL_ME: 'PayPal.me', - VENMO: 'Venmo', }, IOU_TYPE: { SEND: 'send', diff --git a/src/components/Icon/Expensicons.js b/src/components/Icon/Expensicons.js index 0b11a5602b13..9c64691a2220 100644 --- a/src/components/Icon/Expensicons.js +++ b/src/components/Icon/Expensicons.js @@ -70,7 +70,6 @@ import Trashcan from '../../../assets/images/trashcan.svg'; import UpArrow from '../../../assets/images/arrow-up.svg'; import Upload from '../../../assets/images/upload.svg'; import Users from '../../../assets/images/users.svg'; -import Venmo from '../../../assets/images/venmo.svg'; import Wallet from '../../../assets/images/wallet.svg'; import Workspace from '../../../assets/images/workspace-default-avatar.svg'; import ActiveRoomAvatar from '../../../assets/images/avatars/room.svg'; @@ -163,7 +162,6 @@ export { UpArrow, Upload, Users, - Venmo, Wallet, Workspace, }; diff --git a/src/languages/en.js b/src/languages/en.js index 4f1579aafaf5..c7c5e02fb320 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -248,9 +248,7 @@ export default { mute: 'Mute', }, loginField: { - addYourPhoneToSettleViaVenmo: 'Add your phone number to settle up via Venmo.', numberHasNotBeenValidated: 'The number has not yet been validated. Click the button to resend the validation link via text.', - useYourPhoneToSettleViaVenmo: 'Use your phone number to settle up via Venmo.', emailHasNotBeenValidated: 'The email has not yet been validated. Click the button to resend the validation link via text.', }, avatarWithImagePicker: { diff --git a/src/languages/es.js b/src/languages/es.js index fc4f6671b249..2f6de2f62570 100644 --- a/src/languages/es.js +++ b/src/languages/es.js @@ -248,9 +248,7 @@ export default { mute: 'Nunca', }, loginField: { - addYourPhoneToSettleViaVenmo: 'Agrega tu número de teléfono para pagar usando Venmo.', numberHasNotBeenValidated: 'El número no está validado todavía. Haz click en el botón para reenviar el enlace de confirmación via SMS.', - useYourPhoneToSettleViaVenmo: 'Usa tu número de teléfono para pagar usando Venmo.', emailHasNotBeenValidated: 'El email no está validado todavía. Haz click en el botón para reenviar el enlace de confirmación via email.', }, avatarWithImagePicker: { diff --git a/src/pages/settings/Profile/LoginField.js b/src/pages/settings/Profile/LoginField.js index 161222ae7ec9..2425a2a7bc42 100755 --- a/src/pages/settings/Profile/LoginField.js +++ b/src/pages/settings/Profile/LoginField.js @@ -77,17 +77,10 @@ class LoginField extends Component { render() { let note; if (this.props.type === CONST.LOGIN_TYPE.PHONE) { - // No phone number - if (!this.props.login.partnerUserID) { - note = this.props.translate('loginField.addYourPhoneToSettleViaVenmo'); // Has unvalidated phone number - } else if (!this.props.login.validatedDate) { + if (!this.props.login.validatedDate) { note = this.props.translate('loginField.numberHasNotBeenValidated'); - - // Has verified phone number - } else { - note = this.props.translate('loginField.useYourPhoneToSettleViaVenmo'); } // Has unvalidated email From bbe1815c11c2e48fb26614ead66f6c666c05044a Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Tue, 5 Jul 2022 21:39:47 +0100 Subject: [PATCH 5/7] Update the note condition --- src/pages/settings/Profile/LoginField.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/settings/Profile/LoginField.js b/src/pages/settings/Profile/LoginField.js index 2425a2a7bc42..a23a5f3ac8d0 100755 --- a/src/pages/settings/Profile/LoginField.js +++ b/src/pages/settings/Profile/LoginField.js @@ -77,9 +77,8 @@ class LoginField extends Component { render() { let note; if (this.props.type === CONST.LOGIN_TYPE.PHONE) { - // Has unvalidated phone number - if (!this.props.login.validatedDate) { + if (this.props.login.partnerUserID && !this.props.login.validatedDate) { note = this.props.translate('loginField.numberHasNotBeenValidated'); } From 2cdb16956fdefaad06a0e868101210739a3165f4 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Wed, 6 Jul 2022 23:40:42 +0100 Subject: [PATCH 6/7] Remove the Venmo svg file --- assets/images/venmo.svg | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 assets/images/venmo.svg diff --git a/assets/images/venmo.svg b/assets/images/venmo.svg deleted file mode 100644 index 9c5a87901056..000000000000 --- a/assets/images/venmo.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - From 77bc7d771bdfa8d45a9810ee3e940ad4fad1549b Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Thu, 7 Jul 2022 11:18:31 +0100 Subject: [PATCH 7/7] Remove unused isAppInstalled --- src/libs/isAppInstalled/index.js | 10 ---------- src/libs/isAppInstalled/index.native.js | 19 ------------------- 2 files changed, 29 deletions(-) delete mode 100644 src/libs/isAppInstalled/index.js delete mode 100644 src/libs/isAppInstalled/index.native.js diff --git a/src/libs/isAppInstalled/index.js b/src/libs/isAppInstalled/index.js deleted file mode 100644 index dadcd8de0d34..000000000000 --- a/src/libs/isAppInstalled/index.js +++ /dev/null @@ -1,10 +0,0 @@ -/** - * Returns always false for other platforms - * - * @returns {Promise} - */ -export default function isAppInstalled() { - return new Promise((resolve) => { - resolve(false); - }); -} diff --git a/src/libs/isAppInstalled/index.native.js b/src/libs/isAppInstalled/index.native.js deleted file mode 100644 index c2b66ca70fed..000000000000 --- a/src/libs/isAppInstalled/index.native.js +++ /dev/null @@ -1,19 +0,0 @@ -import {Linking} from 'react-native'; - -/** - * Gets the URLSchema and check the existence of that application - * - * @param {String} urlScheme - * @returns {Promise} - */ -export default function isAppInstalled(urlScheme) { - return new Promise((resolve, reject) => { - Linking.canOpenURL(`${urlScheme}://`) - .then((isInstalled) => { - resolve(isInstalled); - }) - .catch((error) => { - reject(error); - }); - }); -}