Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onAttachPaymentMethod = async (cardNumber) => {
this.setState({ ...this.state, loading: true })
try {
const confirmSetupResult = await stripe.confirmSetupIntent({
clientSecret: this.state.setupIntent.secret,
paymentMethod: demoPaymentMethodDetailsWithCard(cardNumber),
})
this.setState({ ...this.state, loading: false, confirmSetupResult })
} catch (e) {
console.log('error')
console.dir(e)
this.setState({ ...this.state, loading: false, confirmSetupResult: e })
}
}