Repository navigation
fix: cap card number and CVV lengths by detected brand (v1.0.1) - #25
Merged
Merged
Conversation
The card form accepted up to 19 digits for every brand. The card number is now capped at 15 digits when American Express is detected and at 16 for every other brand. A security code typed for a previous brand is also cut to the new brand length (4 digits for American Express, 3 otherwise) when the card number changes. Co-Authored-By: Claude <noreply@anthropic.com>
Aligns VERSION_NAME, OpenpaySdk.VERSION and the dependency snippets in the README and the four-language getting started guides, so the v1.0.1 tag passes the CD version guard. Co-Authored-By: Claude <noreply@anthropic.com>
Unit test coverage
Files
|
2 of 3 tasks
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.
Summary
Fixes two input bugs in the SDK card form (visible in the sample app's
AddCardScreen) and bumps the library to 1.0.1 so the fix can be released.Card number length
CardBrandgains acardNumberLengthproperty next tosecurityCodeLength, andOpenpayCardFormState.updateCardNumbercaps the input with it. Editing a 16-digit number so that it becomes Amex re-caps it to 15.Security code (CVV) length
updateCardNumbernow cuts the security code to the length of the newly detected brand.Version bump
VERSION_NAME(gradle.properties) andOpenpaySdk.VERSION→1.0.1.README.mdand the EN/ES/FR/PT getting started guides →1.0.1.docs/*/ui-components.md(EN/ES/FR/PT) describe the new card number cap.Not changed
CardValidator.isValidCardNumberstill accepts 12–19 digit numbers that pass Luhn. Only the form input is capped; hosts calling the validator directly see no behavior change.CardNumberVisualTransformationkeeps its 19-digit grouping for hosts that use it outside the form state.Release path
CD runs on a
v*tag and checks that the tag equalsVERSION_NAME:develop.develop→master.v1.0.1onmaster→ CD runs tests, uploads the signed artifacts, promotes the staging repository and creates the GitHub release.Test plan
./gradlew testDebugUnitTest jacocoTestReport :openpay-sdk:jacocoCoverageVerificationpasses locally (80% coverage gate included)OpenpayCardFormStateTestandCardBrandTestfor the 15/16 digit caps and the CVV trim on brand changeOpenpayCardFormComposeTesttyping over-long Visa and Amex numbers and switching brand after typing the CVV🤖 Generated with Claude Code