Skip to content
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

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

joyceqin-stripe
Copy link
Collaborator

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

Copy link
Collaborator

@porter-stripe porter-stripe left a 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"
Copy link
Collaborator

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"))
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants