Skip to content

Commit

Permalink
Fix EPMs return unknown instead of epm on payment events (#9908)
Browse files Browse the repository at this point in the history
  • Loading branch information
samer-stripe authored Jan 15, 2025
1 parent 4c5eaf1 commit 544ef90
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -472,12 +472,13 @@ internal sealed class PaymentSheetEvent : AnalyticsEvent {
private fun analyticsValue(
paymentSelection: PaymentSelection?
) = when (paymentSelection) {
PaymentSelection.GooglePay -> "googlepay"
is PaymentSelection.GooglePay -> "googlepay"
is PaymentSelection.Saved -> "savedpm"
PaymentSelection.Link,
is PaymentSelection.Link,
is PaymentSelection.New.LinkInline -> "link"
is PaymentSelection.New -> "newpm"
else -> "unknown"
is PaymentSelection.ExternalPaymentMethod -> "epm"
null -> "unknown"
}

private fun formatEventName(mode: EventReporter.Mode, eventName: String): String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ class PaymentSheetEventTest {
assertThat(
newPMEvent.eventName
).isEqualTo(
"mc_complete_payment_unknown_success"
"mc_complete_payment_epm_success"
)
assertThat(
newPMEvent.params
Expand Down Expand Up @@ -748,7 +748,7 @@ class PaymentSheetEventTest {
assertThat(
newPMEvent.eventName
).isEqualTo(
"mc_complete_payment_unknown_failure"
"mc_complete_payment_epm_failure"
)
assertThat(
newPMEvent.params
Expand Down

0 comments on commit 544ef90

Please sign in to comment.