Skip to content

Commit 942f906

Browse files
authored
[CT] Make account verification deposit detection more laxed (#12336)
## Summary of the problem `cirrus3` on Hacker News [reported](https://news.ycombinator.com/item?id=46168821) that we weren't hiding a account verification deposit. We currently have logic for the typical "ACCTVERIFY" transactions. However, it appears that Expensify and a few other companies don't follow that standard. <img width="1057" height="411" alt="image" src="https://github.com/user-attachments/assets/45d429b9-1232-4d63-ba85-58a71298367c" /> ^ How it should look ## Describe your changes I'm allowing these additional substrings to be detected as an account verification transaction: - `verify` - `validation` - `sdv-vrfy` - (in addition to `acctverify`)
1 parent 0a7f59c commit 942f906

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app/models/canonical_transaction.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,12 @@ def likely_ach_confirmation_number
350350
end
351351

352352
def likely_account_verification_related?
353-
hcb_code.starts_with?("HCB-000-") && memo.downcase.include?("acctverify") && amount_cents.abs < 100
353+
# Substring match (case-insensitive) for any of these identifiers in the
354+
# memo indicating an account verification transaction. The majority use
355+
# "ACCTVERIFY", however, it appears a few companies use other variants.
356+
memo_matches = %w[acctverify verify validation sdv-vrfy].any? { |s| memo.downcase.include?(s) }
357+
358+
hcb_code.starts_with?("HCB-000-") && amount_cents.abs < 100 && memo_matches
354359
end
355360

356361
def short_code

0 commit comments

Comments
 (0)