Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

<!-- To provide a link to services in other apps
that target Android 11+ we need to add the following -->
<queries>
<intent>
<action android:name="android.intent.action.VIEW"/>
<data android:scheme="venmo"/>
</intent>
</queries>

<application
android:supportsRtl="false"
android:name=".MainApplication"
Expand Down
11 changes: 0 additions & 11 deletions assets/images/venmo.svg

This file was deleted.

1 change: 0 additions & 1 deletion src/CONST.js
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,6 @@ const CONST = {
ELSEWHERE: 'Elsewhere',
EXPENSIFY: 'Expensify',
PAYPAL_ME: 'PayPal.me',
VENMO: 'Venmo',
},
IOU_TYPE: {
SEND: 'send',
Expand Down
2 changes: 1 addition & 1 deletion src/components/ButtonWithMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion src/components/IOUConfirmationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ class IOUConfirmationList extends Component {
isLoading={isLoading}
onPress={this.confirm}
shouldShowPaypal={Boolean(recipient.payPalMeAddress)}
recipientPhoneNumber={recipient.phoneNumber}
Comment thread
Luke9389 marked this conversation as resolved.
enablePaymentsRoute={ROUTES.IOU_SEND_ENABLE_PAYMENTS}
addBankAccountRoute={ROUTES.IOU_SEND_ADD_BANK_ACCOUNT}
addDebitCardRoute={ROUTES.IOU_SEND_ADD_DEBIT_CARD}
Expand Down
2 changes: 0 additions & 2 deletions src/components/Icon/Expensicons.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Comment thread
mountiny marked this conversation as resolved.
import Wallet from '../../../assets/images/wallet.svg';
import Workspace from '../../../assets/images/workspace-default-avatar.svg';
import ActiveRoomAvatar from '../../../assets/images/avatars/room.svg';
Expand Down Expand Up @@ -163,7 +162,6 @@ export {
UpArrow,
Upload,
Users,
Venmo,
Wallet,
Workspace,
};
59 changes: 0 additions & 59 deletions src/components/SettlementButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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,
};

Expand Down Expand Up @@ -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'));
Comment thread
mountiny marked this conversation as resolved.
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 (
<KYCWall
Expand Down
3 changes: 0 additions & 3 deletions src/languages/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
Expand All @@ -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: {
Expand Down
3 changes: 0 additions & 3 deletions src/languages/es.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
Expand All @@ -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: {
Expand Down
17 changes: 1 addition & 16 deletions src/libs/actions/IOU.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)}&note=${note}`;
}

/**
* @param {Number} amount
* @param {String} submitterPayPalMeAddress
Expand All @@ -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
*
Expand All @@ -288,7 +277,6 @@ function payIOUReport({
paymentMethodType,
amount,
currency,
requestorPhoneNumber,
requestorPayPalMeAddress,
newIOUReportDetails,
}) {
Expand All @@ -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) => {
Expand Down
10 changes: 0 additions & 10 deletions src/libs/isAppInstalled/index.js

This file was deleted.

19 changes: 0 additions & 19 deletions src/libs/isAppInstalled/index.native.js

This file was deleted.

9 changes: 0 additions & 9 deletions src/pages/iou/IOUDetailsModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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(),
});
}

Expand Down Expand Up @@ -148,7 +140,6 @@ class IOUDetailsModal extends Component {
<SettlementButton
isLoading={this.props.iou.loading}
onPress={paymentMethodType => 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}
Expand Down
1 change: 0 additions & 1 deletion src/pages/iou/IOUModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ class IOUModal extends Component {
amount,
currency,
requestorPayPalMeAddress: this.state.participants[0].payPalMeAddress,
requestorPhoneNumber: this.state.participants[0].phoneNumber,
comment,
newIOUReportDetails,
})
Expand Down
10 changes: 1 addition & 9 deletions src/pages/settings/Profile/LoginField.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/stories/ButtonWithDropdown.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const Template = args => <ButtonWithDropdown {...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;
Expand Down