Делал так
document.getElementById('oplata1').innerHTML = '<form><input type="button" id="oplata" name="buy" value="" onClick="location.href=\'liqpay/liqpay.php?i=1\'"></form>';
fetch("liqpay/liqpay.php?i=1", { method: "POST", body: JSON.stringify({ id: 60 }) }).then(r => r.text()).then(alert);