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:
parent
30202dfaba
commit
5766d39260
3 changed files with 30 additions and 6 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,3 +1,4 @@
|
|||
may23.py
|
||||
old_main.py
|
||||
.idea
|
||||
.venv
|
||||
|
|
|
|||
|
|
@ -10823,7 +10823,7 @@ class PaymentDetailsPage(Page):
|
|||
self.update_status.update_status('Awaiting ticket payment...')
|
||||
|
||||
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):
|
||||
full_amount = self.text_fields[2].text()
|
||||
|
|
@ -11030,6 +11030,7 @@ class PlanPickerPage(Page):
|
|||
class TicketCryptoPickerPage(Page):
|
||||
def __init__(self, page_stack, main_window=None, parent=None):
|
||||
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.selected_plan = None
|
||||
self.bypass_existing = False
|
||||
|
|
@ -11078,6 +11079,27 @@ class TicketCryptoPickerPage(Page):
|
|||
currency = selected_button.property('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):
|
||||
self.update_status.update_status("Initiating payment...")
|
||||
self.worker = TicketingWorkerThread('INITIATE_PAYMENT', params={
|
||||
|
|
@ -11134,16 +11156,17 @@ class TicketCryptoPickerPage(Page):
|
|||
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.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)
|
||||
result = msg.exec()
|
||||
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
|
||||
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}")
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[project]
|
||||
name = "sp-hydra-veil-gui"
|
||||
version = "2.2.9"
|
||||
version = "2.3.0"
|
||||
authors = [
|
||||
{ name = "Simplified Privacy" },
|
||||
]
|
||||
|
|
@ -12,7 +12,7 @@ classifiers = [
|
|||
"Operating System :: POSIX :: Linux",
|
||||
]
|
||||
dependencies = [
|
||||
"sp-hydra-veil-core == 2.3.3",
|
||||
"sp-hydra-veil-core == 2.3.4",
|
||||
"pyperclip ~= 1.9.0",
|
||||
"pyqt6 ~= 6.7.1",
|
||||
"qrcode[pil] ~= 8.2"
|
||||
|
|
|
|||
Loading…
Reference in a new issue