-
Notifications
You must be signed in to change notification settings - Fork 981
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
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.
StripePaymentSheet- public init(mode: StripePaymentSheet.PaymentSheet.IntentConfiguration.Mode, paymentMethodTypes: [Swift.String]? = nil, onBehalfOf: Swift.String? = nil, paymentMethodConfigurationId: Swift.String? = nil, confirmHandler: @escaping StripePaymentSheet.PaymentSheet.IntentConfiguration.ConfirmHandler, requireCVCRecollection: Swift.Bool = false)
+ public init(mode: StripePaymentSheet.PaymentSheet.IntentConfiguration.Mode, paymentMethodTypes: [Swift.String]? = nil, onBehalfOf: Swift.String? = nil, paymentMethodConfigurationId: Swift.String? = nil, confirmHandler: @escaping StripePaymentSheet.PaymentSheet.IntentConfiguration.ConfirmHandler)
- public var requireCVCRecollection: Swift.Bool If you are adding a new public API consider the following:
If you are modifying or removing a public API:
If you confirm these APIs need to be added/updated and have undergone necessary review, add the label ℹ️ If this comment appears to be left in error, make sure your branch is up-to-date with |
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