Skip to content

Commit

Permalink
Merge pull request #6411 from Expensify/marcaaron-plaidLinkAndroid
Browse files Browse the repository at this point in the history
Get parameters for Plaid link token based on platform

(cherry picked from commit 890a8ef)
  • Loading branch information
marcochavezf authored and OSBotify committed Nov 29, 2021
1 parent 9ced996 commit 4b157cb
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/CONST.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
const CLOUDFRONT_URL = 'https://d2k5nsl2zxldvw.cloudfront.net';
const NEW_EXPENSIFY_URL = 'https://new.expensify.com';
const PLATFORM_OS_MACOS = 'Mac OS';
const ANDROID_PACKAGE_NAME = 'com.expensify.chat';

const CONST = {
ANDROID_PACKAGE_NAME,
ANIMATED_TRANSITION: 300,

// 50 megabytes in bytes
API_MAX_ATTACHMENT_SIZE: 52428800,
AVATAR_MAX_ATTACHMENT_SIZE: 3145728,
APP_DOWNLOAD_LINKS: {
ANDROID: 'https://play.google.com/store/apps/details?id=com.expensify.chat',
ANDROID: `https://play.google.com/store/apps/details?id=${ANDROID_PACKAGE_NAME}`,
IOS: 'https://apps.apple.com/us/app/expensify-cash/id1530278510',
DESKTOP: `${NEW_EXPENSIFY_URL}/NewExpensify.dmg`,
},
Expand Down Expand Up @@ -178,7 +180,7 @@ const CONST = {
TERMS_URL: 'https://use.expensify.com/terms',
PRIVACY_URL: 'https://use.expensify.com/privacy',
LICENSES_URL: 'https://use.expensify.com/licenses',
PLAY_STORE_URL: 'https://play.google.com/store/apps/details?id=com.expensify.chat&hl=en',
PLAY_STORE_URL: `https://play.google.com/store/apps/details?id=${ANDROID_PACKAGE_NAME}&hl=en`,
ADD_SECONDARY_LOGIN_URL: encodeURI('settings?param={"section":"account","openModal":"secondaryLogin"}'),
MANAGE_CARDS_URL: 'domain_companycards',
FEES_URL: 'https://use.expensify.com/fees',
Expand Down
3 changes: 2 additions & 1 deletion src/libs/API.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Onyx from 'react-native-onyx';
import CONST from '../CONST';
import CONFIG from '../CONFIG';
import ONYXKEYS from '../ONYXKEYS';
import getPlaidLinkTokenParameters from './getPlaidLinkTokenParameters';
import redirectToSignIn from './actions/SignInRedirect';
import isViaExpensifyCashNative from './isViaExpensifyCashNative';
import requireParameters from './requireParameters';
Expand Down Expand Up @@ -864,7 +865,7 @@ function Wallet_GetOnfidoSDKToken() {
* @returns {Promise}
*/
function Plaid_GetLinkToken() {
return Network.post('Plaid_GetLinkToken', {}, CONST.NETWORK.METHOD.POST, true);
return Network.post('Plaid_GetLinkToken', getPlaidLinkTokenParameters(), CONST.NETWORK.METHOD.POST, true);
}

/**
Expand Down
3 changes: 3 additions & 0 deletions src/libs/getPlaidLinkTokenParameters/index.android.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import CONST from '../../CONST';

export default () => ({android_name: CONST.ANDROID_PACKAGE_NAME});
3 changes: 3 additions & 0 deletions src/libs/getPlaidLinkTokenParameters/index.ios.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import CONFIG from '../../CONFIG';

export default () => ({redirect_uri: `${CONFIG.EXPENSIFY.URL_EXPENSIFY_CASH}partners/plaid/oauth_ios`});
1 change: 1 addition & 0 deletions src/libs/getPlaidLinkTokenParameters/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default () => ({});
1 change: 0 additions & 1 deletion src/pages/ReimbursementAccount/BankAccountStep.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ class BankAccountStep extends React.Component {
text={this.props.translate('bankAccount.plaidBodyCopy')}
onSubmit={this.addPlaidAccount}
onExitPlaid={() => BankAccounts.setBankAccountSubStep(null)}

/>
)}
{subStep === CONST.BANK_ACCOUNT.SETUP_TYPE.MANUAL && (
Expand Down

0 comments on commit 4b157cb

Please sign in to comment.