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

Conversation

marcaaron
Copy link
Contributor

@marcaaron marcaaron commented Nov 22, 2021

cc @Dal-Papa unsure if we have yet added the necessary redirect_uri and android_package_name fields to the production instance of Plaid, but I think these native versions will not work properly until we do. This is done now

Details

Passes the redirect_uri and android_name fields to Plaid_GetLinkToken command

Fixed Issues

IDK if there is a specific issue. It's more of a follow up to: #6362

Tests

I tested this using the steps in the linked PR above. However, also saw that the OAuth stuff is not testable with the Plaid sandbox.

I think we won't know for sure unless we test against production, but can simulate this by modifying our local `Web-Secure to use the Plaid dev app Development secret and connecting with BofA.

QA Steps

Internal / See Comments below

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

Screenshots

Web

Mobile Web

Desktop

iOS

Android

@marcaaron marcaaron self-assigned this Nov 22, 2021
@marcaaron marcaaron requested a review from a team as a code owner November 22, 2021 22:41
@MelvinBot MelvinBot requested review from marcochavezf and removed request for a team November 22, 2021 22:41
@marcaaron
Copy link
Contributor Author

@nickmurray47 adding you here since I think these changes might intersect with the work you are doing for https://github.com/Expensify/Expensify/issues/160148

@marcaaron marcaaron changed the title Get parameters for Plaid link token based on platform [HOLD] Get parameters for Plaid link token based on platform Nov 22, 2021
@marcaaron
Copy link
Contributor Author

marcaaron commented Nov 22, 2021

I think we probably want to hold this PR on confirmation that the android package name and redirect uri for iOS are registered with the production version of our Plaid instance. Done

@marcaaron marcaaron changed the title [HOLD] Get parameters for Plaid link token based on platform Get parameters for Plaid link token based on platform Nov 23, 2021
Copy link
Contributor

@nickmurray47 nickmurray47 left a comment

Choose a reason for hiding this comment

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

Looks good to me! On this:

tested this using the steps in the linked PR above. However, also saw that the OAuth stuff isn't really testable with the Plaid sandbox

Does this mean the Platypus OAuth sandbox credentials are not sufficient? What do we need to test for in this PR (or are we just gonna test the whole flow together)?

@marcaaron
Copy link
Contributor Author

Does this mean the Platypus OAuth sandbox credentials are not sufficient? What do we need to test for in this PR (or are we just gonna test the whole flow together)?

Good question. I'm actually not sure yet, but the docs had this to say:

2021-11-23_12-37-50

I'm guessing the "sandbox-only" institution they're referring to is Platypus OAuth, but really unsure if our "dev" instance that everyone can access is set up for OAuth testing or not.

I think what we need to test is:

  • The production instance of Plaid a.k.a. we need to hit Web-Secure prod to get the right token (we can do this locally by passing in the prod web-secure endpoint)
  • Once merged, verify we can go through one of the approved OAuth bank flows on staging (while switched to the prod token). Looking at the most recent pic that @flodnv shared here it seems like we can only test a Capital One connection. I'm confused about why some of these other banks are "Processing" - but guessing it has to do with some missing required information.

nickmurray47
nickmurray47 previously approved these changes Nov 24, 2021
Copy link
Contributor

@nickmurray47 nickmurray47 left a comment

Choose a reason for hiding this comment

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

this all sounds good and lgtm

@marcaaron
Copy link
Contributor Author

Chatting with @Dal-Papa now about testing for Mobile-Expensify, but I think we can use a similar testing strategy for this PR to verify that mobile is working. Which is:

  1. Update the Web-Secure local to use our Development secret key
  2. Use ngrok to point the local native apps at the local web-secure
  3. Go through the VBA flow and select BofA (the only bank set up for OAuth in our Plaid dev app atm)
  4. See if we can complete the flow in iOS and Android
  5. Merge this PR
  6. Test again on staging but with the www-secure not staging-secure

I don't have a BofA account to test this with otherwise I'd do it myself. Going to make this internal QA in any case.

@github-actions
Copy link
Contributor

⚠️ ⚠️ Heads up! This pull request has the CP Staging label. ⚠️ ⚠️
Merging it will cause it to be immediately deployed to staging, even if the open StagingDeployCash deploy checklist is locked.

@marcaaron marcaaron added InternalQA This pull request required internal QA and removed InternalQA This pull request required internal QA labels Nov 24, 2021
nickmurray47
nickmurray47 previously approved these changes Nov 24, 2021
@marcaaron
Copy link
Contributor Author

marcaaron commented Nov 24, 2021

Ok this is ready to be merged - but I think we are still stuck since we need actual accounts set up with participating banks to test and are only able to test BofA with the Plaid dev app anyway. Thinking more on this... really we should test them all to make sure they work before the change is deployed so we might as well use the Plaid production app Development secret.

IMO we shouldn't skip this step (and should do it for all the participating banks) because we have no idea if those connections will actually work unless we test them first.

Two options I can think of:

  1. Find engineer volunteers with the various banks to test this stuff and share the Plaid production app Development secret with them and have them hardcode it in their local Web-Secure then test the flows on native platforms.

2. Just merge this and hope everything works on staging - but if it doesn't work we'll need an engineer with access to one of those banks to test the flow anyway and we will need to go back to option 1 anyway.

This option actually cannot work because we must use the Development secret anyway. Seems the Production one won't necessarily send the user through the OAuth flow.

@marcaaron
Copy link
Contributor Author

marcaaron commented Nov 24, 2021

Discussed a 3rd option with @nickmurray47 1:1 which is to add a beta and allow non engineers to also test the flow. But if we do this idea we still need to solve for how to "switch" to the Development secret for test purposes under the beta.

Ultimately, I'm not sure it's worth building out that kind of functionality yet - but one benefit is that it opens up more testing options (i.e. non engineers could test) and enable us to switch on the beta once testing is complete (even if that happens after 11/30).

marcochavezf
marcochavezf previously approved these changes Nov 24, 2021
Copy link
Contributor

@marcochavezf marcochavezf left a comment

Choose a reason for hiding this comment

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

The changes look good to me (I was catching up on the OAuth migration to understand this a little bit more) 👍🏽

Dal-Papa
Dal-Papa previously approved these changes Nov 25, 2021
src/CONST.js Outdated Show resolved Hide resolved
@marcaaron marcaaron dismissed stale reviews from Dal-Papa and marcochavezf via 5a5d8e1 November 25, 2021 16:56
Dal-Papa
Dal-Papa previously approved these changes Nov 25, 2021
Copy link

@Dal-Papa Dal-Papa left a comment

Choose a reason for hiding this comment

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

Looks even better to me now that I get it 😆

@VictoriaExpensify
Copy link
Contributor

@marcaaron once this is implemented, would this resolve the Plaid issue that Chase customers were having in this GH?

@marcaaron
Copy link
Contributor Author

@VictoriaExpensify Looks unrelated to me as OAuth should not be forced for any users yet.

@marcochavezf marcochavezf merged commit 890a8ef into main Nov 29, 2021
@marcochavezf marcochavezf deleted the marcaaron-plaidLinkAndroid branch November 29, 2021 20:46
@MelvinBot
Copy link

Triggered auto assignment to @sketchydroide (InternalQA), see https://stackoverflow.com/c/expensify/questions/5042 for more details.

@botify
Copy link

botify commented Nov 29, 2021

@marcochavezf looks like this was merged without passing tests. Please add a note explaining why this was done and remove the Emergency label if this is not an emergency.

github-actions bot pushed a commit that referenced this pull request Nov 29, 2021
Get parameters for Plaid link token based on platform

(cherry picked from commit 890a8ef)
@marcaaron marcaaron added the DeployBlockerCash This issue or pull request should block deployment label Nov 29, 2021
@marcaaron marcaaron removed the DeployBlockerCash This issue or pull request should block deployment label Dec 3, 2021
@OSBotify
Copy link
Contributor

OSBotify commented Dec 7, 2021

🚀 Deployed to staging by @marcochavezf in version: 1.1.17-8 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@marcaaron
Copy link
Contributor Author

Gonna check this off the deploy list. There doesn't seem to be a clear way to test this beyond regressions for the VBA flow. It's basically Production QA.

@OSBotify
Copy link
Contributor

OSBotify commented Dec 8, 2021

🚀 Deployed to production by @roryabraham in version: 1.1.18-3 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@marcochavezf
Copy link
Contributor

There is no emergency here, so I'm removing the label. Seems the checklist was not completed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
InternalQA This pull request required internal QA
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants