To avoid problems with your transaction, your Billing Information MUST-match what's on your credit card statement
var paymentMessage = document.querySelector('.d-checkout-payment-online');
var but = document.querySelector('.d-checkout-list-payment-options-online');
var paymentId = 0;
var warningFlag = false;
addEventListener("click", (event) => {
console.log("check #1");
paymentId = '<%= cart.paymentMethod.id %>';
if (paymentMessage != null) {
console.log("check #2");
if (warningFlag === false) {
console.log("check #3");
if (paymentId =! 0) {
console.log("check #4");
document.querySelector('.d-checkout-list-payment-options-online').setAttribute("id", "thatId");
warningFlag = true;
document.getElementById("thatId").append(document.getElementById("paymentWarning"));
document.getElementById("paymentWarning").style.display = "block";
}
}
}
});
<% console.log(cart) %>