Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handleCreacteSourcePress = async () => {
try {
this.setState({ loading: true, source: null })
const source = await stripe.createSourceWithParams({
type: 'alipay',
amount: 50,
currency: 'EUR',
returnURL: 'example://stripe-redirect',
})
this.setState({ loading: false, source })
} catch (error) {
this.setState({ loading: false })
}
}