嗨,我要在角度应用程序中创建条纹令牌。出现错误无法读取未定义的属性'createToken'
我在 index..html 中添加了
<script src="https://js.stripe.com/v3/"></script>
在component.ts中:
(<any>window).Stripe.card.createToken({
number: this.cardNumber,
exp_month: this.expiryMonth,
exp_year: this.expiryYear,
cvc: this.cvc
}, (status: number, response: any) => {
if (status === 200) {
this.message = `Success! Card token ${response.card.id}.`;
} else {
this.message = response.error.message;
}
});