How to use the tipsi-stripe.confirmSetupIntent function in tipsi-stripe

To help you get started, we’ve selected a few tipsi-stripe examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tipsi / tipsi-stripe / example / src / scenes / SetupIntentScreen.js View on Github external
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 })
    }
  }