Skip to content

Commit

Permalink
add missing analytics, correct vault without purchase analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
KunJeongPark committed Oct 23, 2024
1 parent fbc483e commit 3956ecd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Sources/CardPayments/CardClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,18 @@ public class CardClient: NSObject {
return cardResult
} else {
analyticsService?.sendEvent("card-payments:3ds:confirm-payment-source:succeeded")
analyticsService?.sendEvent("card-payments:3ds:succeeded")

let cardResult = CardResult(orderID: result.id, status: result.status, didAttemptThreeDSecureAuthentication: false)
return cardResult
}
} catch let error as CoreSDKError {
analyticsService?.sendEvent("card-payments:3ds:confirm-payment-source:failed")
analyticsService?.sendEvent("card-payments:3ds:failed")
throw error
} catch {
analyticsService?.sendEvent("card-payments:3ds:confirm-payment-source:failed")
analyticsService?.sendEvent("card-payments:3ds:failed")
throw CardClientError.unknownError
}
}
Expand Down Expand Up @@ -209,7 +212,7 @@ public class CardClient: NSObject {
continuation.resume(throwing: CardClientError.threeDSecureCancellation)
return
default:
self.analyticsService?.sendEvent("card-payments:3ds:failed")
self.analyticsService?.sendEvent("card-payments:vault-wo-purchase:failed")
continuation.resume(throwing: CardClientError.threeDSecureError(error))
return
}
Expand All @@ -220,7 +223,7 @@ public class CardClient: NSObject {
status: nil,
didAttemptThreeDSecureAuthentication: true
)
self.analyticsService?.sendEvent("card-payments:3ds:succeeded")
self.analyticsService?.sendEvent("card-payments:vault-wo-purchase:succeeded")
continuation.resume(returning: cardVaultResult)
}
)
Expand Down

0 comments on commit 3956ecd

Please sign in to comment.