BILL-5588: Add descriptor_code support to bank account verification#349
BILL-5588: Add descriptor_code support to bank account verification#349kevinpjones wants to merge 6 commits into
Conversation
Stripe updated microdeposit verification from two amounts to a single 6-character descriptor code. This adds descriptor_code as an alternative to amounts on BankAccountVerify (with mutual-exclusion validation and pattern enforcement), exposes microdeposit_type on BankAccount so callers know which path to use, and fixes the pom.xml nexus plugin configuration that was blocking local builds. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request introduces support for verifying bank accounts using a descriptor code in addition to microdeposit amounts. It adds the microdeposit_type field to the BankAccount model and the descriptor_code field to the BankAccountVerify model, along with corresponding validation logic, unit tests, and integration tests. The feedback highlights a potential breaking change where removing the default initialization of the amounts list in BankAccountVerify could cause NullPointerExceptions for existing clients. It is recommended to restore the default initialization, update the validation logic to check for non-empty lists, and precompile the regular expression pattern for the descriptor code to improve performance.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Only remove <extensions>true</extensions> from nexus-staging-maven-plugin, which was blocking local builds by forcing resolution at POM load time. Restore version 1.7.0 and ossrh pluginRepository to their original values. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Description
Problem: Stripe's Setup Intents API added a descriptor code-based microdeposit verification path alongside the legacy two-amount path. When a bank account is created via Setup Intents, Stripe sends a single $0.01 deposit whose statement descriptor contains a 6-character code beginning with
SM. The Java SDK had no support for this path.Solution:
descriptor_code(String) as an alternative toamountsonBankAccountVerify, with mutual-exclusion validation viaisValid()and pattern enforcement (^SM[a-zA-Z0-9]{4}$) on the settermicrodeposit_typefield toBankAccountresponse model so callers can determine which verification path applies before calling verifypom.xml: removed defunct ossrhpluginRepositoryentry (s01.oss.sonatype.org is decommissioned) and removed<extensions>true</extensions>fromnexus-staging-maven-pluginso it no longer blocks local builds as a build extensionNon-breaking: All existing code using
amountscontinues to work without any changes.Story
https://lobsters.atlassian.net/browse/BILL-5588 (subtask of BILL-5581)
Related PRs
Mirrors lob/lob-php#192
Verify
mvn test -Dgroups="Unit")