Fix paybutton like when no amount set

This commit is contained in:
nicolas.dorier 2021-08-12 10:04:23 +09:00
parent ffbf70d72b
commit a20906bc12
No known key found for this signature in database
GPG key ID: 6618763EF09186FE

View file

@ -148,7 +148,7 @@ function inputChanges(event, buttonSize) {
// Fixed amount: Add price and currency as hidden inputs
if (isFixedAmount) {
if (srvModel.price !== '')
if (srvModel.price)
html += addInput(priceInputName, srvModel.price);
if(allowCurrencySelection){
html += addInput("currency", srvModel.currency);
@ -158,7 +158,8 @@ function inputChanges(event, buttonSize) {
else if (isCustomAmount) {
html += ' <div class="btcpay-custom-container">\n <div class="btcpay-custom">\n';
html += srvModel.simpleInput ? '' : addPlusMinusButton("-", srvModel.step, srvModel.min, srvModel.max);
html += ' ' + addInputPrice(priceInputName, srvModel.price, widthInput, "", "number", srvModel.min, srvModel.max, srvModel.step);
if (srvModel.price)
html += ' ' + addInputPrice(priceInputName, srvModel.price, widthInput, "", "number", srvModel.min, srvModel.max, srvModel.step);
html += srvModel.simpleInput ? '' : addPlusMinusButton("+", srvModel.step, srvModel.min, srvModel.max);
html += ' </div>\n';
if(allowCurrencySelection) {
@ -198,7 +199,7 @@ function inputChanges(event, buttonSize) {
var url = new URL(form.getAttribute("action"));
var formData = new FormData(form);
formData.forEach((value, key) => {
if(key !== "jsonResponse"){
if (key !== "jsonResponse") {
url.searchParams.append(key, value);
}
});