Instant Donation Refunds
- Dominant language
- Ruby
- Stars
- 870
- Forks
- 138
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 208
Description
For refunded donations, we are currently waiting for an `FS Main -> FS Op` transfer to remove the refunded donation money from the event. This can take a day — meaning the org has access to money they don't own.
### Solution:
- Add pending transaction to the hcb code's group when a refund is issued
- Allow the pending transaction to modify `amount_cents` of hcb code (some weird logic needs to happen here)
- At the moment, hcb code calculates `amount_cents` using only CT — meaning the added PT won't affect `amount_cents`
https://github.com/hackclub/bank/blob/a7ae664fd1241472ee03521edbe42510b2bf801c/app/models/hcb_code.rb#L34-L40
- Settle the pending transaction once the refund transfer arrives
- https://github.com/hackclub/bank/blob/a7ae664fd1241472ee03521edbe42510b2bf801c/app/services/pending_event_mapping_engine/settle/donation_hcb_code.rb
Contributor guide
Research direction
Start with app/models/hcb_code.rb at the linked amount_cents logic, then read app/services/pending_event_mapping_engine/settle/donation_hcb_code.rb. Trace how refunded donations and the FS Main -> FS Op transfer are currently handled. Done means a pending transaction is added and reflected in the HCB code, then settled when the refund transfer arrives.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- backend, payments
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100