diff --git a/BraintreeCore/src/main/java/com/braintreepayments/api/core/BraintreeClient.kt b/BraintreeCore/src/main/java/com/braintreepayments/api/core/BraintreeClient.kt index 8ee7321e89..a1f9fe1c55 100644 --- a/BraintreeCore/src/main/java/com/braintreepayments/api/core/BraintreeClient.kt +++ b/BraintreeCore/src/main/java/com/braintreepayments/api/core/BraintreeClient.kt @@ -276,12 +276,14 @@ class BraintreeClient @VisibleForTesting internal constructor( ) { response, httpError -> response?.let { try { - json?.optString(GraphQLConstants.Keys.OPERATION_NAME) + json?.optString(GraphQLConstants.Keys.QUERY) ?.let { query -> + val queryDiscardHolder = query.replace(Regex("^[^\\(]*"), "") + val finalQuery = query.replace(queryDiscardHolder, "") val params = AnalyticsEventParams( startTime = it.timing.startTime, endTime = it.timing.endTime, - endpoint = query + endpoint = finalQuery ) sendAnalyticsEvent( CoreAnalytics.apiRequestLatency, @@ -355,7 +357,11 @@ class BraintreeClient @VisibleForTesting internal constructor( } private fun sendAnalyticsTimingEvent(endpoint: String, timing: HttpResponseTiming) { - val cleanedPath = endpoint.replace(Regex("/merchants/([A-Za-z0-9]+)/client_api"), "") + var cleanedPath = endpoint.replace(Regex("/merchants/([A-Za-z0-9]+)/client_api"), "") + cleanedPath = cleanedPath.replace( + Regex("payment_methods/.*/three_d_secure"), "payment_methods/three_d_secure" + ) + sendAnalyticsEvent( CoreAnalytics.apiRequestLatency, AnalyticsEventParams( diff --git a/BraintreeCore/src/main/java/com/braintreepayments/api/core/GraphQLConstants.kt b/BraintreeCore/src/main/java/com/braintreepayments/api/core/GraphQLConstants.kt index 6a541b7e07..badecf7316 100644 --- a/BraintreeCore/src/main/java/com/braintreepayments/api/core/GraphQLConstants.kt +++ b/BraintreeCore/src/main/java/com/braintreepayments/api/core/GraphQLConstants.kt @@ -20,7 +20,6 @@ object GraphQLConstants { const val LEGACY_CODE = "legacyCode" const val URL = "url" const val FEATURES = "features" - const val OPERATION_NAME = "operationName" } object ErrorTypes { diff --git a/CHANGELOG.md b/CHANGELOG.md index d266d42b32..33eeb3b41d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Braintree Android SDK Release Notes ## unreleased +* BraintreeCore + * Update `endpoint` syntax sent to FPTI for 3D Secure and Venmo flows * Breaking Changes * PayPal * Remove `appLinkEnabled` from `PayPalRequest` as Android app links are now required