Невозможно создать токен полосы - PullRequest
0 голосов
/ 30 апреля 2020

Привет, я собираюсь создать токен полосы в приложении angular. получение ошибки Невозможно прочитать свойство 'createToken' с неопределенным

В index .. html Я добавил

<script src="https://js.stripe.com/v3/"></script>

В компонент. 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;
        }
      });
...