Skip to content
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

UI for mock googlepay token creation and conversion #167

Merged
merged 5 commits into from
Mar 2, 2022

Conversation

elizalucas
Copy link
Contributor

@elizalucas elizalucas commented Mar 1, 2022

This is a PR for the UI to generate and convert a google pay token in payments sample app.

  • In smokebox/sandbox we will autogenerate a mock googlepay token (implemented in this PR)
  • In stg/prod we will implement the real google pay button which will call the Google Pay API and return a real googlepay token (not implemented in this PR)
  • The generated tokens will populate the form fields (implemented in this PR for the mock token)
  • The convert token will call the endpoint in wallets-api and return the converted token (not implemented in this PR

Screen Shot 2022-03-01 at 12 30 09 PM

)

yarn.lock Outdated
@@ -5602,7 +5607,7 @@ expect@^27.4.2:
jest-message-util "^27.4.2"
jest-regex-util "^27.4.0"

express@^4.17.3:
express@4.17.3:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, not sure why that's in there.. just pushed an additional commit to remove

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(that happens with yarn add dependency to me also and then you need to go manually remove it when that happens)

Comment on lines 6 to 14
<v-btn
depressed
class="mb-7"
color="primary"
:loading="loading"
@click.prevent="autogenerateToken()"
>
Autogenerate token
</v-btn>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this only be shown in sandbox/smokebox?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented conditional in latest commit

payload = {
type,
token_data: {
protocolVersion: 'ECv1',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be a customer inputed value as well? If there's only 1 possible value. Let's do a drop down with only one selection pre-selected?

}
}

console.log(payload)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we be logging this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed this line

Copy link
Contributor

@huaweigu huaweigu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, but I wonder if we could add some unit test

@elizalucas
Copy link
Contributor Author

lgtm, but I wonder if we could add some unit test

Happy to add unit tests - are you thinking a test for the token conversion? In that case I could add the test in when I actually wire up the button to the endpoint

}

showAutogenerateButton() {
return getIsLocalHost() || getIsSmokebox() || getIsSandbox()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hahaha. I think you can just use !getLive()

timmy-circle
timmy-circle previously approved these changes Mar 1, 2022
Copy link
Contributor

@timmy-circle timmy-circle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. Just one nit.

@huaweigu
Copy link
Contributor

huaweigu commented Mar 1, 2022

lgtm, but I wonder if we could add some unit test

Happy to add unit tests - are you thinking a test for the token conversion? In that case I could add the test in when I actually wire up the button to the endpoint

yes, thanks

@itsikcircle itsikcircle merged commit 9aea89c into circlefin:master Mar 2, 2022
@@ -27,6 +27,7 @@
"@nuxtjs/dotenv": "1.4.1",
"@nuxtjs/vuetify": "1.12.2",
"@types/card-validator": "7.0.1",
"@types/googlepay": "^0.6.4",
Copy link
Contributor

@antiv0 antiv0 Mar 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you shouldn't have these ^ in here
otherwise all is good

@elizalucas elizalucas deleted the mock_googlepay_token branch March 8, 2022 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants