-
Notifications
You must be signed in to change notification settings - Fork 7
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
Conversation
: '' | ||
|
||
const checkoutKey: string = googlePaySecretsAreSet | ||
? process.env.GOOGLE_PAY_PAYFAC_CHECKOUT_KEY! |
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.
when do you use this payfac checkout key ?
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.
convertToken.vue line 166
lib/googlePay.ts
Outdated
: config.merchantId | ||
const merchantName = | ||
config.merchantName === null | ||
? DEFAULT_CONFIG.merchantInfo.merchantName |
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.
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 ?
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.
true… I guess for the values coming from stored secrets it would never need to come from default config
lib/googlePay.ts
Outdated
currencyCode: 'USD', | ||
countryCode: 'US', | ||
totalPriceStatus: 'FINAL', | ||
totalPrice: '0.00', | ||
totalPrice: '1.00', |
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 guess for those transaction info, shouldn't it be passed from customers?
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 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
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.
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)
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.
ah my bad, i misspoke, then this is 0 :D
@@ -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 |
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.
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 = !( |
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.
Is there a way we can pick partnership
or payfac
from the dropdown? Can come in next PR
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.
Yep this is definitely doable, I can include in a follow up PR
This PR accesses the stored secrets for google pay session validation
googlePaySettings.ts
filePaymentRequestConfig
object in order to include the values in thePaymentDataRequest
object