-
Notifications
You must be signed in to change notification settings - Fork 8
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
apple pay convert tokens on stg #189
Conversation
lib/applePayTokens.ts
Outdated
@@ -0,0 +1,196 @@ | |||
import axios from 'axios' |
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.
overly copy-paste of applepay?
Can common part be exported ?
@@ -275,3 +325,16 @@ export default class ConvertToken extends Vue { | |||
} | |||
} | |||
</script> | |||
|
|||
<style scoped> |
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.
do not copy paste style, extract it and import it
<style> @import './assets/styles/.....apple_stuff__.css'; </style>
lib/applePay.ts
Outdated
console.log('received authorization') | ||
console.log(event.payment) | ||
console.log(JSON.stringify(event.payment.token)) | ||
tokens = event.payment.token |
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.
can you write it so that tokens variable doesn't exist in applePay
that is a lib, by adding tokens to lib you are making a static singleton context
would you write it so that you paste in this method a reference to an object tokens
which is instantiated on the page that uses it
@@ -218,6 +240,34 @@ export default class ConvertToken extends Vue { | |||
} | |||
} | |||
|
|||
onApplePayButtonClicked() { | |||
startApplePaySessionFrontendPay({ | |||
currencyCode: |
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 anonymous config object, is it a copy paste ?
if so you can define it as const with these fields and expose and use in both places
appleSession.onpaymentauthorized = function ( | ||
event: ApplePayJS.ApplePayPaymentAuthorizedEvent | ||
) { | ||
console.log('received authorization') |
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.
you can leave console logs if you are still developing
but remember to remove them (these should not exist once in prod/sandbox)
This PR adds the applepay button to the /converttokens page on stg. It gets the apple pay tokens and displays them on the page, and then uses the token to call the /paymenttokens endpoint.
I created a second onpaymentauthorized event handler that gets the apple pay token but doesn't facilitate the payment.