feat: model the onboarding bank, articles and shareholder documents - #361
Conversation
…ocuments Second report, internal, same merchant as InstrumentDocumentType: bank_statement was missing for documents.bank_verification.type on entity onboarding. This is a different enum from the payment instrument one, in a different place. Verified in the spec: documents.bank_verification.type is a single-value enum accepting only bank_statement, and it appears on the EEA, GB and US variants, company and sole trader alike, on schema 2.0 and 3.0. Not EEA/GB only, as reported. Verified in the code that this is a PHP-only gap: net, java, python, ruby and go all already expose BankVerificationType. Here the field was typed as the generic Document, whose docblock reads "value of DocumentType", pointing the caller at the identity enum. The docblock itself sent people to the wrong enum, which is why the value read as missing rather than merely unconstrained. articles_of_association and shareholder_structure had the same problem and are required on the company full variants, so the merchant would hit them next. All three now have their own class plus type constants, following the CompanyVerification and CompanyVerificationType precedent already in this directory. The existing round-trip test now builds those three through the new classes, so it proves the retyped fields still serialize to the same JSON. A new test asserts none of the values are in the identity DocumentType, which is what stops them being merged into it the next time someone reports one as missing. 898 tests green, lint and code sniffer clean. Refs INT-1691.
🟡 Risk Classification: MINORApproval route: AI Review + Human Approval Classification reasons
Operational gates
Files analysed: 9 wall-e 2026.06.19-02 · policy |
🔬 Debug — why this classification?Each reason code emitted by the classifier, its source clause in the AI in SDLC Control Framework, and what it means.
Kinds:
See issue #3 for the proposal to formalise this map as Appendix A of the standards doc. wall-e 2026.06.19-02 · debug |
🟢 Advisory review: Looks good to meThis PR still needs a human approval — wall-e cannot auto-approve it. For what it's worth, I read the diff and found nothing I'd block on. Adds three typed document classes (BankVerification, ArticlesOfAssociation, ShareholderStructure) with their own type-constant classes to replace the mistyped generic Document fields in OnboardSubEntityDocuments; the change is additive, serialization-compatible, and backed by updated round-trip and separation tests. What I checked
This is not an approval. wall-e cannot auto-approve this PR — it is an opinion to help whoever does. Advisory review · us.anthropic.claude-sonnet-4-6 · wall-e 2026.06.19-02 |
|
- Add InstrumentDocumentType with bank_statement for bank account payment instrument documents (#360) - Model the onboarding bank_verification, articles_of_association and shareholder_structure documents as their own classes with their own type constants, instead of the generic Document whose docblock pointed at the identity DocumentType (#361) - Revert build-master.yml to push-only with its original release guard, and build-pull-request.yml to its pre-#362 content; from #362 only the archive download URLs and the checksum verification remain, which is what fixed the 404
- Add InstrumentDocumentType with bank_statement for bank account payment instrument documents (#360) - Model the onboarding bank_verification, articles_of_association and shareholder_structure documents as their own classes with their own type constants, instead of the generic Document whose docblock pointed at the identity DocumentType (#361)
- Add InstrumentDocumentType with bank_statement for bank account payment instrument documents (#360) - Model the onboarding bank_verification, articles_of_association and shareholder_structure documents as their own classes with their own type constants, instead of the generic Document whose docblock pointed at the identity DocumentType (#361)
- Add InstrumentDocumentType with bank_statement for bank account payment instrument documents (#360) - Model the onboarding bank_verification, articles_of_association and shareholder_structure documents as their own classes with their own type constants, instead of the generic Document whose docblock pointed at the identity DocumentType (#361)



What
Models the three onboarding documents that carry a document type, giving each its own class plus type constants:
bank_verification,articles_of_associationandshareholder_structure.Reported internally, same merchant as the payment instrument document type:
bank_statementwas missing fordocuments.bank_verification.typeon entity onboarding. This is a different enum in a different place from the payment instrument one.Verified
In the spec:
documents.bank_verification.typeis a single-value enum accepting onlybank_statement, and it appears on the EEA, GB and US variants, company and sole trader alike, on schema 2.0 and 3.0. Not EEA/GB only, as originally reported.In the code, this is a PHP-only gap: .NET, Java, Python, Ruby and Go all already expose
BankVerificationType.Why it read as "missing"
The field was typed as the generic
Document, whose docblock says@var string value of DocumentType. That is the identity document enum (passport, national identity card, driving license). So the docblock itself pointed the caller at the wrong enum. The value was never rejected by the API, it just could not be found where the SDK said to look.articles_of_associationandshareholder_structurehad exactly the same problem and are required on the company full variants, so they were included: the merchant hits them next.Approach
Follows the
CompanyVerification/CompanyVerificationTypeprecedent already inlib/Checkout/Accounts/.Tests
The existing round-trip test now builds the three documents through the new classes, so it proves the retyped fields still serialize to the same JSON. A new test asserts none of the values are in the identity
DocumentType— that is what stops them being merged into it the next time someone reports one as missing.898 tests green, lint and code sniffer clean.
Not breaking
Additive. The three fields were untyped
Documentholders and PHP does not enforce the docblock, so existing code that set->typeto a literal keeps working unchanged.Refs INT-1691.