Skip to content

Commit

Permalink
Add message field for Twint error events
Browse files Browse the repository at this point in the history
COAND-1047
  • Loading branch information
araratthehero committed Dec 12, 2024
1 parent b4473d2 commit b19bed9
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,12 @@ internal class DefaultTwintActionDelegate(
}

TwintPayResult.TW_B_ERROR -> {
trackThirdPartyErrorEvent()
trackThirdPartyErrorEvent("Twint result is error")
onError(ComponentException("Twint encountered an error."))
}

TwintPayResult.TW_B_APP_NOT_INSTALLED -> {
trackThirdPartyErrorEvent()
trackThirdPartyErrorEvent("Twint app not installed")
onError(ComponentException("Twint app not installed."))
}
}
Expand Down Expand Up @@ -223,10 +223,11 @@ internal class DefaultTwintActionDelegate(
)
}

private fun trackThirdPartyErrorEvent() {
private fun trackThirdPartyErrorEvent(message: String) {
val event = GenericEvents.error(
component = action?.paymentMethodType.orEmpty(),
event = ErrorEvent.THIRD_PARTY,
message = message
)
analyticsManager?.trackEvent(event)
}
Expand Down

0 comments on commit b19bed9

Please sign in to comment.