Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handleBankAccountPayPress = async (shouldPass = true) => {
try {
this.setState({ loading: true, error: null, token: null })
const params = shouldPass ? this.state.params : this.state.errorParams
const token = await stripe.createTokenWithBankAccount(params)
this.setState({ loading: false, token })
} catch (error) {
this.setState({ loading: false, error })
}
}