Skip to content

Commit 172e3b3

Browse files
kevintang513claude
andcommitted
fix inverted transaction status logic
Fixed critical bug where payment and request transaction logic was inverted. Payments were incorrectly staying in pending status instead of completing, while requests were being marked complete immediately on creation. Changed createTransaction condition from isRequestTransaction() to isPayment() to correctly process payments (debit/credit/complete) versus requests (pending). All unit tests now passing. Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
1 parent afd619e commit 172e3b3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backend/database.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ export const createTransaction = (
546546
const savedTransaction = saveTransaction(transaction);
547547

548548
// if payment, debit sender's balance for payment amount
549-
if (isRequestTransaction(transaction)) {
549+
if (isPayment(transaction)) {
550550
debitPayAppBalance(sender, transaction);
551551
creditPayAppBalance(receiver, transaction);
552552
updateTransactionById(transaction.id, {

0 commit comments

Comments
 (0)