How to use the tipsi-stripe.authenticatePaymentIntent 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 / PaymentIntentScreen.js View on Github external
handleAuthenticationChallenge = async ({ clientSecret }) => {
    let response = null
    try {
      console.log('Calling stripe.authenticatePaymentIntent()')
      const authResponse = await stripe.authenticatePaymentIntent({
        clientSecret,
      })
      console.log('stripe.authenticatePaymentIntent()', authResponse)

      if (authResponse.status === 'requires_payment_method') {
        response = {
          message: 'Authentication failed, a new PaymentMethod needs to be attached.',
          status: authResponse.status,
        }
      } else if (authResponse.status === 'requires_confirmation') {
        response = {
          message: 'Authentication passed, requires confirmation (server-side)',
          status: authResponse.status,
        }
      } else {
        response = {