diff --git a/lnbits/extensions/satspay/templates/satspay/display.html b/lnbits/extensions/satspay/templates/satspay/display.html
index 52e9bfc78..acee075f4 100644
--- a/lnbits/extensions/satspay/templates/satspay/display.html
+++ b/lnbits/extensions/satspay/templates/satspay/display.html
@@ -2,67 +2,103 @@
-
{{ charge.description }}
+
+ {{ charge.description }}
+
-
+
Time elapsed
-
+
Charge paid
-
-
-
-
- Awaiting payment...
- {% raw %} {{ newTimeLeft }} {% endraw %}
-
-
-
+
+
+
+ Awaiting payment...
+
+ {% raw %} {{ newTimeLeft }} {% endraw %}
+
+
+
+
-
-
+
- Charge ID: {{ charge.id }}
+ Charge ID: {{ charge.id }}
- {% raw %}
- Total to pay: {{ charge_amount }}sats
- Amount paid: {{ charge_balance }}
- Amount due: {{ charge_amount - charge_balance }}sats
- {% endraw %}
-
+ {% raw %} Total to pay: {{ charge_amount }}sats
+ Amount paid: {{ charge_balance }}
+ Amount due: {{ charge_amount - charge_balance }}sats {% endraw %}
+
-
-
- bitcoin onchain payment method not available
-
-
-
-
- pay with lightning
-
-
-
-
-
-
- bitcoin lightning payment method not available
-
-
-
-
- pay onchain
-
-
-
+
+
+ bitcoin onchain payment method not available
+
+
+
+ pay with lightning
+
+
+
+
+
+ bitcoin lightning payment method not available
+
+
+
+ pay onchain
+
+
@@ -71,65 +107,100 @@
- Pay this
lightning-network invoice
+ Pay this
+ lightning-network invoice
-
-
-
-
-
-
-
Copy invoice
+
+
+
+
+
+
+ Copy invoice
+
+
-
-
- Send {{ charge.amount }}sats
to this onchain address
+ Send {{ charge.amount }}sats
+ to this onchain address
-
-
-
-
-
-
-
Copy address
+
+
+
+
+
+
+ Copy address
+
+
-
@@ -173,67 +244,72 @@
.request(
'GET',
'/satspay/api/v1/charges/balance/{{ charge.id }}',
- "filla"
+ 'filla'
)
.then(function (response) {
console.log(response.data)
- self.charge_time_elapsed = response.data.time_elapsed
+ self.charge_time_elapsed = response.data.time_elapsed
self.charge_amount = response.data.amount
self.charge_balance = response.data.balance
- if (self.charge_balance >= self.charge_amount ){
- self.charge_paid = "True"
+ if (self.charge_balance >= self.charge_amount) {
+ self.charge_paid = 'True'
}
})
.catch(function (error) {
LNbits.utils.notifyApiError(error)
})
},
- payLN: function(){
+ payLN: function () {
this.lnbtc = true
this.onbtc = false
},
- payON: function(){
+ payON: function () {
this.lnbtc = false
this.onbtc = true
- },
+ },
getTheTime: function () {
- var timeToComplete = (parseInt('{{ charge.time }}') * 60) - (Date.now()/1000 - parseInt('{{ charge.timestamp }}') )
- var timeLeft = Quasar.utils.date.formatDate(
- new Date((timeToComplete - 3600)*1000),
- 'HH:mm:ss'
- )
- this.newTimeLeft = timeLeft
+ var timeToComplete =
+ parseInt('{{ charge.time }}') * 60 -
+ (Date.now() / 1000 - parseInt('{{ charge.timestamp }}'))
+ var timeLeft = Quasar.utils.date.formatDate(
+ new Date((timeToComplete - 3600) * 1000),
+ 'HH:mm:ss'
+ )
+ this.newTimeLeft = timeLeft
},
getThePercentage: function () {
- var timeToComplete = (parseInt('{{ charge.time }}') * 60) - (Date.now()/1000 - parseInt('{{ charge.timestamp }}') )
- this.newProgress = 1 - (timeToComplete / (parseInt('{{ charge.time }}') * 60))
+ var timeToComplete =
+ parseInt('{{ charge.time }}') * 60 -
+ (Date.now() / 1000 - parseInt('{{ charge.timestamp }}'))
+ this.newProgress =
+ 1 - timeToComplete / (parseInt('{{ charge.time }}') * 60)
},
timerCount: function () {
self = this
var refreshIntervalId = setInterval(function () {
- if(self.charge_paid == "True"){
- console.log("did this work?")
+ if (self.charge_paid == 'True') {
+ console.log('did this work?')
clearInterval(refreshIntervalId)
}
self.getTheTime()
self.getThePercentage()
self.counter++
- if (self.counter% 10 === 0){
+ if (self.counter % 10 === 0) {
self.checkBalance()
}
}, 1000)
}
},
created: function () {
- if('{{ charge.lnbitswallet }}' == 'None'){
+ if ('{{ charge.lnbitswallet }}' == 'None') {
this.lnbtc = false
this.onbtc = true
}
this.getTheTime()
this.getThePercentage()
var timerCount = this.timerCount
- if('{{ charge.paid }}' == 'False'){
+ if ('{{ charge.paid }}' == 'False') {
timerCount()
}
}
diff --git a/lnbits/extensions/satspay/templates/satspay/index.html b/lnbits/extensions/satspay/templates/satspay/index.html
index cd1135b33..1dc6da2de 100644
--- a/lnbits/extensions/satspay/templates/satspay/index.html
+++ b/lnbits/extensions/satspay/templates/satspay/index.html
@@ -257,9 +257,7 @@
emit-value
v-model="formDialogCharge.data.lnbitswallet"
:options="g.user.walletOptions"
- label="Wallet *"
- >
-
+ label="Wallet *">