feat: Reimplement credit card support#58
Merged
Conversation
…hCryptoScopeUseCase
- Implement credit card network detection, Luhn validation, and formatting logic in Rust. - Add `CardNumberVisualTransformation` and `CardNumberInputTransformation` to handle real-time field formatting and input sanitization. - Update `KeyGoFormField` to support `OutputTransformation`. - Integrate `CardFormatter` into the credit card creation flow via dependency injection.
Migrates `InputTransformation` and `OutputTransformation` logic from the `CreditCardViewModel` and `CreditCardUiState` directly into the UI layer. This change localizes formatting logic and simplifies the ViewModel. Specific changes include: - Removed transformation properties from `CreditCardUiState`. - Added `rememberCardNumberInputTransformation`, `rememberCardNumberOutputTransformation`, and `rememberCvvInputTransformation` helper functions. - Updated `CreditCardContent` to use these locally remembered transformations. - Removed `CardFormatter` dependency and associated setup from `CreditCardViewModel`. - Refactored `ExpirationDateInputTransformation` and `CardNumberVisualTransformation` to use standard Composable memory patterns instead of singleton injections.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Update `ObfuscatedString` to support custom formatting and visible suffixes, allowing card numbers to maintain their grouping (e.g., spaces) while masking digits. Key changes include: - Enhanced `ObfuscatedString` to preserve non-digit characters and reveal a specified number of suffix digits. - Injected `CardFormatter` into `ViewCreditCardViewModel` to handle network-specific card formatting. - Updated the UI to display the formatted string instead of raw digits when the card number is revealed. - Added comprehensive unit tests for `ObfuscatedString` logic and `ViewCreditCardViewModel` state production.
… networks Unknown IINs now fall back to the full plausible PAN length range so a card can be validated on length + Luhn alone without requiring a recognised network. Renames the public binding and fake accordingly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
lastNumbers was a redundant cache of the last four digits of the card number. The full (encrypted) card number is already stored; deriving a preview string from ciphertext is the ViewModel's job. Removes the column from the Room schema, entity, mapper, domain model, and all test fixtures that referenced it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds InvalidCvv to CreditCardUpsertError and enforces it in CreateNewOrUpdateCreditCardUseCase: when both the card number and CVV are being set, the CVV must match the length reported by the formatter for that network. Updating a CVV without supplying a new card number is left unchecked because the network is unknown in that context. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…reens Propagates InvalidCvv from the use case to the CVV input field in both CreditCardContent (create flow) and ViewCreditCardViewModel (view/edit flow). Adds cvvError to CreditCardBaseState and removes the now-unused lastNumbers field from ViewCreditCardState. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Moves the onHold(false) call into a finally block so the held state is always cleared even when the pointer-input coroutine is cancelled (e.g. by navigation or recomposition). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Closed
5 tasks
The devnied emvnfccard library logs through slf4j-api but ships no slf4j binding, so org.slf4j.impl.StaticLoggerBinder is absent at build time. R8 full-mode treats the missing class as a hard error, breaking the minified app build (and CodeQL autobuild's assemble). Add -dontwarn org.slf4j.** to the module's consumer rules so it propagates into the app's R8 run. slf4j degrades to a no-op logger at runtime, so there is no behavioral impact. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
No description provided.