Skip to content

Commit 8c99fde

Browse files
committed
clean up analytics names
1 parent c7a789d commit 8c99fde

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Sources/CardPayments/CardClient.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public class CardClient: NSObject {
9999
/// if it fails, `CardResult will be `nil` and `error` will describe the failure
100100
public func approveOrder(request: CardRequest, completion: @escaping (CardResult?, CoreSDKError?) -> Void) {
101101
analyticsService = AnalyticsService(coreConfig: config, orderID: request.orderID)
102-
analyticsService?.sendEvent("card-payments:3ds:started")
102+
analyticsService?.sendEvent("card-payments:approve-order:started")
103103
Task {
104104
do {
105105
let result = try await checkoutOrdersAPI.confirmPaymentSource(cardRequest: request)
@@ -113,19 +113,19 @@ public class CardClient: NSObject {
113113
return
114114
}
115115

116-
analyticsService?.sendEvent("card-payments:3ds:confirm-payment-source:challenge-required")
116+
analyticsService?.sendEvent("card-payments:confirm-payment-source:challenge-required")
117117
startThreeDSecureChallenge(url: url, orderId: result.id, completion: completion)
118118
} else {
119-
analyticsService?.sendEvent("card-payments:3ds:confirm-payment-source:succeeded")
119+
analyticsService?.sendEvent("card-payments:confirm-payment-source:succeeded")
120120

121121
let cardResult = CardResult(orderID: result.id, status: result.status, didAttemptThreeDSecureAuthentication: false)
122122
notifyCheckoutSuccess(for: cardResult, completion: completion)
123123
}
124124
} catch let error as CoreSDKError {
125-
analyticsService?.sendEvent("card-payments:3ds:confirm-payment-source:failed")
125+
analyticsService?.sendEvent("card-payments:confirm-payment-source:failed")
126126
notifyCheckoutFailure(with: error, completion: completion)
127127
} catch {
128-
analyticsService?.sendEvent("card-payments:3ds:confirm-payment-source:failed")
128+
analyticsService?.sendEvent("card-payments:confirm-payment-source:failed")
129129
notifyCheckoutFailure(with: CardError.unknownError, completion: completion)
130130
}
131131
}
@@ -225,17 +225,17 @@ public class CardClient: NSObject {
225225
}
226226

227227
private func notifyCheckoutSuccess(for result: CardResult, completion: (CardResult?, CoreSDKError?) -> Void) {
228-
analyticsService?.sendEvent("card-payments:3ds:succeeded")
228+
analyticsService?.sendEvent("card-payments:approve-order:succeeded")
229229
completion(result, nil)
230230
}
231231

232232
private func notifyCheckoutFailure(with error: CoreSDKError, completion: (CardResult?, CoreSDKError?) -> Void) {
233-
analyticsService?.sendEvent("card-payments:3ds:failed")
233+
analyticsService?.sendEvent("card-payments:approve-order:failed")
234234
completion(nil, error)
235235
}
236236

237237
private func notifyCheckoutCancelWithError(with error: CoreSDKError, completion: (CardResult?, CoreSDKError?) -> Void) {
238-
analyticsService?.sendEvent("card-payments:3ds:challenge:user-canceled")
238+
analyticsService?.sendEvent("card-payments:approve-order:challenge:user-canceled")
239239
completion(nil, error)
240240
}
241241

0 commit comments

Comments
 (0)