+
= self.charge_amount) {
- self.charge_paid = 'True'
+
+ this.charge.time_elapsed = data.time_elapsed
+ this.charge.amount = data.amount
+ this.charge.balance = data.balance
+ if (this.charge.balance >= this.charge.amount) {
+ this.charge.paid = true
}
- })
- .catch(function (error) {
- LNbits.utils.notifyApiError(error)
- })
+ } catch (error) {
+ LNbits.utils.notifyApiError(error)
+ }
+
+
+
},
payLN: function () {
this.lnbtc = true
@@ -304,7 +302,7 @@
timerCount: function () {
self = this
var refreshIntervalId = setInterval(function () {
- if (self.charge_paid == 'True' || self.timetoComplete < 1) {
+ if (self.charge.paid|| self.timetoComplete < 1) {
clearInterval(refreshIntervalId)
}
self.getTheTime()
@@ -327,7 +325,7 @@
this.getTheTime()
this.getThePercentage()
var timerCount = this.timerCount
- if ('{{ charge.paid }}' == 'False') {
+ if (!this.charge.paid) {
timerCount()
}
this.startPaymentNotifier()