Skip to content

hotfix(send): return payment_hash for internal sends and executed approvals - #126

Merged
helloscoopa merged 1 commit into
mainfrom
rr/send-payment-hash
Nov 20, 2026
Merged

helloscoopa merged 1 commit into
mainfrom
rr/send-payment-hash

Conversation

@rayaanr

@rayaanr rayaanr commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Why

The DCA backend needs to know which row in a user's /api/v1/usertransactions is the transfer that settled a purchase (so the app lists it once, and a transfer from someone else with the memo copied into it isn't mistaken for it). Today it matches by the (Ref: <payment id>) memo ending; the transfer's payment_hash makes it exact.

What

  • POST /api/v1/send (internal send, 200): payment_hash is now the hash of the recipient's invoice the send paid, the same payment_hash as the transfer's /usertransactions row. Invoice payments are unchanged.
  • Approved sends: both approval paths record that hash on the pending transaction once the send executed, so GET /api/v1/send/status/{id} returns it with executed.
    • Telegram approve button: new storage.SetPendingTxPaymentHashFn hook (registered next to UpdatePendingTxStatusFn), called before the status update.
    • Admin API (executePendingTransaction): sets pendingTx.PaymentHash before saving.
  • docs/dca-backend-integration.md §4.1 / §4.2 updated.

Notes

@helloscoopa
helloscoopa merged commit 12bb168 into main Nov 20, 2026
@helloscoopa
helloscoopa deleted the rr/send-payment-hash branch November 20, 2026 08:12
xbuddhi added a commit that referenced this pull request Nov 25, 2026
chore: sync main-only commits to dev (#125, #126, #226 test cleanup)
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