I have a window event in Angular 6. On the token event I need to call my Angular method, how do I do this?
openCheckout(order) {
var handler = (<any>window).StripeCheckout.configure({
key: 'pk_test_',
locale: 'auto',
token: function (token: any) {
console.log(token.id);
console.log(token.email);
// --- makePayment ERRORS AS UNDEFINED
this.makePayment(token.id, token.email);
location.reload();
}
});
handler.open({
name: 'Name',
description: 'Desc',
currency: 'gbp',
amount: order.transactionAmount,
image: 'https://stripe.com/img/documentation/checkout/marketplace.png'
});
}
Thanks in advance