Skip to content

Conversation

annvelents
Copy link
Contributor

@annvelents annvelents commented May 22, 2025

Context

we got a bug where:

  1. a credit was purchased (1$)
  2. invoice marked as succeeded -> wallet transaction marked as settled,
  3. wallet balance is updated to 1$
  4. invoice payment status updated to failed -> wallet transaction marked as failed
  5. wallet balance WAS NOT updated (still 1$) - FIRST ISSUE
  6. invoice is voided -> recredit wallet_transaction is created - SECOND ISSUE
  7. wallet balance increases to 2$

Description

  • when fail a wallet transaction, if a transaction was settled before, it will stay settled, the credits should be voided manually
  • when recredit wallet_transactions when voiding an invoice, only recredit outbound wallet transaction (exactly "applied" credits from the wallet)

Copy link
Contributor

@ancorcruz ancorcruz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as mentioned in a call... settled wallet transactions should not be updated as failed, instead the WT should be voided and created a new WT to deduct the amount.

Another question is why a succeeded payment became failed?

@annvelents annvelents force-pushed the fix/failed-wallet-transaction-update-wallet branch from 4e4cdee to 690512d Compare May 23, 2025 13:06
@annvelents annvelents merged commit 4098769 into main May 27, 2025
14 checks passed
@annvelents annvelents deleted the fix/failed-wallet-transaction-update-wallet branch May 27, 2025 07:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants