diff --git a/src/libs/getPlaidLinkTokenParameters/index.android.js b/src/libs/getPlaidLinkTokenParameters/index.android.js deleted file mode 100644 index 4174e2b8905b..000000000000 --- a/src/libs/getPlaidLinkTokenParameters/index.android.js +++ /dev/null @@ -1,3 +0,0 @@ -import CONST from '../../CONST'; - -export default () => ({android_package: CONST.ANDROID_PACKAGE_NAME}); diff --git a/src/libs/getPlaidLinkTokenParameters/index.android.ts b/src/libs/getPlaidLinkTokenParameters/index.android.ts new file mode 100644 index 000000000000..39d444abdba2 --- /dev/null +++ b/src/libs/getPlaidLinkTokenParameters/index.android.ts @@ -0,0 +1,8 @@ +import CONST from '../../CONST'; +import GetPlaidLinkTokenParameters from './types'; + +const getPlaidLinkTokenParameters: GetPlaidLinkTokenParameters = () => ({ + androidPackage: CONST.ANDROID_PACKAGE_NAME, +}); + +export default getPlaidLinkTokenParameters; diff --git a/src/libs/getPlaidLinkTokenParameters/index.ios.js b/src/libs/getPlaidLinkTokenParameters/index.ios.js deleted file mode 100644 index 88032c582d17..000000000000 --- a/src/libs/getPlaidLinkTokenParameters/index.ios.js +++ /dev/null @@ -1,3 +0,0 @@ -import CONFIG from '../../CONFIG'; - -export default () => ({redirect_uri: `${CONFIG.EXPENSIFY.NEW_EXPENSIFY_URL}partners/plaid/oauth_ios`}); diff --git a/src/libs/getPlaidLinkTokenParameters/index.ios.ts b/src/libs/getPlaidLinkTokenParameters/index.ios.ts new file mode 100644 index 000000000000..330efad4839a --- /dev/null +++ b/src/libs/getPlaidLinkTokenParameters/index.ios.ts @@ -0,0 +1,8 @@ +import CONFIG from '../../CONFIG'; +import GetPlaidLinkTokenParameters from './types'; + +const getPlaidLinkTokenParameters: GetPlaidLinkTokenParameters = () => ({ + redirectURI: `${CONFIG.EXPENSIFY.NEW_EXPENSIFY_URL}partners/plaid/oauth_ios`, +}); + +export default getPlaidLinkTokenParameters; diff --git a/src/libs/getPlaidLinkTokenParameters/index.js b/src/libs/getPlaidLinkTokenParameters/index.js deleted file mode 100644 index cd15926ee3e6..000000000000 --- a/src/libs/getPlaidLinkTokenParameters/index.js +++ /dev/null @@ -1,7 +0,0 @@ -import ROUTES from '../../ROUTES'; -import CONFIG from '../../CONFIG'; - -export default () => { - const bankAccountRoute = window.location.href.includes('personal') ? ROUTES.BANK_ACCOUNT_PERSONAL : ROUTES.BANK_ACCOUNT; - return {redirect_uri: `${CONFIG.EXPENSIFY.NEW_EXPENSIFY_URL}${bankAccountRoute}`}; -}; diff --git a/src/libs/getPlaidLinkTokenParameters/index.ts b/src/libs/getPlaidLinkTokenParameters/index.ts new file mode 100644 index 000000000000..e47629e85d09 --- /dev/null +++ b/src/libs/getPlaidLinkTokenParameters/index.ts @@ -0,0 +1,11 @@ +import ROUTES from '../../ROUTES'; +import CONFIG from '../../CONFIG'; +import GetPlaidLinkTokenParameters from './types'; + +const getPlaidLinkTokenParameters: GetPlaidLinkTokenParameters = () => { + const bankAccountRoute = window.location.href.includes('personal') ? ROUTES.BANK_ACCOUNT_PERSONAL : ROUTES.BANK_ACCOUNT; + + return {redirectURI: `${CONFIG.EXPENSIFY.NEW_EXPENSIFY_URL}${bankAccountRoute}`}; +}; + +export default getPlaidLinkTokenParameters; diff --git a/src/libs/getPlaidLinkTokenParameters/types.ts b/src/libs/getPlaidLinkTokenParameters/types.ts new file mode 100644 index 000000000000..1fd0eb51017f --- /dev/null +++ b/src/libs/getPlaidLinkTokenParameters/types.ts @@ -0,0 +1,10 @@ +type PlaidLinkTokenParameters = { + androidPackage?: string; + redirectURI?: string; + allowDebit?: boolean; + bankAccountID?: number; +}; + +type GetPlaidLinkTokenParameters = () => PlaidLinkTokenParameters; + +export default GetPlaidLinkTokenParameters;