@@ -53,7 +53,7 @@ public class CardClient: NSObject {
53
53
if result. status == " PAYER_ACTION_REQUIRED " ,
54
54
let urlString = result. links. first ( where: { $0. rel == " approve " } ) ? . href {
55
55
guard urlString. contains ( " helios " ) , let url = URL ( string: urlString) else {
56
- self . notifyVaultFailure ( with: CardError . threeDSecureURLError, completion: completion)
56
+ self . notify3dsVaultFailure ( with: CardError . threeDSecureURLError, completion: completion)
57
57
return
58
58
}
59
59
analyticsService? . sendEvent ( " card-payments:vault-wo-purchase:challenge-required " )
@@ -157,9 +157,9 @@ public class CardClient: NSObject {
157
157
context: self ,
158
158
sessionDidDisplay: { [ weak self] didDisplay in
159
159
if didDisplay {
160
- self ? . analyticsService? . sendEvent ( " card-payments:approve-order:challenge-presentation:succeeded " )
160
+ self ? . analyticsService? . sendEvent ( " card-payments:approve-order:auth- challenge-presentation:succeeded " )
161
161
} else {
162
- self ? . analyticsService? . sendEvent ( " card-payments:approve-order:challenge-presentation:failed " )
162
+ self ? . analyticsService? . sendEvent ( " card-payments:approve-order:auth- challenge-presentation:failed " )
163
163
}
164
164
} ,
165
165
sessionDidComplete: { _, error in
@@ -197,25 +197,25 @@ public class CardClient: NSObject {
197
197
sessionDidDisplay: { [ weak self] didDisplay in
198
198
if didDisplay {
199
199
// TODO: analytics for card vault
200
- self ? . analyticsService? . sendEvent ( " card-payments:3ds: challenge-presentation:succeeded " )
200
+ self ? . analyticsService? . sendEvent ( " card-payments:vault-wo-purchase:auth- challenge-presentation:succeeded " )
201
201
} else {
202
- self ? . analyticsService? . sendEvent ( " card-payments:3ds: challenge-presentation:failed " )
202
+ self ? . analyticsService? . sendEvent ( " card-payments:vault-wo-purchase:auth- challenge-presentation:failed " )
203
203
}
204
204
} ,
205
205
sessionDidComplete: { _, error in
206
206
if let error = error {
207
207
switch error {
208
208
case ASWebAuthenticationSessionError . canceledLogin:
209
- self . notifyVaultCancelWithError ( with: CardError . threeDSecureCanceledError, completion: completion)
209
+ self . notify3dsVaultCancelWithError ( with: CardError . threeDSecureCanceledError, completion: completion)
210
210
return
211
211
default :
212
- self . notifyVaultFailure ( with: CardError . threeDSecureError ( error) , completion: completion)
212
+ self . notify3dsVaultFailure ( with: CardError . threeDSecureError ( error) , completion: completion)
213
213
return
214
214
}
215
215
}
216
216
217
217
let cardVaultResult = CardVaultResult ( setupTokenID: setupTokenID, status: nil , didAttemptThreeDSecureAuthentication: true )
218
- self . notifyVaultSuccess ( for: cardVaultResult, completion: completion)
218
+ self . notify3dsVaultSuccess ( for: cardVaultResult, completion: completion)
219
219
}
220
220
)
221
221
}
@@ -250,13 +250,23 @@ public class CardClient: NSObject {
250
250
completion ( vaultResult, nil )
251
251
}
252
252
253
+ private func notify3dsVaultSuccess( for vaultResult: CardVaultResult , completion: ( CardVaultResult ? , CoreSDKError ? ) -> Void ) {
254
+ analyticsService? . sendEvent ( " card-payments:vault-wo-purchase:auth-challenge-succeeded " )
255
+ completion ( vaultResult, nil )
256
+ }
257
+
253
258
private func notifyVaultFailure( with vaultError: CoreSDKError , completion: ( CardVaultResult ? , CoreSDKError ? ) -> Void ) {
254
259
analyticsService? . sendEvent ( " card-payments:vault-wo-purchase:failed " )
255
260
completion ( nil , vaultError)
256
261
}
257
262
258
- private func notifyVaultCancelWithError( with vaultError: CoreSDKError , completion: ( CardVaultResult ? , CoreSDKError ? ) -> Void ) {
259
- analyticsService? . sendEvent ( " card-payments:vault-wo-purchase:challenge:canceled " )
263
+ private func notify3dsVaultFailure( with vaultError: CoreSDKError , completion: ( CardVaultResult ? , CoreSDKError ? ) -> Void ) {
264
+ analyticsService? . sendEvent ( " card-payments:vault-wo-purchase:auth-challenge-failed " )
265
+ completion ( nil , vaultError)
266
+ }
267
+
268
+ private func notify3dsVaultCancelWithError( with vaultError: CoreSDKError , completion: ( CardVaultResult ? , CoreSDKError ? ) -> Void ) {
269
+ analyticsService? . sendEvent ( " card-payments:vault-wo-purchase:auth-challenge-canceled " )
260
270
completion ( nil , vaultError)
261
271
}
262
272
}
0 commit comments