-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PIMOB: Java sample app updated for CVV tokenization #246
Merged
chintan-soni-cko
merged 2 commits into
master
from
feature/PIMOB-2176_update_cvv_tokenisation_java_sample_app
Oct 13, 2023
Merged
PIMOB: Java sample app updated for CVV tokenization #246
chintan-soni-cko
merged 2 commits into
master
from
feature/PIMOB-2176_update_cvv_tokenisation_java_sample_app
Oct 13, 2023
Conversation
This file contains 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
chintan-soni-cko
requested review from
deepesh-vasthimal-cko,
fabio-insolia-cko and
jheng-hao-lin-cko
October 12, 2023 16:29
Comment on lines
92
to
103
private void createCVVComponentMediator(CVVComponentApi cvvComponentApi) { | ||
// Create config for CVV component | ||
CVVComponentConfig visaCVVComponentConfig = new CVVComponentConfig( | ||
CardScheme.Companion.fromString("unknown"), | ||
isEnteredCVVValid -> Unit.INSTANCE, | ||
DefaultCVVInputFieldStyle.INSTANCE.create() | ||
); | ||
|
||
// Create CVVComponentMediator for CVV component | ||
CVVComponentMediator defaultCVVComponentMediator = cvvComponentApi.createComponentMediator(visaCVVComponentConfig); | ||
View defaultCVVComponentView = defaultCVVComponentMediator.provideCvvComponentContent(cvvComponentLinearLayout); | ||
|
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.
Let's add final
for all the immutable variables, same for all the other code
Suggested change
private void createCVVComponentMediator(CVVComponentApi cvvComponentApi) { | |
// Create config for CVV component | |
CVVComponentConfig visaCVVComponentConfig = new CVVComponentConfig( | |
CardScheme.Companion.fromString("unknown"), | |
isEnteredCVVValid -> Unit.INSTANCE, | |
DefaultCVVInputFieldStyle.INSTANCE.create() | |
); | |
// Create CVVComponentMediator for CVV component | |
CVVComponentMediator defaultCVVComponentMediator = cvvComponentApi.createComponentMediator(visaCVVComponentConfig); | |
View defaultCVVComponentView = defaultCVVComponentMediator.provideCvvComponentContent(cvvComponentLinearLayout); | |
private void createCVVComponentMediator(CVVComponentApi cvvComponentApi) { | |
// Create config for CVV component | |
final CVVComponentConfig visaCVVComponentConfig = new CVVComponentConfig( | |
CardScheme.Companion.fromString("unknown"), | |
isEnteredCVVValid -> Unit.INSTANCE, | |
DefaultCVVInputFieldStyle.INSTANCE.create() | |
); | |
// Create CVVComponentMediator for CVV component | |
final CVVComponentMediator defaultCVVComponentMediator = cvvComponentApi.createComponentMediator(visaCVVComponentConfig); | |
final View defaultCVVComponentView = defaultCVVComponentMediator.provideCvvComponentContent(cvvComponentLinearLayout); | |
Comment on lines
60
to
66
override fun provideCvvComponentContent( | ||
container: View, | ||
): View = ComposeView(container.context).apply { | ||
// Dispose of the Composition when the view's LifecycleOwner is destroyed | ||
setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed) | ||
setContent { InternalCVVComponent() } | ||
} |
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 can be this?
Suggested change
override fun provideCvvComponentContent( | |
container: View, | |
): View = ComposeView(container.context).apply { | |
// Dispose of the Composition when the view's LifecycleOwner is destroyed | |
setViewCompositionStrategy(ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed) | |
setContent { InternalCVVComponent() } | |
} | |
override fun provideCvvComponentContent( | |
container: View, | |
): View = provideCvvComponentContent(view, ViewCompositionStrategy.DisposeOnViewTreeLifecycleDestroyed) |
chintan-soni-cko
force-pushed
the
feature/PIMOB-2176_update_cvv_tokenisation_java_sample_app
branch
from
October 13, 2023 11:33
b3a37d5
to
0c87c11
Compare
jheng-hao-lin-cko
approved these changes
Oct 13, 2023
chintan-soni-cko
deleted the
feature/PIMOB-2176_update_cvv_tokenisation_java_sample_app
branch
October 13, 2023 13:59
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.
Issue
PIMOB-2176
Proposed changes
provideCvvComponentContent
for the merchant who is not using compose in Java or kotlin languageNote: This is a traditional sample app and added minimal UI design just for demonstrating how it will work without compose UI
Tes
java.webm
Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you choose the solution you did and what alternatives you considered, etc...