From 747c18548d21b2b486a88a95606fae9f5146fe96 Mon Sep 17 00:00:00 2001 From: Jasper Huang Date: Tue, 1 Jun 2021 12:36:43 +0800 Subject: [PATCH 1/2] Revert "[HOLD Auth 5613] [IOU] Pay with Expensify option" --- src/CONST.js | 1 - src/languages/en.js | 1 - src/libs/API.js | 12 ------------ src/libs/actions/IOU.js | 10 +++++----- src/pages/iou/IOUDetailsModal.js | 18 ------------------ 5 files changed, 5 insertions(+), 37 deletions(-) diff --git a/src/CONST.js b/src/CONST.js index e64be27b1dd7..808d364b87bd 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -167,7 +167,6 @@ const CONST = { // not be changed. PAYMENT_TYPE: { ELSEWHERE: 'Elsewhere', - EXPENSIFY: 'Expensify', PAYPAL_ME: 'PayPal.me', VENMO: 'Venmo', }, diff --git a/src/languages/en.js b/src/languages/en.js index 49cdf1fc16ea..3013f21ad119 100755 --- a/src/languages/en.js +++ b/src/languages/en.js @@ -108,7 +108,6 @@ export default { pay: 'Pay', viewDetails: 'View Details', settleElsewhere: 'I\'ll settle up elsewhere', - settleExpensify: 'Pay with Expensify', settlePaypalMe: 'Pay with PayPal.me', settleVenmo: 'Pay with Venmo', request: ({amount}) => `Request ${amount}`, diff --git a/src/libs/API.js b/src/libs/API.js index 0643de20f78c..36ab90483c5a 100644 --- a/src/libs/API.js +++ b/src/libs/API.js @@ -455,17 +455,6 @@ function PayIOU(parameters) { return Network.post(commandName, parameters); } -/** - * @param {Object} parameters - * @param {Number} parameters.reportID - * @returns {Promise} - */ -function PayWithWallet(parameters) { - const commandName = 'PayWithWallet'; - requireParameters(['reportID'], parameters, commandName); - return Network.post(commandName, parameters); -} - /** * @param {Object} parameters * @param {String} parameters.emailList @@ -811,7 +800,6 @@ export { Graphite_Timer, Log, PayIOU, - PayWithWallet, PersonalDetails_GetForEmails, PersonalDetails_Update, Plaid_GetLinkToken, diff --git a/src/libs/actions/IOU.js b/src/libs/actions/IOU.js index 54a6410ae444..8c01fdaa7e14 100644 --- a/src/libs/actions/IOU.js +++ b/src/libs/actions/IOU.js @@ -153,10 +153,10 @@ function payIOUReport({ chatReportID, reportID, paymentMethodType, amount, currency, submitterPhoneNumber, submitterPayPalMeAddress, }) { Onyx.merge(ONYXKEYS.IOU, {loading: true, error: false}); - const payIOUPromise = paymentMethodType === CONST.IOU.PAYMENT_TYPE.EXPENSIFY - ? API.PayWithWallet({reportID}) - : API.PayIOU({reportID, paymentMethodType}); - payIOUPromise + API.PayIOU({ + reportID, + paymentMethodType, + }) .then((response) => { if (response.jsonCode !== 200) { throw new Error(response.message); @@ -171,7 +171,7 @@ function payIOUReport({ fetchIOUReportByIDAndUpdateChatReport(reportID, chatReportID); // Once we have successfully paid the IOU we will transfer the user to their platform of choice if they have - // selected something other than a manual settlement or Expensify Wallet e.g. Venmo or PayPal.me + // selected something other than a manual settlement e.g. Venmo or PayPal.me if (paymentMethodType === CONST.IOU.PAYMENT_TYPE.PAYPAL_ME) { openURLInNewTab(buildPayPalPaymentUrl(amount, submitterPayPalMeAddress, currency)); } else if (paymentMethodType === CONST.IOU.PAYMENT_TYPE.VENMO) { diff --git a/src/pages/iou/IOUDetailsModal.js b/src/pages/iou/IOUDetailsModal.js index 3716f4dfd91d..39e3d03bdde9 100644 --- a/src/pages/iou/IOUDetailsModal.js +++ b/src/pages/iou/IOUDetailsModal.js @@ -102,7 +102,6 @@ class IOUDetailsModal extends Component { this.isComponentMounted = true; fetchIOUReportByID(this.props.route.params.iouReportID, this.props.route.params.chatReportID); this.addVenmoPaymentOptionIfAvailable(); - this.addExpensifyPaymentOptionIfAvailable(); } componentWillUnmount() { @@ -174,27 +173,10 @@ class IOUDetailsModal extends Component { }); } - /** - * Checks to see if we can use Expensify. - * The report currency must be USD. - */ - addExpensifyPaymentOptionIfAvailable() { - if (lodashGet(this.props, 'iouReport.currency') !== CONST.CURRENCY.USD) { - return; - } - - // Make it the first payment option and set it as the default. - this.setState(prevState => ({ - paymentOptions: [CONST.IOU.PAYMENT_TYPE.EXPENSIFY, ...prevState.paymentOptions], - paymentType: CONST.IOU.PAYMENT_TYPE.EXPENSIFY, - })); - } - render() { const sessionEmail = lodashGet(this.props.session, 'email', null); const reportIsLoading = _.isUndefined(this.props.iouReport); const paymentTypeTextOptions = { - [CONST.IOU.PAYMENT_TYPE.EXPENSIFY]: this.props.translate('iou.settleExpensify'), [CONST.IOU.PAYMENT_TYPE.VENMO]: this.props.translate('iou.settleVenmo'), [CONST.IOU.PAYMENT_TYPE.PAYPAL_ME]: this.props.translate('iou.settlePaypalMe'), [CONST.IOU.PAYMENT_TYPE.ELSEWHERE]: this.props.translate('iou.settleElsewhere'), From 8ee0179407f8ff89eac08724bc0d7d3738cdaa0b Mon Sep 17 00:00:00 2001 From: OSBotify Date: Tue, 1 Jun 2021 05:40:46 +0000 Subject: [PATCH 2/2] Update version to 1.0.58-2 --- android/app/build.gradle | 4 ++-- ios/ExpensifyCash/Info.plist | 2 +- ios/ExpensifyCashTests/Info.plist | 2 +- package-lock.json | 2 +- package.json | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index c978f8121c08..b5c564d0290a 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -148,8 +148,8 @@ android { minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion multiDexEnabled rootProject.ext.multiDexEnabled - versionCode 1001005801 - versionName "1.0.58-1" + versionCode 1001005802 + versionName "1.0.58-2" } splits { abi { diff --git a/ios/ExpensifyCash/Info.plist b/ios/ExpensifyCash/Info.plist index 9914bf006867..390dc9a41eab 100644 --- a/ios/ExpensifyCash/Info.plist +++ b/ios/ExpensifyCash/Info.plist @@ -30,7 +30,7 @@ CFBundleVersion - 1.0.58.1 + 1.0.58.2 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes diff --git a/ios/ExpensifyCashTests/Info.plist b/ios/ExpensifyCashTests/Info.plist index 34fa96b5b6b1..68cc4aaa6014 100644 --- a/ios/ExpensifyCashTests/Info.plist +++ b/ios/ExpensifyCashTests/Info.plist @@ -19,6 +19,6 @@ CFBundleSignature ???? CFBundleVersion - 1.0.58.1 + 1.0.58.2 diff --git a/package-lock.json b/package-lock.json index 92005089330a..09f864f39082 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "expensify.cash", - "version": "1.0.58-1", + "version": "1.0.58-2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index a0723ac93ca5..c388d2107116 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "expensify.cash", - "version": "1.0.58-1", + "version": "1.0.58-2", "author": "Expensify, Inc.", "homepage": "https://expensify.cash", "description": "Expensify.cash is the next generation of Expensify: a reimagination of payments based atop a foundation of chat.",