I am trying to add the following script tag to my Angular 2 project, however I am looking for a way to load it into a typescript file so that I can call its methods in the ts file.
<script type="text/javascript" src="https://js.squareup.com/v2/paymentform"></script>
There are a few things from the script that I need to have in order to call my typescript file, which
let paymentForm = new SqPaymentForm();
and
paymentForm.requestCardNonce();
I am trying to make SquareUp payments and they have an example: https://docs.connect.squareup.com/articles/adding-payment-form
However, this example does not translate well into the typescript setting that I use. Thanks for the help!
source
share