mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2026-01-05 23:24:27 +01:00
URL of image for pay button
This commit is contained in:
@@ -32,7 +32,8 @@ namespace BTCPayServer.Controllers
|
||||
Currency = DEFAULT_CURRENCY,
|
||||
ButtonSize = 2,
|
||||
UrlRoot = appUrl,
|
||||
CurrencyDropdown = currencyDropdown
|
||||
CurrencyDropdown = currencyDropdown,
|
||||
PayButtonImageUrl = appUrl + "/img/paywithbtcpay.png"
|
||||
};
|
||||
return View(model);
|
||||
}
|
||||
|
||||
@@ -21,8 +21,9 @@ namespace BTCPayServer.Models.AppViewModels
|
||||
[EmailAddress]
|
||||
public string NotifyEmail { get; set; }
|
||||
|
||||
//
|
||||
// Data that influences Pay Button UI, but not invoice creation
|
||||
public string UrlRoot { get; set; }
|
||||
public List<string> CurrencyDropdown { get; set; }
|
||||
public string PayButtonImageUrl { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,13 @@
|
||||
<input name="orderId" type="text" class="form-control" id="inputAddress" placeholder="(optional)"
|
||||
v-model="srvModel.orderId" v-on:change="inputChanges">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Pay Button Image Url</label>
|
||||
<input name="payButtonImageUrl" type="text" class="form-control" id="inputAddress"
|
||||
v-model="srvModel.payButtonImageUrl" v-on:change="inputChanges"
|
||||
v-validate="'required|url'" :class="{'is-invalid': errors.has('payButtonImageUrl') }">
|
||||
<small class="text-danger">{{ errors.first('payButtonImageUrl') }}</small>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Button Size</label>
|
||||
<div style="vertical-align:top; font-size:12px; display:flex;">
|
||||
@@ -145,7 +152,8 @@
|
||||
en: {
|
||||
attributes: {
|
||||
price: 'Price', checkoutDesc: 'Checkout Description', orderId: 'Order Id',
|
||||
serverIpn: 'Server IPN', notifyEmail: 'Send Email Notifications', browserRedirect: 'Browser Redirect'
|
||||
serverIpn: 'Server IPN', notifyEmail: 'Send Email Notifications', browserRedirect: 'Browser Redirect',
|
||||
payButtonImageUrl: "Pay Button Image Url"
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -197,8 +205,7 @@
|
||||
} else if (srvModel.buttonSize == 2) {
|
||||
width = "209px";
|
||||
}
|
||||
$("#previewButton").css("width", width);
|
||||
html += '\n <input type="image" src="' + srvModel.urlRoot + '/img/paywithbtcpay.png" name="submit" style="width:' + width +
|
||||
html += '\n <input type="image" src="' + srvModel.payButtonImageUrl + '" name="submit" style="width:' + width +
|
||||
'" alt="Pay with BtcPay, Self-Hosted Bitcoin Payment Processor">';
|
||||
|
||||
html += '\n</form>';
|
||||
@@ -209,6 +216,9 @@
|
||||
hljs.highlightBlock(block);
|
||||
});
|
||||
|
||||
$("#previewButton").css("width", width);
|
||||
$("#previewButton").attr("src", srvModel.payButtonImageUrl);
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user