"This question is repeated on stack but not getting solution" .
loadStripe() {
if(!window.document.getElementById('stripe-script')) {
var s = window.document.createElement("script");
s.id = "stripe-script";
s.type = "text/javascript";
s.src = "https://checkout.stripe.com/checkout.js";
window.document.body.appendChild(s);
}
pay(amount: any) {
const handler = (<any>window).StripeCheckout.configure({
key: 'pk_test_51IRXdhksd',
locale: 'auto',
token(token: any) {
this.updateStatus(token.id);
//IN HERE i try to put function ("this.updateStatus"), but it will give error.
}
});
handler.open({
name: 'Test Site',
description: '2 widgets',
amount: amount * 100
});
}
If any one know solution then please share with us, Thanks.