Fixing Stripe a ‘IntegrationError’

Avatar of Jonathan Reinink

Bristol WordPress expert and studio owner

On a recent project, I kept getting an IntegrationError when trying to integrate Stripe. Specifically when running stripe.createToken(card).

"IntegrationError: We could not retrieve data from the specified Element. Please make sure the Element you are attempting to use is still mounted.

To fix this there are two things you need to check:

  1. Make sure your card component (the literally HTML) is present in the DOM when you running createToken. This might require you to rethink any sort of form animation until everything is clear.
  2. Check your JS isn’t being loaded multiple times. This was my issue, due to simple typo, the JS running the stripe integration was being loaded once in the header and again in the footer.

Hope that helps!