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
Add error reporting to GooglePayRepository
#8218
base: master
Are you sure you want to change the base?
Conversation
), | ||
analyticsRequestExecutor = DefaultAnalyticsRequestExecutor(), | ||
paymentAnalyticsRequestFactory = analyticsRequestFactory, | ||
analyticsRequestExecutor = analyticsRequestExecutor, |
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.
Created this constructor in order to avoid recreating PaymentAnalyticsRequestFactory
and AnalyticsRequestExecutor
. It also ended up moving all the logic for building DefaultGooglePayRepository
into a single location.
fun providesErrorReporter( | ||
analyticsRequestFactory: AnalyticsRequestFactory, | ||
analyticsRequestExecutor: DefaultAnalyticsRequestExecutor, | ||
): ErrorReporter = RealErrorReporter( |
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.
CustomerSheetViewModelModule
provides a base AnalyticsRequestFactory
and not the PaymentAnalyticsRequestFactory
. Should we always defer to PaymentAnalyticsRequestFactory
?
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.
Actually I think we should defer to PaymentAnalyticsRequestFactory
. There has been an issue with PaymentSheet
and FlowController
not properly attributing its product usage with a lot of its request and it looks like it's in relation to the usage of the base AnalyticsRequestFactory
which doesn't send product usage by default.
Diffuse output:
APK
DEX
|
payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayLauncherViewModel.kt
Outdated
Show resolved
Hide resolved
payments-core/src/main/java/com/stripe/android/googlepaylauncher/GooglePayLauncher.kt
Outdated
Show resolved
Hide resolved
453de8a
to
687d918
Compare
@@ -57,6 +57,7 @@ internal class PaymentSheetAnalyticsTest { | |||
validateAnalyticsRequest(eventName = "mc_load_started") | |||
validateAnalyticsRequest(eventName = "mc_load_succeeded") | |||
validateAnalyticsRequest(eventName = "mc_complete_sheet_newpm_show") | |||
validateAnalyticsRequest(eventName = "elements.google_pay_repository.is_ready_request_api_call_failure") |
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 could also turn off google pay for these tests.
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 always run an operation to check if the device is supported by Google Pay irregardless of if Google Pay is enabled in the config which is why this failure happens. I could disable this check in debug 😬
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 we check even if google pay is disabled coming from elements/sessions?
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.
Yup! iOS does this as well with Apple Pay
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.
Could we return a different mocked response so that we don't do this then?
687d918
to
e59d532
Compare
Summary
Add error reporting to
GooglePayRepository
.Motivation
Adds visibility into potential issues with Google Pay.
Testing