-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Add Personal Bank Account via Plaid flow #2746
Changes from all commits
99ded8c
faefc3f
23a841a
de31ab9
31effbf
1a7de12
047af51
091281f
14fbd70
e146496
14aa018
d08d0c7
4d18304
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ build/ | |
.gradle | ||
local.properties | ||
*.iml | ||
android/*.hprof | ||
|
||
# Vscode | ||
.vscode | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
buildscript { | ||
ext { | ||
buildToolsVersion = "29.0.2" | ||
minSdkVersion = 16 | ||
minSdkVersion = 21 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This appears to be a requirement in order to use the Plaid SDK on Android https://github.com/plaid/react-native-plaid-link-sdk#3-configure-gradle I'm hoping it's OK ? @Jag96 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We talked about doing this a while back but this is definitely fine, the issue is here: https://github.com/Expensify/Expensify/issues/149395 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh nice! |
||
compileSdkVersion = 30 | ||
targetSdkVersion = 30 | ||
androidXCore = "1.0.2" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
# Specifies the JVM arguments used for the daemon process. | ||
# The setting is particularly useful for tweaking memory settings. | ||
# Default value: -Xmx10248m -XX:MaxPermSize=256m | ||
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | ||
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems necessary after adding the Plaid SDK there's some more information here about this: https://medium.com/google-developers/faster-android-studio-builds-with-dex-in-process-5988ed8aa37e There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TL;DR is that without this enabled the android app wouldn't build at all. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What version of the JDK do we target? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. JDK 8 I believe, I don't know much about Java though I just uncommented this line out based on the advice in that blog post. |
||
|
||
# When configured, Gradle will run in incubating parallel mode. | ||
# This option should only be used with decoupled projects. More details, visit | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
"/setpassword/*", | ||
"/details/*", | ||
"/v/*", | ||
"/add-bank-account/*", | ||
] | ||
} | ||
] | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import {useCallback, useEffect} from 'react'; | ||
import {usePlaidLink} from 'react-plaid-link'; | ||
import {plaidLinkPropTypes, plaidLinkDefaultProps} from './plaidLinkPropTypes'; | ||
|
||
const PlaidLink = (props) => { | ||
const onSuccess = useCallback((publicToken, metadata) => { | ||
props.onSuccess({publicToken, metadata}); | ||
}, []); | ||
|
||
const {open, ready, error} = usePlaidLink({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We normally should not need to use hooks (and kind of discourage it), but the Plaid library we're using for React web here really only offers this option to launch the flow programmatically. |
||
token: props.token, | ||
onSuccess, | ||
onExit: props.onExit, | ||
}); | ||
|
||
useEffect(() => { | ||
if (error) { | ||
props.onError(error); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This usage leads to #38069. This happened due to a change in |
||
return; | ||
} | ||
|
||
if (!ready) { | ||
return; | ||
} | ||
|
||
open(); | ||
}, [ready, error]); | ||
|
||
return null; | ||
}; | ||
|
||
PlaidLink.propTypes = plaidLinkPropTypes; | ||
PlaidLink.defaultProps = plaidLinkDefaultProps; | ||
PlaidLink.displayName = 'PlaidLink'; | ||
export default PlaidLink; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious, can't we reuse the
EXPENSIFY_URL_SECURE
config for this, and make people enter their secure-ngrok URL there?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could, but this way means if you want to switch from using ngrok to not using it you can just set
USE_NGROK
to false without having to change the urls often.