Skip to content

Commit

Permalink
Merge pull request #27689 from kubabutkiewicz/ts-migration/Plaid-lib
Browse files Browse the repository at this point in the history
[No QA] [TS migration] Migrate 'Plaid.js' lib to TypeScript
  • Loading branch information
stitesExpensify authored Oct 3, 2023
2 parents dcf12b0 + e3802cf commit d913865
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions src/libs/actions/Plaid.js → src/libs/actions/Plaid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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',
{
Expand Down

0 comments on commit d913865

Please sign in to comment.