in my stripecreditcardcomponent.html
<script src="https://js.stripe.com/v3/"></script>
<script type="text/javascript">
const stripe = Stripe('removed secret');
const elements = stripe.elements();
</script>
my stripecreditcardcomponent.ts
async createStripeToken() {
const {token, error} = await stripe.createToken(this.card);
if (token) {
this.onSuccess(token);
} else {
this.onError(error);
}
}
but when my createstripeToken()
command is called I get the following error:
ERROR Error: Uncaught (in promise): ReferenceError: stripe is not defined ReferenceError: stripe is not defined
question from:
https://stackoverflow.com/questions/65865836/stripe-is-not-defined-but-i-have-clearly-defined-it-in-my-angular-project 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…