Search code examples
react-nativestripe-payments

Resource Missing Error with Stripe's `confirmSetupIntent` in React Native


I'm using the @stripe/stripe-react-native (version 0.19.0) package in my React Native app. When I attempt to confirm a Setup Intent with the confirmSetupIntent method, I receive the following error:

{
  "stripeErrorCode": "resource_missing",
  "localizedMessage": "An unexpected error occurred. Try again in a few seconds.",
  "message": "No such setupintent: 'seti_123456789ABCDE'",
  "type": "invalid_request_error",
  "code": "Failed"
}

Here my code

const { error, setupIntent } = await confirmSetupIntent(
  stripeSetupIntent.setupIntentClientSecret,
  {
    paymentMethodType: 'Card',
    paymentMethodData: {
      billingDetails: {
        name: paymentMethodInfo.companyName,
        email: paymentMethodInfo.email,
      },
    },
  }
);

The Setup Intent ID seti_123456789ABCDE seems to be missing, but i find it on the stripe dashboard.

  • What could be causing this "resource missing" error?
  • Is there something I'm missing in the confirmSetupIntent call?

Solution

  • To fix it, i have to remove the stripeAccountId in the

    <StripeProvider
        publishableKey={stripeSetupIntent.stripeInitializerKey}
        // stripeAccountId={stripeSetupIntent.stripeAccountId}
    >
        {MyComponent}
    </StripeProvider>