Added Support for resuming a pre-existing ticket payment temp billing code, to lead into a new ticket preparation. As well as improved error handling and status messages

This commit is contained in:
SimplifiedPrivacy 2026-05-23 11:16:07 -04:00
parent 30202dfaba
commit 5766d39260
3 changed files with 30 additions and 6 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
may23.py
old_main.py old_main.py
.idea .idea
.venv .venv

View file

@ -10823,7 +10823,7 @@ class PaymentDetailsPage(Page):
self.update_status.update_status('Awaiting ticket payment...') self.update_status.update_status('Awaiting ticket payment...')
def _on_ticket_check_failed(self, msg): def _on_ticket_check_failed(self, msg):
self.update_status.update_status(f'Payment check failed: {msg}') self.update_status.update_status(f'Status: {msg}')
def show_qr_code(self): def show_qr_code(self):
full_amount = self.text_fields[2].text() full_amount = self.text_fields[2].text()
@ -11030,6 +11030,7 @@ class PlanPickerPage(Page):
class TicketCryptoPickerPage(Page): class TicketCryptoPickerPage(Page):
def __init__(self, page_stack, main_window=None, parent=None): def __init__(self, page_stack, main_window=None, parent=None):
super().__init__("TicketCrypto", page_stack, main_window, parent) super().__init__("TicketCrypto", page_stack, main_window, parent)
self.page_stack = page_stack # incase they already have a code, we're skipping ahead.
self.update_status = main_window self.update_status = main_window
self.selected_plan = None self.selected_plan = None
self.bypass_existing = False self.bypass_existing = False
@ -11078,6 +11079,27 @@ class TicketCryptoPickerPage(Page):
currency = selected_button.property('currency') currency = selected_button.property('currency')
self.start_initiate_payment(currency) self.start_initiate_payment(currency)
# repeated it to make it in this class.
def check_if_paid_for_existing(self, temp_billing_code):
self.update_status.update_status("Checking if paid...")
# using it directly:
result = check_if_paid(temp_billing_code, ticket_observer, connection_observer)
if isinstance(result, dict) and result.get('valid') and result.get('payment_status') == 'paid':
self.update_status.update_status("Already Paid!")
prep_page = self.page_stack.findChild(TicketPrepPage)
if prep_page:
prep_page.start_prep()
self.page_stack.setCurrentWidget(prep_page)
else:
self.update_status.update_status("Not yet paid.")
# copy to clipboard:
clipboard = QApplication.clipboard()
clipboard.setText(temp_billing_code)
# tell end user:
not_paid_msg = f"The billing code is not yet showing paid for {temp_billing_code}. Right now, your clipboard has the billing code, to paste it in any text editor. If you did pay, either wait longer for blockchain confirmation, or contact customer support with the code in your clipboard now."
QMessageBox.information(None, "Not Paid", not_paid_msg)
def start_initiate_payment(self, currency): def start_initiate_payment(self, currency):
self.update_status.update_status("Initiating payment...") self.update_status.update_status("Initiating payment...")
self.worker = TicketingWorkerThread('INITIATE_PAYMENT', params={ self.worker = TicketingWorkerThread('INITIATE_PAYMENT', params={
@ -11134,16 +11156,17 @@ class TicketCryptoPickerPage(Page):
def _prompt_wipe_billingcode(self, temp_billing_code): def _prompt_wipe_billingcode(self, temp_billing_code):
msg = QMessageBox(self) msg = QMessageBox(self)
msg.setWindowTitle("Existing billing code found") 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.setText("You already have a ticket billing code. Do you want to use it? Only hit YES if you ALREADY paid.")
msg.setStandardButtons(QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No) msg.setStandardButtons(QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No)
result = msg.exec() result = msg.exec()
if result == QMessageBox.StandardButton.Yes: if result == QMessageBox.StandardButton.Yes:
self.update_status.update_status("Reusing same code")
self.check_if_paid_for_existing(temp_billing_code)
else:
self.bypass_existing = True self.bypass_existing = True
currency_btn = self.buttonGroup.checkedButton() currency_btn = self.buttonGroup.checkedButton()
if currency_btn: if currency_btn:
self.start_initiate_payment(currency_btn.property('currency')) self.start_initiate_payment(currency_btn.property('currency'))
else:
self.update_status.update_status("Cancelled.")
def on_error(self, msg): def on_error(self, msg):
self.update_status.update_status(f"Payment error: {msg}") self.update_status.update_status(f"Payment error: {msg}")

View file

@ -1,6 +1,6 @@
[project] [project]
name = "sp-hydra-veil-gui" name = "sp-hydra-veil-gui"
version = "2.2.9" version = "2.3.0"
authors = [ authors = [
{ name = "Simplified Privacy" }, { name = "Simplified Privacy" },
] ]
@ -12,7 +12,7 @@ classifiers = [
"Operating System :: POSIX :: Linux", "Operating System :: POSIX :: Linux",
] ]
dependencies = [ dependencies = [
"sp-hydra-veil-core == 2.3.3", "sp-hydra-veil-core == 2.3.4",
"pyperclip ~= 1.9.0", "pyperclip ~= 1.9.0",
"pyqt6 ~= 6.7.1", "pyqt6 ~= 6.7.1",
"qrcode[pil] ~= 8.2" "qrcode[pil] ~= 8.2"