mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 04:04:55 +08:00
feat(analytics): revamped 3ds auth analytics (#8163)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -4,7 +4,8 @@ use std::{
|
||||
};
|
||||
|
||||
use common_enums::{
|
||||
AuthenticationConnectors, AuthenticationStatus, DecoupledAuthenticationType, TransactionStatus,
|
||||
AuthenticationConnectors, AuthenticationStatus, Currency, DecoupledAuthenticationType,
|
||||
TransactionStatus,
|
||||
};
|
||||
|
||||
use super::{NameDescription, TimeRange};
|
||||
@ -24,7 +25,49 @@ pub struct AuthEventFilters {
|
||||
#[serde(default)]
|
||||
pub message_version: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub platform: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub acs_reference_number: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub mcc: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub currency: Vec<Currency>,
|
||||
#[serde(default)]
|
||||
pub merchant_country: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub billing_country: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub shipping_country: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub issuer_country: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub earliest_supported_version: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub latest_supported_version: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub whitelist_decision: Vec<bool>,
|
||||
#[serde(default)]
|
||||
pub device_manufacturer: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub device_type: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub device_brand: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub device_os: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub device_display: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub browser_name: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub browser_version: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub issuer_id: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub scheme_name: Vec<String>,
|
||||
#[serde(default)]
|
||||
pub exemption_requested: Vec<bool>,
|
||||
#[serde(default)]
|
||||
pub exemption_accepted: Vec<bool>,
|
||||
}
|
||||
|
||||
#[derive(
|
||||
@ -53,6 +96,27 @@ pub enum AuthEventDimensions {
|
||||
AuthenticationConnector,
|
||||
MessageVersion,
|
||||
AcsReferenceNumber,
|
||||
Platform,
|
||||
Mcc,
|
||||
Currency,
|
||||
MerchantCountry,
|
||||
BillingCountry,
|
||||
ShippingCountry,
|
||||
IssuerCountry,
|
||||
EarliestSupportedVersion,
|
||||
LatestSupportedVersion,
|
||||
WhitelistDecision,
|
||||
DeviceManufacturer,
|
||||
DeviceType,
|
||||
DeviceBrand,
|
||||
DeviceOs,
|
||||
DeviceDisplay,
|
||||
BrowserName,
|
||||
BrowserVersion,
|
||||
IssuerId,
|
||||
SchemeName,
|
||||
ExemptionRequested,
|
||||
ExemptionAccepted,
|
||||
}
|
||||
|
||||
#[derive(
|
||||
@ -80,6 +144,8 @@ pub enum AuthEventMetrics {
|
||||
ChallengeSuccessCount,
|
||||
AuthenticationErrorMessage,
|
||||
AuthenticationFunnel,
|
||||
AuthenticationExemptionApprovedCount,
|
||||
AuthenticationExemptionRequestedCount,
|
||||
}
|
||||
|
||||
#[derive(
|
||||
@ -139,6 +205,26 @@ pub struct AuthEventMetricsBucketIdentifier {
|
||||
pub authentication_connector: Option<AuthenticationConnectors>,
|
||||
pub message_version: Option<String>,
|
||||
pub acs_reference_number: Option<String>,
|
||||
pub mcc: Option<String>,
|
||||
pub currency: Option<Currency>,
|
||||
pub merchant_country: Option<String>,
|
||||
pub billing_country: Option<String>,
|
||||
pub shipping_country: Option<String>,
|
||||
pub issuer_country: Option<String>,
|
||||
pub earliest_supported_version: Option<String>,
|
||||
pub latest_supported_version: Option<String>,
|
||||
pub whitelist_decision: Option<bool>,
|
||||
pub device_manufacturer: Option<String>,
|
||||
pub device_type: Option<String>,
|
||||
pub device_brand: Option<String>,
|
||||
pub device_os: Option<String>,
|
||||
pub device_display: Option<String>,
|
||||
pub browser_name: Option<String>,
|
||||
pub browser_version: Option<String>,
|
||||
pub issuer_id: Option<String>,
|
||||
pub scheme_name: Option<String>,
|
||||
pub exemption_requested: Option<bool>,
|
||||
pub exemption_accepted: Option<bool>,
|
||||
#[serde(rename = "time_range")]
|
||||
pub time_bucket: TimeRange,
|
||||
#[serde(rename = "time_bucket")]
|
||||
@ -156,6 +242,26 @@ impl AuthEventMetricsBucketIdentifier {
|
||||
authentication_connector: Option<AuthenticationConnectors>,
|
||||
message_version: Option<String>,
|
||||
acs_reference_number: Option<String>,
|
||||
mcc: Option<String>,
|
||||
currency: Option<Currency>,
|
||||
merchant_country: Option<String>,
|
||||
billing_country: Option<String>,
|
||||
shipping_country: Option<String>,
|
||||
issuer_country: Option<String>,
|
||||
earliest_supported_version: Option<String>,
|
||||
latest_supported_version: Option<String>,
|
||||
whitelist_decision: Option<bool>,
|
||||
device_manufacturer: Option<String>,
|
||||
device_type: Option<String>,
|
||||
device_brand: Option<String>,
|
||||
device_os: Option<String>,
|
||||
device_display: Option<String>,
|
||||
browser_name: Option<String>,
|
||||
browser_version: Option<String>,
|
||||
issuer_id: Option<String>,
|
||||
scheme_name: Option<String>,
|
||||
exemption_requested: Option<bool>,
|
||||
exemption_accepted: Option<bool>,
|
||||
normalized_time_range: TimeRange,
|
||||
) -> Self {
|
||||
Self {
|
||||
@ -166,6 +272,26 @@ impl AuthEventMetricsBucketIdentifier {
|
||||
authentication_connector,
|
||||
message_version,
|
||||
acs_reference_number,
|
||||
mcc,
|
||||
currency,
|
||||
merchant_country,
|
||||
billing_country,
|
||||
shipping_country,
|
||||
issuer_country,
|
||||
earliest_supported_version,
|
||||
latest_supported_version,
|
||||
whitelist_decision,
|
||||
device_manufacturer,
|
||||
device_type,
|
||||
device_brand,
|
||||
device_os,
|
||||
device_display,
|
||||
browser_name,
|
||||
browser_version,
|
||||
issuer_id,
|
||||
scheme_name,
|
||||
exemption_requested,
|
||||
exemption_accepted,
|
||||
time_bucket: normalized_time_range,
|
||||
start_time: normalized_time_range.start_time,
|
||||
}
|
||||
@ -181,6 +307,26 @@ impl Hash for AuthEventMetricsBucketIdentifier {
|
||||
self.message_version.hash(state);
|
||||
self.acs_reference_number.hash(state);
|
||||
self.error_message.hash(state);
|
||||
self.mcc.hash(state);
|
||||
self.currency.hash(state);
|
||||
self.merchant_country.hash(state);
|
||||
self.billing_country.hash(state);
|
||||
self.shipping_country.hash(state);
|
||||
self.issuer_country.hash(state);
|
||||
self.earliest_supported_version.hash(state);
|
||||
self.latest_supported_version.hash(state);
|
||||
self.whitelist_decision.hash(state);
|
||||
self.device_manufacturer.hash(state);
|
||||
self.device_type.hash(state);
|
||||
self.device_brand.hash(state);
|
||||
self.device_os.hash(state);
|
||||
self.device_display.hash(state);
|
||||
self.browser_name.hash(state);
|
||||
self.browser_version.hash(state);
|
||||
self.issuer_id.hash(state);
|
||||
self.scheme_name.hash(state);
|
||||
self.exemption_requested.hash(state);
|
||||
self.exemption_accepted.hash(state);
|
||||
self.time_bucket.hash(state);
|
||||
}
|
||||
}
|
||||
@ -207,6 +353,8 @@ pub struct AuthEventMetricsBucketValue {
|
||||
pub frictionless_success_count: Option<u64>,
|
||||
pub error_message_count: Option<u64>,
|
||||
pub authentication_funnel: Option<u64>,
|
||||
pub authentication_exemption_approved_count: Option<u64>,
|
||||
pub authentication_exemption_requested_count: Option<u64>,
|
||||
}
|
||||
|
||||
#[derive(Debug, serde::Serialize)]
|
||||
|
||||
Reference in New Issue
Block a user