From 39fd894792a4914d9eefb7bf1ece1b9b075854a5 Mon Sep 17 00:00:00 2001 From: Victoria Earl Date: Mon, 9 Oct 2023 16:25:10 -0400 Subject: [PATCH] Uncancel paid transactions Adds a failsafe where any transaction marked as paid is uncancelled, to fix rare cases where Stripe takes money but our system thinks the transaction got cancelled instead. --- uber/payments.py | 3 +++ uber/templates/reg_admin/receipt_items.html | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/uber/payments.py b/uber/payments.py index 52cc73c1c..7a446bd0c 100644 --- a/uber/payments.py +++ b/uber/payments.py @@ -1083,6 +1083,9 @@ def mark_paid_from_ids(intent_id, charge_id): session.add(txn) txn_receipt = txn.receipt + if txn.cancelled != None: + txn.cancelled == None + for item in txn.receipt_items: item.closed = datetime.now() session.add(item) diff --git a/uber/templates/reg_admin/receipt_items.html b/uber/templates/reg_admin/receipt_items.html index 0419902c7..cd6c5df37 100644 --- a/uber/templates/reg_admin/receipt_items.html +++ b/uber/templates/reg_admin/receipt_items.html @@ -568,7 +568,7 @@

Receipt{% if other_receipts %}s{% endif %} for {% if model.attendee %}{{ mod Refund {% else %} refundItem('{{ item.id }}', '{{ (item.amount / 100)|format_currency }}', '{{ item.count }}', '{{ item.revert_change|yesno }}')"> - Refund Item + Refund Options {% endif %} {% endif %}