0👍
- For the first error where
Stripe
is undefined. That is likely because the Stripe.js library isn’t loaded before that code runs. You’ll need to ensure that you’ve included Stripe.js [1] with this tag in your HTML before any of your JavaScript usingStripe
is executed. Note that it’s not loadedasync
.
<script src="https://js.stripe.com/v3/"></script>
- The second error is because when you’re attempting to
getElementById
the ID that you’re passing is not the same as the ID in the HTML for the button.
The button’s ID is checkout-button-MY_PLAN
and the ID you’re trying to find the button with by passing is MY_PLAN
. I would recommend updating your call to getElementById to:
let checkoutButton = document.getElementById('checkout-button-MY_PLAN');
- [Vuejs]-What is the best way to refresh my Vue.js Component
- [Vuejs]-How to set dynamic styles in Vue.js component from Vuex store
Source:stackexchange.com