-
Notifications
You must be signed in to change notification settings - Fork 976
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
Fail & log payment attempt for a deferred intent with a next action #4026
base: master
Are you sure you want to change the base?
Conversation
…s into joyceqin-MOBILESDK-1792
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.
looks good, minor nit's
@@ -194,6 +194,7 @@ import Foundation | |||
case paymentSheetFormShown = "mc_form_shown" | |||
case paymentSheetFormInteracted = "mc_form_interacted" | |||
case paymentSheetCardNumberCompleted = "mc_card_number_completed" | |||
case paymentSheetIntentPaymentMethodIdMismatch = "mc_intent_payment_method_id_mismatch" |
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.
Let's rename this to mc_deferred_intent_payment_method_id_mismatch
@@ -53,6 +54,8 @@ struct PaymentSheetDeferredValidator { | |||
return | |||
} | |||
guard intentPaymentMethod.stripeId == paymentMethod.stripeId else { | |||
let errorAnalytic = ErrorAnalytic(event: .paymentSheetIntentPaymentMethodIdMismatch, error: PaymentSheetError.unknown(debugDescription: "Payment method ids don't match")) |
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.
Let's use the same error message in debugDescription
as we do in the message below in the error we throw.
Summary
Added an STPAnalyticsEvent paymentSheetIntentPaymentMethodIdMismatch and analytics log to deferred validator and analytics test
Motivation
https://jira.corp.stripe.com/browse/RUN_MOBILESDK-3540
Testing
Asserted that the log fired after deferred validation failure matched the paymentSheetIntentPaymentMethodIdMismatch event
Changelog