Stripe.js 2 Error - Cannot read properties of undefined (reading 'confirmCardPayment')

I think I am going crazy…lol
I have tried some many combinations but can’t seem to figure out this issue. I have watched the Stripe.Js 2 course over and over again, but still getting an error message when confirming PaymentIntent with Stripe Elements using a 4242 test card

I get this error message:

The plugin Stripe.js 2 / action Start payment with a Stripe Element threw the following error: TypeError: Cannot read properties of undefined (reading ‘confirmCardPayment’)
at eval (PLUGIN_1491714407143x279212378954661900/Stripe-js-2-element_action–Stripe-Element-Start-payment-with-.js:35:26)

@copilot

Any help, please…Thanks

Hey @miracle - hopefully you’ve already figured this out, but the stripe element you’re starting the payment from needs to be visible on the page when you’re triggering it. If it’s hidden, the error message you posted is that one that shows.

1 Like

Hey @miracle,

You’ll want to make sure the Stripe Element (like any other element-driven plugin set) is visible on page load so Stripe’s functions are accessible to your application. Most Bubblers opt to enable the This element is visible on page load option for the Stripe Element and make it visible right away to make sure Stripe is properly initialized. Without proper initialization, functions like confirmCardPayment and other Stripe functions won’t be available for use to your application.

For the future, give us a shout at plugins@withcopilot.com so we can open a support ticket on your behalf. :slight_smile:

Thank you, This solved the issue

This topic was automatically closed after 69 days. New replies are no longer allowed.