diff --git a/src/libs/actions/Plaid.js b/src/libs/actions/Plaid.ts similarity index 81% rename from src/libs/actions/Plaid.js rename to src/libs/actions/Plaid.ts index 53763980d285..410a8c57d176 100644 --- a/src/libs/actions/Plaid.js +++ b/src/libs/actions/Plaid.ts @@ -6,13 +6,15 @@ import * as PlaidDataProps from '../../pages/ReimbursementAccount/plaidDataPropT /** * Gets the Plaid Link token used to initialize the Plaid SDK - * @param {Boolean} allowDebit - * @param {Number} bankAccountID */ -function openPlaidBankLogin(allowDebit, bankAccountID) { - const params = getPlaidLinkTokenParameters(); - params.allowDebit = allowDebit; - params.bankAccountID = bankAccountID; +function openPlaidBankLogin(allowDebit: boolean, bankAccountID: number) { + // redirect_uri needs to be in kebab case convention because that's how it's passed to the backend + const {redirectURI} = getPlaidLinkTokenParameters(); + const params = { + redirectURI, + allowDebit, + bankAccountID, + }; const optimisticData = [ { onyxMethod: Onyx.METHOD.SET, @@ -36,13 +38,7 @@ function openPlaidBankLogin(allowDebit, bankAccountID) { API.read('OpenPlaidBankLogin', params, {optimisticData}); } -/** - * @param {String} publicToken - * @param {String} bankName - * @param {Boolean} allowDebit - * @param {Number} bankAccountID - */ -function openPlaidBankAccountSelector(publicToken, bankName, allowDebit, bankAccountID) { +function openPlaidBankAccountSelector(publicToken: string, bankName: string, allowDebit: boolean, bankAccountID: number) { API.read( 'OpenPlaidBankAccountSelector', {