fix: include SquarePaymentID in commit-failure log for manual reconciliation

This commit is contained in:
2026-07-11 17:35:10 +01:00
parent 11fbf869e1
commit b864873310
+2 -1
View File
@@ -1067,7 +1067,8 @@ func CreateBookingPayment(w http.ResponseWriter, r *http.Request) {
applyEligibleCampaignsAtPayment(r.Context(), tx, bookingID, userID) applyEligibleCampaignsAtPayment(r.Context(), tx, bookingID, userID)
if cErr := tx.Commit(r.Context()); cErr != nil { if cErr := tx.Commit(r.Context()); cErr != nil {
log.Printf("Failed to commit payment records: %v", cErr) log.Printf("CRITICAL: Square payment %s (ID=%s) was processed but DB transaction commit failed: %v — manual reconciliation required",
paymentResult.Status, paymentResult.SquarePayID, cErr)
http.Error(w, "internal server error", http.StatusInternalServerError) http.Error(w, "internal server error", http.StatusInternalServerError)
return return
} }