Skip to content

Conversation

@github-actions
Copy link

Automatic Release PR

This PR was automatically created after changes were pushed to develop.

Commits: 1 new commit(s)

Checklist

  • Review all changes
  • Verify CI passes
  • Approve and merge when ready for production

… admin update (#2922)

* fix: trigger crypto return flow when chargebackAllowedDate is set via admin update

When an admin sets chargebackAllowedDate directly via the BuyFiat update
endpoint, the CryptoInput was not being prepared for return. This left
transactions stuck in Completed status with no way to execute the refund.

- Save cryptoInput and chargebackAllowedDate before save operation
- Add triggerCryptoInputReturn() method to handle return flow
- Call PayoutService for FORWARD_CONFIRMED status (funds on liquidity)
- Call PayInService for COMPLETED status (funds on deposit address)

The fix ensures that admin-initiated refunds properly trigger the
return flow, regardless of whether refundBuyFiatInternal() was called.

* fix: add safety guards for return flow edge cases

- Skip if return already in progress (TO_RETURN, RETURNED, RETURN_CONFIRMED)
- Skip if returnTxId already set
- Skip if action is FORWARD (coins being forwarded, not on deposit)
- Import PayInAction enum

* fix: add null check for cryptoInput.asset in return flow

* fix: load cryptoInput.route.user relation for returnPayIn

returnPayIn() requires route.user to update the transaction.
Without this relation loaded, the transaction user would be set to undefined.

* chore: cleanup

* fix: fixed return check

---------

Co-authored-by: David May <david.leo.may@gmail.com>
@TaprootFreak TaprootFreak merged commit 7e6a6ba into main Jan 13, 2026
7 checks passed
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.

2 participants