-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Align Analytics Event Names with iOS (#310)
* Refactor event names into constant. * Simplify analytics implementation for card. * Implement VaultEvent enum. * Move PayPalWebAnaltyics to analytics package. * Refactor PayPal web analytics to use enums. * Supress detekt warnings.
- Loading branch information
1 parent
99bc477
commit ac52f2d
Showing
12 changed files
with
167 additions
and
203 deletions.
There are no files selected for viewing
101 changes: 0 additions & 101 deletions
101
CardPayments/src/main/java/com/paypal/android/cardpayments/CardAnalytics.kt
This file was deleted.
Oops, something went wrong.
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
20 changes: 20 additions & 0 deletions
20
CardPayments/src/main/java/com/paypal/android/cardpayments/analytics/ApproveOrderEvent.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,20 @@ | ||
@file:Suppress("SpacingAroundParens", "NoMultipleSpaces", "MaxLineLength") | ||
|
||
package com.paypal.android.cardpayments.analytics | ||
|
||
internal enum class ApproveOrderEvent(val value: String) { | ||
// @formatter:off | ||
STARTED( "card-payments:approve-order:started"), | ||
SUCCEEDED("card-payments:approve-order:succeeded"), | ||
FAILED( "card-payments:approve-order:failed"), | ||
|
||
AUTH_CHALLENGE_REQUIRED("card-payments:approve-order:auth-challenge-required"), | ||
|
||
AUTH_CHALLENGE_PRESENTATION_SUCCEEDED("card-payments:approve-order:auth-challenge-presentation:succeeded"), | ||
AUTH_CHALLENGE_PRESENTATION_FAILED( "card-payments:approve-order:auth-challenge-presentation:failed"), | ||
|
||
AUTH_CHALLENGE_SUCCEEDED("card-payments:approve-order:auth-challenge:succeeded"), | ||
AUTH_CHALLENGE_FAILED( "card-payments:approve-order:auth-challenge:failed"), | ||
AUTH_CHALLENGE_CANCELED( "card-payments:approve-order:auth-challenge:canceled"), | ||
// @formatter:on | ||
} |
14 changes: 14 additions & 0 deletions
14
CardPayments/src/main/java/com/paypal/android/cardpayments/analytics/CardAnalytics.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,14 @@ | ||
package com.paypal.android.cardpayments.analytics | ||
|
||
import com.paypal.android.corepayments.analytics.AnalyticsService | ||
|
||
internal class CardAnalytics(private val analyticsService: AnalyticsService) { | ||
|
||
fun notify(event: ApproveOrderEvent, orderId: String?) { | ||
analyticsService.sendAnalyticsEvent(event.value, orderId) | ||
} | ||
|
||
fun notify(event: VaultEvent, setupTokenId: String?) { | ||
analyticsService.sendAnalyticsEvent(event.value, setupTokenId) | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
CardPayments/src/main/java/com/paypal/android/cardpayments/analytics/VaultEvent.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,20 @@ | ||
@file:Suppress("SpacingAroundParens", "NoMultipleSpaces", "MaxLineLength") | ||
|
||
package com.paypal.android.cardpayments.analytics | ||
|
||
internal enum class VaultEvent(val value: String) { | ||
// @formatter:off | ||
STARTED( "card-payments:vault-wo-purchase:started"), | ||
SUCCEEDED("card-payments:vault-wo-purchase:succeeded"), | ||
FAILED( "card-payments:vault-wo-purchase:failed"), | ||
|
||
AUTH_CHALLENGE_REQUIRED("card-payments:vault-wo-purchase:auth-challenge-required"), | ||
|
||
AUTH_CHALLENGE_PRESENTATION_SUCCEEDED("card-payments:vault-wo-purchase:auth-challenge-presentation:succeeded"), | ||
AUTH_CHALLENGE_PRESENTATION_FAILED( "card-payments:vault-wo-purchase:auth-challenge-presentation:failed"), | ||
|
||
AUTH_CHALLENGE_SUCCEEDED("card-payments:vault-wo-purchase:auth-challenge:succeeded"), | ||
AUTH_CHALLENGE_FAILED( "card-payments:vault-wo-purchase:auth-challenge:failed"), | ||
AUTH_CHALLENGE_CANCELED( "card-payments:vault-wo-purchase:auth-challenge:canceled"), | ||
// @formatter:on | ||
} |
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: 0 additions & 57 deletions
57
PayPalWebPayments/src/main/java/com/paypal/android/paypalwebpayments/PayPalWebAnalytics.kt
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.