Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
handleCheckout(event) {
var data = new FormData(event.target);
if (hasPaymentRequest()) {
processPayment(this._cart)
.then(result => {
location.href = '/checkout.html';
}).catch(e => {
console.log('Payment failed due to exception: ' + e);
showToast('Payment failed (see console)');
});
} else {
this.processOnServer(data);
}
}