-
Notifications
You must be signed in to change notification settings - Fork 473
Issue #9838: Introduce CreditCardValidationDelegate and implement onCreditCardSave in GeckoCreditCardsAddressesStorageDelegate #11231
Conversation
b011793
to
0a8590e
Compare
This pull request has conflicts when rebasing. Could you fix it @gabrielluong? 🙏 |
0d7e667
to
77d6e93
Compare
c9327d6
to
a12a28b
Compare
This pull request has conflicts when rebasing. Could you fix it @gabrielluong? 🙏 |
This pull request has conflicts when rebasing. Could you fix it @gabrielluong? 🙏 |
ee373fb
to
334b131
Compare
This pull request has conflicts when rebasing. Could you fix it @gabrielluong? 🙏 |
ee373fb
to
a29dc4f
Compare
This pull request has conflicts when rebasing. Could you fix it @gabrielluong? 🙏 |
This pull request has conflicts when rebasing. Could you fix it @gabrielluong? 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good overall! I left some feedback on how you can improve the code to make it a tad faster (and maybe neater).
* @property expiryYear The credit card expiry year. | ||
* @property cardType The credit card network ID. | ||
*/ | ||
data class CreditCardEntry( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you could reduce duplication between CreditCardEntry
and CreditCard
by composing them, i.e. wrapping one inside another, perhaps? E.g. CreditCard
could have cardData
or card
field which is an instance of CreditCardEntry
.
Doing this could be awkward in other places, but maybe not. Just an idea! This sort of thing worked out well for RecoverableTab
and TabState
stuff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit awkward because we would need to take the GV Autocomplete.CreditCard
which has the plain credit card number and encrypt it back to CreditCard
. Using CreditCardEntry
that simply wraps the GV Autocomplete.CreditCard
which makes it easier to pass thing along through the GV <-> Prompt Feature. This currently also follows the LoginEntry
.
...cept/storage/src/main/java/mozilla/components/concept/storage/CreditCardsAddressesStorage.kt
Outdated
Show resolved
Hide resolved
...cept/storage/src/main/java/mozilla/components/concept/storage/CreditCardsAddressesStorage.kt
Outdated
Show resolved
Hide resolved
...cept/storage/src/main/java/mozilla/components/concept/storage/CreditCardsAddressesStorage.kt
Outdated
Show resolved
Hide resolved
...rc/main/java/mozilla/components/service/sync/autofill/DefaultCreditCardValidationDelegate.kt
Outdated
Show resolved
Hide resolved
This pull request has conflicts when rebasing. Could you fix it @gabrielluong? 🙏 |
… implement onCreditCardSave in GeckoCreditCardsAddressesStorageDelegate - Introduces `CreditCardValidationDelegate` and a default implementation in `DefaultCreditCardValidationDelegate` - Implements `onCreditCardSave` in `GeckoCreditCardsAddressesStorageDelegate` - Refactors `CreditCard` from concept-engine to `CreditCardEntry` in concept-storage so that it can validated with the `CreditCardValidationDelegate`
@Mergifyio requeue |
Fixes #9838
Pull Request checklist
After merge