-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate PayPalWebClient Analytics Logic Into PayPalWebAnalytics Class (…
…#300) * Extract all analytics tracking from PayPalWebClient into PayPalWebAnalytics. * Update broken unit test. * Remove unused imports. * Fix analytics typo.
- Loading branch information
1 parent
6ac1752
commit afda478
Showing
4 changed files
with
101 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
PayPalWebPayments/src/main/java/com/paypal/android/paypalwebpayments/PayPalWebAnalytics.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package com.paypal.android.paypalwebpayments | ||
|
||
import com.paypal.android.corepayments.analytics.AnalyticsService | ||
|
||
@Suppress("TooManyFunctions") | ||
internal class PayPalWebAnalytics(private val analyticsService: AnalyticsService) { | ||
|
||
fun notifyCheckoutStarted(orderId: String) { | ||
val eventName = "paypal-web-payments:checkout:started" | ||
analyticsService.sendAnalyticsEvent(eventName, orderId) | ||
} | ||
|
||
fun notifyCheckoutAuthChallengeStarted(orderId: String) { | ||
val eventName = "paypal-web-payments:checkout:auth-challenge-started" | ||
analyticsService.sendAnalyticsEvent(eventName, orderId) | ||
} | ||
|
||
fun notifyCheckoutAuthChallengeSucceeded(orderId: String?) { | ||
val eventName = "paypal-web-payments:checkout:auth-challenge-succeeded" | ||
analyticsService.sendAnalyticsEvent(eventName, orderId) | ||
} | ||
|
||
fun notifyCheckoutAuthChallengeFailed(orderId: String?) { | ||
val eventName = "paypal-web-payments:checkout:auth-challenge-failed" | ||
analyticsService.sendAnalyticsEvent(eventName, orderId) | ||
} | ||
|
||
fun notifyCheckoutAuthChallengeCanceled(orderId: String?) { | ||
val eventName = "paypal-web-payments:checkout:auth-challenge-canceled" | ||
analyticsService.sendAnalyticsEvent(eventName, orderId) | ||
} | ||
|
||
fun notifyVaultStarted(setupTokenId: String) { | ||
val eventName = "paypal-web-payments:vault:started" | ||
analyticsService.sendAnalyticsEvent(eventName, setupTokenId) | ||
} | ||
|
||
fun notifyVaultAuthChallengeStarted(setupTokenId: String) { | ||
val eventName = "paypal-web-payments:vault:auth-challenge-started" | ||
analyticsService.sendAnalyticsEvent(eventName, setupTokenId) | ||
} | ||
|
||
fun notifyVaultAuthChallengeSucceeded(setupTokenId: String?) { | ||
val eventName = "paypal-web-payments:vault:auth-challenge-succeeded" | ||
analyticsService.sendAnalyticsEvent(eventName, setupTokenId) | ||
} | ||
|
||
fun notifyVaultAuthChallengeFailed(setupTokenId: String?) { | ||
val eventName = "paypal-web-payments:vault:auth-challenge-failed" | ||
analyticsService.sendAnalyticsEvent(eventName, setupTokenId) | ||
} | ||
|
||
fun notifyVaultAuthChallengeCanceled(setupTokenId: String?) { | ||
val eventName = "paypal-web-payments:vault:auth-challenge-canceled" | ||
analyticsService.sendAnalyticsEvent(eventName, setupTokenId) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters