forked from Support/sp-hydra-veil-gui
Fixing ticket wipe logic
This commit is contained in:
parent
99eea377f2
commit
5cc93ed77b
1 changed files with 7 additions and 1 deletions
|
|
@ -5,6 +5,7 @@ from PyQt6.QtGui import QIcon
|
||||||
from PyQt6.QtCore import QSize
|
from PyQt6.QtCore import QSize
|
||||||
from PyQt6 import QtCore
|
from PyQt6 import QtCore
|
||||||
|
|
||||||
|
from core.services.prepare_tickets.ticket_tracker import delete_ticket_data
|
||||||
from core.controllers.tickets.TicketPayController import check_if_paid
|
from core.controllers.tickets.TicketPayController import check_if_paid
|
||||||
from core.models.Result import Result, ResultError
|
from core.models.Result import Result, ResultError
|
||||||
|
|
||||||
|
|
@ -119,11 +120,14 @@ class TicketCryptoPickerPage(Page):
|
||||||
self._prompt_wipe_existing(invoice)
|
self._prompt_wipe_existing(invoice)
|
||||||
return
|
return
|
||||||
elif error_code == ResultError.BILLING_CODE_EXISTS and not self.bypass_existing:
|
elif error_code == ResultError.BILLING_CODE_EXISTS and not self.bypass_existing:
|
||||||
temp_billing_code = getattr(invoice_data, 'temp_billing_code', None)
|
temp_billing_code = getattr(invoice, 'temp_billing_code', None)
|
||||||
print(f"temp_billing_code is {temp_billing_code}")
|
print(f"temp_billing_code is {temp_billing_code}")
|
||||||
if temp_billing_code:
|
if temp_billing_code:
|
||||||
self._prompt_wipe_billingcode(temp_billing_code)
|
self._prompt_wipe_billingcode(temp_billing_code)
|
||||||
return
|
return
|
||||||
|
else:
|
||||||
|
self._prompt_wipe_billingcode("NONE")
|
||||||
|
return
|
||||||
else:
|
else:
|
||||||
error_msg = invoice.message
|
error_msg = invoice.message
|
||||||
# msg = getattr(invoice, 'final_error_msg', None) or error_code
|
# msg = getattr(invoice, 'final_error_msg', None) or error_code
|
||||||
|
|
@ -140,6 +144,7 @@ class TicketCryptoPickerPage(Page):
|
||||||
result = msg.exec()
|
result = msg.exec()
|
||||||
if result == QMessageBox.StandardButton.Yes:
|
if result == QMessageBox.StandardButton.Yes:
|
||||||
self.bypass_existing = True
|
self.bypass_existing = True
|
||||||
|
delete_ticket_data()
|
||||||
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'))
|
||||||
|
|
@ -159,6 +164,7 @@ class TicketCryptoPickerPage(Page):
|
||||||
self.check_if_paid_for_existing(temp_billing_code)
|
self.check_if_paid_for_existing(temp_billing_code)
|
||||||
else:
|
else:
|
||||||
self.bypass_existing = True
|
self.bypass_existing = True
|
||||||
|
delete_ticket_data()
|
||||||
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'))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue