fix: pay_invoice timeout to prevent blocking (#2875)
* fix: make invoice non blocking * fix with vlad * wallet.js take pending into account * fixup! * add check payment to outgoing * revert * bundle * fix: label * fix: rebase change * feat: configure pay invoice wait time * fix: check payment button * bundle * fix: task in async context --------- Co-authored-by: Vlad Stan <stan.v.vlad@gmail.com>
This commit is contained in:
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
File diff suppressed because one or more lines are too long
@@ -89,7 +89,7 @@ window.localisation.br = {
|
||||
pay: 'Pagar',
|
||||
memo: 'Memo',
|
||||
date: 'Data',
|
||||
processing_payment: 'Processando pagamento...',
|
||||
payment_processing: 'Processando pagamento...',
|
||||
not_enough_funds: 'Fundos insuficientes!',
|
||||
search_by_tag_memo_amount: 'Pesquisar por tag, memo, quantidade',
|
||||
invoice_waiting: 'Fatura aguardando pagamento',
|
||||
|
||||
@@ -86,7 +86,7 @@ window.localisation.cn = {
|
||||
pay: '付款',
|
||||
memo: '备注',
|
||||
date: '日期',
|
||||
processing_payment: '正在处理支付...',
|
||||
payment_processing: '正在处理支付...',
|
||||
not_enough_funds: '资金不足!',
|
||||
search_by_tag_memo_amount: '按标签、备注、金额搜索',
|
||||
invoice_waiting: '待支付的发票',
|
||||
|
||||
@@ -90,7 +90,7 @@ window.localisation.cs = {
|
||||
pay: 'Platit',
|
||||
memo: 'Poznámka',
|
||||
date: 'Datum',
|
||||
processing_payment: 'Zpracování platby...',
|
||||
payment_processing: 'Zpracování platby...',
|
||||
not_enough_funds: 'Nedostatek prostředků!',
|
||||
search_by_tag_memo_amount: 'Hledat podle tagu, poznámky, částky',
|
||||
invoice_waiting: 'Faktura čeká na platbu',
|
||||
|
||||
@@ -91,7 +91,7 @@ window.localisation.de = {
|
||||
pay: 'Zahlen',
|
||||
memo: 'Memo',
|
||||
date: 'Datum',
|
||||
processing_payment: 'Zahlung wird verarbeitet ...',
|
||||
payment_processing: 'Zahlung wird verarbeitet ...',
|
||||
not_enough_funds: 'Geldmittel sind erschöpft!',
|
||||
search_by_tag_memo_amount: 'Suche nach Tag, Memo, Betrag',
|
||||
invoice_waiting: 'Rechnung wartend auf Zahlung',
|
||||
|
||||
@@ -94,7 +94,11 @@ window.localisation.en = {
|
||||
memo: 'Memo',
|
||||
date: 'Date',
|
||||
path: 'Path',
|
||||
processing_payment: 'Processing payment...',
|
||||
payment_processing: 'Processing payment...',
|
||||
payment_processing: 'Processing payment...',
|
||||
payment_successful: 'Payment successful!',
|
||||
payment_pending: 'Payment pending...',
|
||||
payment_check: 'Check payment',
|
||||
not_enough_funds: 'Not enough funds!',
|
||||
search_by_tag_memo_amount: 'Search by tag, memo, amount',
|
||||
invoice_waiting: 'Invoice waiting to be paid',
|
||||
@@ -411,8 +415,12 @@ window.localisation.en = {
|
||||
invoice_expiry: 'Invoice Expiry',
|
||||
invoice_expiry_label: 'Invoice expiry (seconds)',
|
||||
fee_reserve: 'Fee Reserve',
|
||||
fee_reserve_percent: 'Fee Reserve Percent',
|
||||
fee_reserve_msats: 'Reserve fee in msats',
|
||||
fee_reserve_percent: 'Reserve fee in percent',
|
||||
reserve_fee_in_percent: 'Reserve fee in percent',
|
||||
payment_wait_time: 'Payment Wait Time',
|
||||
payment_wait_time_desc:
|
||||
'How long to wait when making a payment before marking it as pending. Set higher values for HODL invoices, Boltz, etc.',
|
||||
server_management: 'Server Management',
|
||||
base_url: 'Base URL',
|
||||
base_url_label: 'Static/Base url for the server',
|
||||
|
||||
@@ -90,7 +90,7 @@ window.localisation.es = {
|
||||
pay: 'Pagar',
|
||||
memo: 'Memo',
|
||||
date: 'Fecha',
|
||||
processing_payment: 'Procesando pago ...',
|
||||
payment_processing: 'Procesando pago ...',
|
||||
not_enough_funds: '¡No hay suficientes fondos!',
|
||||
search_by_tag_memo_amount: 'Buscar por etiqueta, memo, cantidad',
|
||||
invoice_waiting: 'Factura esperando pago',
|
||||
|
||||
@@ -96,7 +96,7 @@ window.localisation.fi = {
|
||||
memo: 'Kuvaus',
|
||||
date: 'Päiväys',
|
||||
path: 'Path',
|
||||
processing_payment: 'Maksua käsitellään...',
|
||||
payment_processing: 'Maksua käsitellään...',
|
||||
not_enough_funds: 'Varat eivät riitä!',
|
||||
search_by_tag_memo_amount: 'Etsi tunnisteella, muistiolla tai määrällä',
|
||||
invoice_waiting: 'Lasku osottaa maksamista',
|
||||
|
||||
@@ -93,7 +93,7 @@ window.localisation.fr = {
|
||||
pay: 'Payer',
|
||||
memo: 'Mémo',
|
||||
date: 'Date',
|
||||
processing_payment: 'Traitement du paiement...',
|
||||
payment_processing: 'Traitement du paiement...',
|
||||
not_enough_funds: 'Fonds insuffisants !',
|
||||
search_by_tag_memo_amount: 'Rechercher par tag, mémo, montant',
|
||||
invoice_waiting: 'Facture en attente de paiement',
|
||||
|
||||
@@ -91,7 +91,7 @@ window.localisation.it = {
|
||||
pay: 'Paga',
|
||||
memo: 'Memo',
|
||||
date: 'Dati',
|
||||
processing_payment: 'Elaborazione pagamento...',
|
||||
payment_processing: 'Elaborazione pagamento...',
|
||||
not_enough_funds: 'Non ci sono abbastanza fondi!',
|
||||
search_by_tag_memo_amount: 'Cerca per tag, memo, importo...',
|
||||
invoice_waiting: 'Fattura in attesa di pagamento',
|
||||
|
||||
@@ -87,7 +87,7 @@ window.localisation.jp = {
|
||||
pay: '支払う',
|
||||
memo: 'メモ',
|
||||
date: '日付',
|
||||
processing_payment: '支払い処理中',
|
||||
payment_processing: '支払い処理中',
|
||||
not_enough_funds: '資金が不足しています',
|
||||
search_by_tag_memo_amount: 'タグ、メモ、金額で検索',
|
||||
invoice_waiting: '請求書を待っています',
|
||||
|
||||
@@ -89,7 +89,7 @@ window.localisation.kr = {
|
||||
pay: '지불하기',
|
||||
memo: 'Memo',
|
||||
date: '일시',
|
||||
processing_payment: '결제 처리 중...',
|
||||
payment_processing: '결제 처리 중...',
|
||||
not_enough_funds: '자금이 부족합니다!',
|
||||
search_by_tag_memo_amount: '태그, memo, 수량으로 검색하기',
|
||||
invoice_waiting: '결제를 기다리는 인보이스',
|
||||
|
||||
@@ -91,7 +91,7 @@ window.localisation.nl = {
|
||||
pay: 'Betalen',
|
||||
memo: 'Memo',
|
||||
date: 'Datum',
|
||||
processing_payment: 'Verwerking betaling...',
|
||||
payment_processing: 'Verwerking betaling...',
|
||||
not_enough_funds: 'Onvoldoende saldo!',
|
||||
search_by_tag_memo_amount: 'Zoeken op tag, memo, bedrag',
|
||||
invoice_waiting: 'Factuur wachtend op betaling',
|
||||
|
||||
@@ -90,7 +90,7 @@ window.localisation.pi = {
|
||||
pay: 'Pay up or walk the plank, ye scallywag',
|
||||
memo: 'Message in a bottle, argh',
|
||||
date: 'Date of the map, me matey',
|
||||
processing_payment: 'Processing yer payment... don´t make me say it again',
|
||||
payment_processing: 'Processing yer payment... don´t make me say it again',
|
||||
not_enough_funds: 'Arrr, ye don´t have enough doubloons! Walk the plank!',
|
||||
search_by_tag_memo_amount: 'Search by tag, message, or booty amount, savvy',
|
||||
invoice_waiting: 'Invoice waiting to be plundered, arrr',
|
||||
|
||||
@@ -89,7 +89,7 @@ window.localisation.pl = {
|
||||
pay: 'Zapłać',
|
||||
memo: 'Memo',
|
||||
date: 'Data',
|
||||
processing_payment: 'Przetwarzam płatność...',
|
||||
payment_processing: 'Przetwarzam płatność...',
|
||||
not_enough_funds: 'Brak wystarczających środków!',
|
||||
search_by_tag_memo_amount: 'Szukaj po tagu, memo czy wartości',
|
||||
invoice_waiting: 'Faktura oczekuje na zapłatę',
|
||||
|
||||
@@ -90,7 +90,7 @@ window.localisation.pt = {
|
||||
pay: 'Pagar',
|
||||
memo: 'Memo',
|
||||
date: 'Data',
|
||||
processing_payment: 'Processando pagamento...',
|
||||
payment_processing: 'Processando pagamento...',
|
||||
not_enough_funds: 'Fundos insuficientes!',
|
||||
search_by_tag_memo_amount: 'Pesquisar por tag, memo, quantidade',
|
||||
invoice_waiting: 'Fatura aguardando pagamento',
|
||||
|
||||
@@ -87,7 +87,7 @@ window.localisation.sk = {
|
||||
pay: 'Platiť',
|
||||
memo: 'Poznámka',
|
||||
date: 'Dátum',
|
||||
processing_payment: 'Spracovávanie platby...',
|
||||
payment_processing: 'Spracovávanie platby...',
|
||||
not_enough_funds: 'Nedostatok prostriedkov!',
|
||||
search_by_tag_memo_amount: 'Vyhľadať podľa značky, poznámky, sumy',
|
||||
invoice_waiting: 'Faktúra čakajúca na zaplatenie',
|
||||
|
||||
@@ -90,7 +90,7 @@ window.localisation.we = {
|
||||
pay: 'Talu',
|
||||
memo: 'Memo',
|
||||
date: 'Dyddiad',
|
||||
processing_payment: 'Prosesu taliad...',
|
||||
payment_processing: 'Prosesu taliad...',
|
||||
not_enough_funds: 'Dim digon o arian!',
|
||||
search_by_tag_memo_amount: 'Chwilio yn ôl tag, memo, swm',
|
||||
invoice_waiting: 'Anfoneb yn aros i gael ei thalu',
|
||||
|
||||
@@ -177,6 +177,26 @@ window.app.component('payment-list', {
|
||||
LNbits.utils.notifyApiError(err)
|
||||
})
|
||||
},
|
||||
checkPayment(payment_hash) {
|
||||
LNbits.api
|
||||
.getPayment(this.g.wallet, payment_hash)
|
||||
.then(res => {
|
||||
this.update = !this.update
|
||||
if (res.data.status == 'success') {
|
||||
Quasar.Notify.create({
|
||||
type: 'positive',
|
||||
message: this.$t('payment_successful')
|
||||
})
|
||||
}
|
||||
if (res.data.status == 'pending') {
|
||||
Quasar.Notify.create({
|
||||
type: 'info',
|
||||
message: this.$t('payment_pending')
|
||||
})
|
||||
}
|
||||
})
|
||||
.catch(LNbits.utils.notifyApiError)
|
||||
},
|
||||
paymentTableRowKey(row) {
|
||||
return row.payment_hash + row.amount
|
||||
},
|
||||
|
||||
+17
-12
@@ -463,22 +463,27 @@ window.WalletPageLogic = {
|
||||
payInvoice() {
|
||||
const dismissPaymentMsg = Quasar.Notify.create({
|
||||
timeout: 0,
|
||||
message: this.$t('processing_payment')
|
||||
message: this.$t('payment_processing')
|
||||
})
|
||||
|
||||
LNbits.api
|
||||
.payInvoice(this.g.wallet, this.parse.data.request)
|
||||
.then(_ => {
|
||||
clearInterval(this.parse.paymentChecker)
|
||||
setTimeout(() => {
|
||||
clearInterval(this.parse.paymentChecker)
|
||||
}, 40000)
|
||||
this.parse.paymentChecker = setInterval(() => {
|
||||
if (!this.parse.show) {
|
||||
dismissPaymentMsg()
|
||||
clearInterval(this.parse.paymentChecker)
|
||||
}
|
||||
}, 2000)
|
||||
.then(response => {
|
||||
dismissPaymentMsg()
|
||||
this.updatePayments = !this.updatePayments
|
||||
this.parse.show = false
|
||||
if (response.data.status == 'success') {
|
||||
Quasar.Notify.create({
|
||||
type: 'positive',
|
||||
message: this.$t('payment_successful')
|
||||
})
|
||||
}
|
||||
if (response.data.status == 'pending') {
|
||||
Quasar.Notify.create({
|
||||
type: 'info',
|
||||
message: this.$t('payment_pending')
|
||||
})
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
dismissPaymentMsg()
|
||||
|
||||
Reference in New Issue
Block a user