Skip to content

Commit

Permalink
Merge branch 'main' into replicate-main-analytics-issue
Browse files Browse the repository at this point in the history
  • Loading branch information
scannillo authored Jul 29, 2024
2 parents 0515294 + 5a8e02f commit d296937
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Braintree.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "Braintree"
s.version = "6.23.0"
s.version = "6.23.1"
s.summary = "Braintree iOS SDK: Helps you accept card and alternative payments in your iOS app."
s.description = <<-DESC
Braintree is a full-stack payments platform for developers
Expand Down
4 changes: 2 additions & 2 deletions Demo/Application/Supporting Files/Braintree-Demo-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>6.23.0</string>
<string>6.23.1</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand All @@ -56,7 +56,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>6.23.0</string>
<string>6.23.1</string>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>com.braintreepayments.Demo.payments</string>
Expand Down
7 changes: 6 additions & 1 deletion Sources/BraintreeCore/BTAPIClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,12 @@ import Foundation
// MARK: BTAPITimingDelegate conformance

func fetchAPITiming(path: String, connectionStartTime: Int?, requestStartTime: Int?, startTime: Int, endTime: Int) {
let cleanedPath = path.replacingOccurrences(of: "/merchants/([A-Za-z0-9]+)/client_api", with: "", options: .regularExpression)
var cleanedPath = path.replacingOccurrences(of: "/merchants/([A-Za-z0-9]+)/client_api", with: "", options: .regularExpression)
cleanedPath = cleanedPath.replacingOccurrences(
of: "payment_methods/.*/three_d_secure",
with: "payment_methods/three_d_secure",
options: .regularExpression
)

if cleanedPath != "/v1/tracking/batch/events" {
analyticsService?.sendAnalyticsEvent(FPTIBatchData.Event(
Expand Down
2 changes: 1 addition & 1 deletion Sources/BraintreeCore/BTCoreConstants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Foundation
@objcMembers public class BTCoreConstants: NSObject {

/// :nodoc: This property is exposed for internal Braintree use only. Do not use. It is not covered by Semantic Versioning and may change or be removed at any time.
public static var braintreeSDKVersion: String = "6.23.0"
public static var braintreeSDKVersion: String = "6.23.1"

/// :nodoc: This property is exposed for internal Braintree use only. Do not use. It is not covered by Semantic Versioning and may change or be removed at any time.
public static let callbackURLScheme: String = "sdk.ios.braintree"
Expand Down
10 changes: 7 additions & 3 deletions Sources/BraintreeCore/BTHTTP.swift
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,12 @@ class BTHTTP: NSObject, URLSessionTaskDelegate {
let json = try? JSONSerialization.jsonObject(with: data)
let body = BTJSON(value: json)

guard let mutationName = body["operationName"].asString() else { return nil }

return "mutation \(mutationName)"
guard let query = body["query"].asString() else {
return nil
}

let queryDiscardHolder = query.replacingOccurrences(of: #"^[^\(]*"#, with: "", options: .regularExpression)
let finalQuery = query.replacingOccurrences(of: queryDiscardHolder, with: "")
return finalQuery
}
}
4 changes: 2 additions & 2 deletions Sources/BraintreeCore/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>6.23.0</string>
<string>6.23.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>6.23.0</string>
<string>6.23.1</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
Expand Down
3 changes: 2 additions & 1 deletion UnitTests/BraintreeCoreTests/BTHTTP_Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,8 @@ final class BTHTTP_Tests: XCTestCase {
var originalRequest = URLRequest(url: URL(string: "https://example.com/graphql")!)
originalRequest.httpBody = """
{
"operationName": "TestMutation"
"operationName": "TestMutation",
"query": "mutation TestMutation()"
}
""".data(using: .utf8)
let task = testURLSession.dataTask(with: originalRequest)
Expand Down

0 comments on commit d296937

Please sign in to comment.