无法创建条纹令牌

时间:2020-04-30 12:10:54

标签: javascript angular stripe-payments

嗨,我要在角度应用程序中创建条纹令牌。出现错误无法读取未定义的属性'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;
        }
      });

0 个答案:

没有答案