Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update 3DS and GraphQL Endpoint Sent to FPTI (v5) #1080

Merged
merged 6 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading