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

[CP Staging] [NO QA]: Add bank urls to Company Card flow #51384

Merged
merged 7 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 2 additions & 0 deletions src/CONST.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ const CONST = {
BILLABLE: 'billable',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, did you test atleast on one platform ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah

Screen.Recording.2024-10-24.at.11.44.11.mov

NON_BILLABLE: 'nonBillable',
},
COMPANY_CARD_DOMAIN_NAME: 'expensify-policyABASDASDASDASDFASD.exfy',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where did you take this value from ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2024-10-24 at 11 36 00 from here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tagged you in thread as well

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was just a format example, the policyID has to be the policyID of the policy to which you trying to connect the bank :D


// Note: Group and Self-DM excluded as these are not tied to a Workspace
WORKSPACE_ROOM_TYPES: [chatTypes.POLICY_ADMINS, chatTypes.POLICY_ANNOUNCE, chatTypes.DOMAIN_ALL, chatTypes.POLICY_ROOM, chatTypes.POLICY_EXPENSE_CHAT, chatTypes.INVOICE],
Expand Down Expand Up @@ -2635,6 +2636,7 @@ const CONST = {
},
BANK_CONNECTIONS: {
WELLS_FARGO: 'wellsfargo',
BANK_OF_AMERICA: 'bankofamerica',
CHASE: 'chase',
BREX: 'brex',
CAPITAL_ONE: 'capitalone',
Expand Down
18 changes: 8 additions & 10 deletions src/libs/actions/getCompanyCardBankConnection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,20 @@ type CompanyCardBankConnection = {
isNewDot: string;
};

// TODO remove this when BE will support bank UI callbacks
const bankUrl = 'https://secure.chase.com/web/auth/#/logon/logon/chaseOnline?redirect_url=';

export default function getCompanyCardBankConnection(bankName?: string, domainName?: string, scrapeMinDate?: string) {
export default function getCompanyCardBankConnection(bankName?: string, scrapeMinDate?: string) {
const bankConnection = Object.keys(CONST.COMPANY_CARDS.BANKS).find((key) => CONST.COMPANY_CARDS.BANKS[key as keyof typeof CONST.COMPANY_CARDS.BANKS] === bankName);

// TODO remove this when BE will support bank UI callbacks
if (!domainName) {
return bankUrl;
}

if (!bankName || !bankConnection) {
return null;
}
const authToken = NetworkStore.getAuthToken();
const params: CompanyCardBankConnection = {authToken: authToken ?? '', isNewDot: 'true', domainName: domainName ?? '', isCorporate: 'true', scrapeMinDate: scrapeMinDate ?? ''};
const params: CompanyCardBankConnection = {
authToken: authToken ?? '',
isNewDot: 'true',
domainName: CONST.COMPANY_CARD_DOMAIN_NAME,
isCorporate: 'true',
scrapeMinDate: scrapeMinDate ?? '',
};
const commandURL = getApiRoot({
shouldSkipWebProxy: true,
command: '',
Expand Down
Loading