Repository navigation
feat(reject): add an ISO 20022 reason code to Reject - #18
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A TAP Reject says why only in
reason, which TAIP-4 defines as a human-readable message. A receiver that wants to act on the reason, not just show it, has to parse prose, and the prose differs between implementations. The case that prompted this: a beneficiary VASP answers a wallet-confirmation ask with "that settlement address isn't ours", and the originator should stop treating the address as that VASP's. Today it can only guess from the text.This adds an optional
codetoRejectBody, next toreason.reasonstays free text for people;codeis what a receiver acts on.Codes come from ISO 20022
The values come from the ISO 20022
ExternalStatusReason1Codelist, not from a new TAP list.RJCT) and says to "include reason code", but no TAIP says where that code goes.There is one value for now:
RejectCodeInvalidCreditorAccountNumber=AC03("Creditor account number invalid or missing");Strict when sending, lenient when reading
codeis a named type,RejectCode.NewRejectMessagerefuses any code this library doesn't define and returnsErrInvalidBody, so a typo or an invented code fails when the message is built. Allowing another code means adding a constant.ParseBodykeeps whatever code arrives. Another implementation may send an ISO value we don't define yet; a receiver ignores it instead of dropping the whole Reject. This is the same send-strict, read-lenient split asforin fix(taip-5): requireforon address agents #15.codeis left out of the JSON, so a Reject without one is byte-for-byte what it was.Needs the matching TAIPs change
The TAIPs JSON schema for Reject sets
additionalProperties: false. So a peer that validates strictly against it will refuse a Reject carryingcodeuntil TAIP-4 andschemas/messages/reject.jsongain the field.