mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Displaying Node Info as QR code for Lightning payments (#318)
* Styling elements required for Node info * Allowing switching QR between bolt11 and node info for lightning * Equal width for Bolt11 and Node info buttons * Certain languages were too verbose for display of "Pay with" Fixes: #317
This commit is contained in:
committed by
Nicolas Dorier
parent
657cfe1b23
commit
d459839bf7
@@ -20,6 +20,17 @@ function resetTabsSlider() {
|
||||
closePaymentMethodDialog(null);
|
||||
}
|
||||
|
||||
function changeCurrency(currency) {
|
||||
if (currency !== null && srvModel.paymentMethodId !== currency) {
|
||||
$(".payment__currencies").hide();
|
||||
$(".payment__spinner").show();
|
||||
checkoutCtrl.scanDisplayQr = "";
|
||||
srvModel.paymentMethodId = currency;
|
||||
fetchStatus();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function onDataCallback(jsonData) {
|
||||
// extender properties used
|
||||
jsonData.shapeshiftUrl = "https://shapeshift.io/shifty.html?destination=" + jsonData.btcAddress + "&output=" + jsonData.paymentMethodId + "&amount=" + jsonData.btcDue;
|
||||
@@ -66,20 +77,26 @@ function onDataCallback(jsonData) {
|
||||
$(".payment__spinner").hide();
|
||||
}
|
||||
|
||||
if (checkoutCtrl.scanDisplayQr === "") {
|
||||
checkoutCtrl.scanDisplayQr = jsonData.invoiceBitcoinUrlQR;
|
||||
}
|
||||
|
||||
if (jsonData.isLightning && checkoutCtrl.lndModel === null) {
|
||||
var lndModel = {
|
||||
toggle: 0
|
||||
};
|
||||
|
||||
checkoutCtrl.lndModel = lndModel;
|
||||
}
|
||||
|
||||
if (!jsonData.isLightning) {
|
||||
checkoutCtrl.lndModel = null;
|
||||
}
|
||||
|
||||
// updating ui
|
||||
checkoutCtrl.srvModel = jsonData;
|
||||
}
|
||||
|
||||
function changeCurrency(currency) {
|
||||
if (currency !== null && srvModel.paymentMethodId !== currency) {
|
||||
$(".payment__currencies").hide();
|
||||
$(".payment__spinner").show();
|
||||
srvModel.paymentMethodId = currency;
|
||||
fetchStatus();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function fetchStatus() {
|
||||
var path = srvModel.serverUrl + "/i/" + srvModel.invoiceId + "/" + srvModel.paymentMethodId + "/status";
|
||||
$.ajax({
|
||||
@@ -93,6 +110,16 @@ function fetchStatus() {
|
||||
});
|
||||
}
|
||||
|
||||
function lndToggleBolt11() {
|
||||
checkoutCtrl.lndModel.toggle = 0;
|
||||
checkoutCtrl.scanDisplayQr = checkoutCtrl.srvModel.invoiceBitcoinUrlQR;
|
||||
}
|
||||
|
||||
function lndToggleNode() {
|
||||
checkoutCtrl.lndModel.toggle = 1;
|
||||
checkoutCtrl.scanDisplayQr = checkoutCtrl.srvModel.peerInfo;
|
||||
}
|
||||
|
||||
// private methods
|
||||
$(document).ready(function () {
|
||||
// initialize
|
||||
|
||||
Reference in New Issue
Block a user