Fixed Bitcoin Lightning for Tickets & prevented billing codes from being wiped if a temp billing code already exists
This commit is contained in:
parent
13ebe11523
commit
30202dfaba
2 changed files with 24 additions and 1 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -1,3 +1,4 @@
|
||||||
|
old_main.py
|
||||||
.idea
|
.idea
|
||||||
.venv
|
.venv
|
||||||
dist
|
dist
|
||||||
|
|
|
||||||
|
|
@ -10379,7 +10379,7 @@ class CurrencySelectionPage(Page):
|
||||||
button_info = [
|
button_info = [
|
||||||
("monero", (545, 75)),
|
("monero", (545, 75)),
|
||||||
("bitcoin", (545, 290)),
|
("bitcoin", (545, 290)),
|
||||||
("lightnering", (545, 180)),
|
("lightning", (545, 180)), # going to ticket server as "lightning"
|
||||||
("litecoin", (545, 395))
|
("litecoin", (545, 395))
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
@ -11099,6 +11099,14 @@ class TicketCryptoPickerPage(Page):
|
||||||
if error_code == 'already_exists' and not self.bypass_existing:
|
if error_code == 'already_exists' and not self.bypass_existing:
|
||||||
self._prompt_wipe_existing(invoice)
|
self._prompt_wipe_existing(invoice)
|
||||||
return
|
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:
|
if error_code:
|
||||||
msg = getattr(invoice, 'final_error_msg', None) or error_code
|
msg = getattr(invoice, 'final_error_msg', None) or error_code
|
||||||
self.update_status.update_status(f"Payment error: {msg}")
|
self.update_status.update_status(f"Payment error: {msg}")
|
||||||
|
|
@ -11123,6 +11131,20 @@ class TicketCryptoPickerPage(Page):
|
||||||
else:
|
else:
|
||||||
self.update_status.update_status("Cancelled.")
|
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):
|
def on_error(self, msg):
|
||||||
self.update_status.update_status(f"Payment error: {msg}")
|
self.update_status.update_status(f"Payment error: {msg}")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue