Injecting payment button, wasn't displaying when invoice already present

Also button was not getting refresh on modal close
This commit is contained in:
rockstardev 2020-09-25 16:55:28 -05:00
parent b4f0cf510d
commit 02b99d2b06

View file

@ -126,6 +126,7 @@ window.BTCPayShopifyIntegrationModule = function () {
window.btcpay.onModalWillLeave(function () { window.btcpay.onModalWillLeave(function () {
modalShown = false; modalShown = false;
getOrCheckInvoice(true).then(function (d) { getOrCheckInvoice(true).then(function (d) {
buttonElement.innerHTML = payButtonHtml;
handleInvoiceData(d, {backgroundCheck: true}) handleInvoiceData(d, {backgroundCheck: true})
}); });
}); });
@ -158,6 +159,7 @@ window.BTCPayShopifyIntegrationModule = function () {
showPaymentInstructions(); showPaymentInstructions();
window.onPayButtonClicked = onPayButtonClicked.bind(this); window.onPayButtonClicked = onPayButtonClicked.bind(this);
getOrCheckInvoice(true).then(function (d) { getOrCheckInvoice(true).then(function (d) {
injectPaymentButtonHtml();
handleInvoiceData(d, {backgroundCheck: true}) handleInvoiceData(d, {backgroundCheck: true})
}); });