Adding another state for detection of invoice paid

This commit is contained in:
rockstardev
2020-09-16 23:44:21 -05:00
committed by Kukks
parent 9b0fb9ecdc
commit 0e53ead14e

View File

@@ -21,7 +21,8 @@ var BtcPayServerModal = (function () {
var interval = setInterval(function () {
getBtcPayInvoice(btcPayServerUrl, invoiceId, storeId)
.then(function (invoice) {
if (invoice.status === "complete" || invoice.status === "paid") {
// in most cases this will be triggered by paid, but we put other statuses just in case
if (invoice.status === "paid" || invoice.status === "complete" || invoice.status === "confirmed") {
clearInterval(interval);
resolve(invoice);
}