Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get parameters for Plaid link token based on platform #6411

Merged
merged 6 commits into from
Nov 29, 2021
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
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`});
nickmurray47 marked this conversation as resolved.
Show resolved Hide resolved
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