From 30202dfabafda1d3015ef03b4ea00eb3423396b6 Mon Sep 17 00:00:00 2001 From: SimplifiedPrivacy Date: Fri, 22 May 2026 21:14:12 -0400 Subject: [PATCH] Fixed Bitcoin Lightning for Tickets & prevented billing codes from being wiped if a temp billing code already exists --- .gitignore | 1 + gui/___main__.py | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 0d006d4..e8ce37f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +old_main.py .idea .venv dist diff --git a/gui/___main__.py b/gui/___main__.py index 02dec16..a09b343 100755 --- a/gui/___main__.py +++ b/gui/___main__.py @@ -10379,7 +10379,7 @@ class CurrencySelectionPage(Page): button_info = [ ("monero", (545, 75)), ("bitcoin", (545, 290)), - ("lightnering", (545, 180)), + ("lightning", (545, 180)), # going to ticket server as "lightning" ("litecoin", (545, 395)) ] @@ -11099,6 +11099,14 @@ class TicketCryptoPickerPage(Page): if error_code == 'already_exists' and not self.bypass_existing: self._prompt_wipe_existing(invoice) return + + if error_code == 'billing_code_exists' and not self.bypass_existing: + temp_billing_code = getattr(invoice, 'temp_billing_code', None) + print(f"temp_billing_code is {temp_billing_code}") + if temp_billing_code: + self._prompt_wipe_billingcode(temp_billing_code) + return + if error_code: msg = getattr(invoice, 'final_error_msg', None) or error_code self.update_status.update_status(f"Payment error: {msg}") @@ -11123,6 +11131,20 @@ class TicketCryptoPickerPage(Page): else: self.update_status.update_status("Cancelled.") + def _prompt_wipe_billingcode(self, temp_billing_code): + msg = QMessageBox(self) + msg.setWindowTitle("Existing billing code found") + msg.setText("You already have a ticket billing code. Do you want to WIPE IT and start over? Hit NO if you ALREADY paid.") + msg.setStandardButtons(QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No) + result = msg.exec() + if result == QMessageBox.StandardButton.Yes: + self.bypass_existing = True + currency_btn = self.buttonGroup.checkedButton() + if currency_btn: + self.start_initiate_payment(currency_btn.property('currency')) + else: + self.update_status.update_status("Cancelled.") + def on_error(self, msg): self.update_status.update_status(f"Payment error: {msg}")