PP-12240: Card length validation matches CARD_RANGE_LENGTH #1164
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.
WHAT YOU DID
I used
CARD_RANGE_LENGTH
to define the minimum length for the card number as any card number shorter than this leads to a 404 even if the range is correct.How to test
71221111
from src/test/resources/card-id-resource-integration-test/test-bin-ranges.csv)71221111
, then712211110
, then7122111100
Expectation: The first requests should give validation failures (
422
status code), then when they pass validation they should be found (200
status code), if you continue to make them longer you'll reach another validation failure (422
status code).Current reality: The first requests should give validation failures (
422
status code), then when they pass validation then when you reach 10 characters it will pass validation but fail to find the card (404
status code), then adding one more zero leads to it being found (200
status code), if you continue to make them longer you'll reach another validation failure (422
status code).Code review checklist
Logging
Documentation
CARD_RANGE_LENGTH
and already implies that no other change is needed - with this PR no other change is needed (AFAICT).