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

googlepay secrets implementation #180

Merged
merged 6 commits into from
Mar 9, 2022

Conversation

elizalucas
Copy link
Contributor

@elizalucas elizalucas commented Mar 8, 2022

This PR accesses the stored secrets for google pay session validation

  • Accesses the stored secrets in the newly created googlePaySettings.ts file
  • Adds the secret fields to the PaymentRequestConfig object in order to include the values in the PaymentDataRequest object

: ''

const checkoutKey: string = googlePaySecretsAreSet
? process.env.GOOGLE_PAY_PAYFAC_CHECKOUT_KEY!
Copy link
Contributor

Choose a reason for hiding this comment

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

when do you use this payfac checkout key ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

convertToken.vue line 166

lib/googlePay.ts Outdated
: config.merchantId
const merchantName =
config.merchantName === null
? DEFAULT_CONFIG.merchantInfo.merchantName
Copy link
Contributor

Choose a reason for hiding this comment

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

when does it make sense to ever use default config here, if you are testing on local you will just write it in here immediatelly without extra step of going over objects ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true… I guess for the values coming from stored secrets it would never need to come from default config

antiv0
antiv0 previously approved these changes Mar 8, 2022
lib/googlePay.ts Outdated
Comment on lines 32 to 35
currencyCode: 'USD',
countryCode: 'US',
totalPriceStatus: 'FINAL',
totalPrice: '0.00',
totalPrice: '1.00',
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess for those transaction info, shouldn't it be passed from customers?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't now if Eliza has form for her button, but if she doesn't
that could be because i suggested her to leave the form (which is easiest part) last
in getting the google pay to work
and to just hardcode stuff like amount and other fields in the bill

and then when she has all parts working to slap a form and remove hardcoding
// so that errors from form do not delay implementation or misguide in errors

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes it'll get the value that is entered in sampleapp first, just had this value in the DEFAULT_CONFIG object in case no value is passed in sample app (on line 70 it uses the entered payment amount unless the value is null, in which case it would use this value)

Copy link
Contributor

Choose a reason for hiding this comment

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

ah my bad, i misspoke, then this is 0 :D

antiv0
antiv0 previously approved these changes Mar 8, 2022
@@ -114,10 +123,12 @@ export default class ConvertToken extends Vue {
allowedPaymentMethods: [DEFAULT_CONFIG.allowedPaymentMethods],
}

// Production environment is not yet enabled for googlepay - will uncomment lines 129-131 when it is
Copy link
Contributor Author

@elizalucas elizalucas Mar 8, 2022

Choose a reason for hiding this comment

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

We cannot use the prod environment until the web integration is approved by Google. Google API returns a sample token when test env is used which we can use for testing in the meantime

@@ -0,0 +1,19 @@
const googlePaySecretsAreSet = !(
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way we can pick partnership or payfac from the dropdown? Can come in next PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep this is definitely doable, I can include in a follow up PR

@huaweigu huaweigu merged commit c470133 into circlefin:master Mar 9, 2022
@elizalucas elizalucas deleted the googlepay_secrets branch March 10, 2022 22:00
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.

4 participants