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 @@ - - - - - - - - - - - - - - diff --git a/src/CONST.js b/src/CONST.js index 96fe7084239e..5dbb241e1a25 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/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/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/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/components/SettlementButton.js b/src/components/SettlementButton.js index 2997d2cadc60..8c5cb28d9814 100644 --- a/src/components/SettlementButton.js +++ b/src/components/SettlementButton.js @@ -5,9 +5,6 @@ import {withNavigation} from '@react-navigation/compat'; import ButtonWithMenu from './ButtonWithMenu'; import * as Expensicons from './Icon/Expensicons'; import Permissions from '../libs/Permissions'; -import isAppInstalled from '../libs/isAppInstalled'; -import * as ValidationUtils from '../libs/ValidationUtils'; -import makeCancellablePromise from '../libs/MakeCancellablePromise'; import ONYXKEYS from '../ONYXKEYS'; import CONST from '../CONST'; import compose from '../libs/compose'; @@ -24,15 +21,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 +57,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 ( `Request ${amount}`, youowe: ({owner}) => `You owe ${owner}`, youpaid: ({owner}) => `You paid ${owner}`, @@ -249,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 b63908a51bf1..7d0b871cde5d 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}`, @@ -249,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/libs/actions/IOU.js b/src/libs/actions/IOU.js index 1a6bb323be82..55d4a019b95a 100644 --- a/src/libs/actions/IOU.js +++ b/src/libs/actions/IOU.js @@ -247,16 +247,6 @@ function setIOUSelectedCurrency(selectedCurrencyCode) { Onyx.merge(ONYXKEYS.IOU, {selectedCurrencyCode}); } -/** - * @param {Number} amount - * @param {String} submitterPhoneNumber - * @returns {String} - */ -function buildVenmoPaymentURL(amount, submitterPhoneNumber) { - const note = encodeURIComponent('For New Expensify request'); - return `venmo://paycharge?txn=pay&recipients=${submitterPhoneNumber}&amount=${(amount / 100)}¬e=${note}`; -} - /** * @param {Number} amount * @param {String} submitterPayPalMeAddress @@ -276,7 +266,6 @@ function buildPayPalPaymentUrl(amount, submitterPayPalMeAddress, currency) { * @param {String} params.paymentMethodType - one of CONST.IOU.PAYMENT_TYPE * @param {Number} params.amount * @param {String} params.currency - * @param {String} [params.requestorPhoneNumber] - used for Venmo * @param {String} [params.requestorPayPalMeAddress] * @param {String} [params.newIOUReportDetails] - Extra details required only for send money flow * @@ -288,7 +277,6 @@ function payIOUReport({ paymentMethodType, amount, currency, - requestorPhoneNumber, requestorPayPalMeAddress, newIOUReportDetails, }) { @@ -298,14 +286,11 @@ function payIOUReport({ ? DeprecatedAPI.PayWithWallet({reportID, newIOUReportDetails}) : DeprecatedAPI.PayIOU({reportID, paymentMethodType, newIOUReportDetails}); - // Build the url for the user's platform of choice if they have selected something other than a manual settlement or Expensify Wallet e.g. Venmo or PayPal.me + // Build the url for Paypal.me if they have selected it instead of a manual settlement or Expensify Wallet let url; if (paymentMethodType === CONST.IOU.PAYMENT_TYPE.PAYPAL_ME) { url = buildPayPalPaymentUrl(amount, requestorPayPalMeAddress, currency); } - if (paymentMethodType === CONST.IOU.PAYMENT_TYPE.VENMO) { - url = buildVenmoPaymentURL(amount, requestorPhoneNumber); - } const promiseWithHandlers = payIOUPromise .then((response) => { 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); - }); - }); -} 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, }) diff --git a/src/pages/settings/Profile/LoginField.js b/src/pages/settings/Profile/LoginField.js index 161222ae7ec9..a23a5f3ac8d0 100755 --- a/src/pages/settings/Profile/LoginField.js +++ b/src/pages/settings/Profile/LoginField.js @@ -77,17 +77,9 @@ 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.partnerUserID && !this.props.login.validatedDate) { note = this.props.translate('loginField.numberHasNotBeenValidated'); - - // Has verified phone number - } else { - note = this.props.translate('loginField.useYourPhoneToSettleViaVenmo'); } // Has unvalidated email 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;