diff --git a/src/screens/HyperSwitch/Analytics/PaymentsAnalytics/PaymentAnalytics.res b/src/screens/HyperSwitch/Analytics/PaymentsAnalytics/PaymentAnalytics.res index b4229a0e0..b6745796c 100644 --- a/src/screens/HyperSwitch/Analytics/PaymentsAnalytics/PaymentAnalytics.res +++ b/src/screens/HyperSwitch/Analytics/PaymentsAnalytics/PaymentAnalytics.res @@ -8,6 +8,11 @@ let make = () => { let (metrics, setMetrics) = React.useState(_ => []) let (dimensions, setDimensions) = React.useState(_ => []) let fetchDetails = useGetMethod() + let {isLiveMode} = + HyperswitchAtom.featureFlagAtom + ->Recoil.useRecoilValueFromAtom + ->LogicUtils.safeParse + ->FeatureFlagUtils.featureFlagType let loadInfo = async () => { open LogicUtils @@ -73,7 +78,7 @@ let make = () => { tabKeys tabValues options - singleStatEntity={getSingleStatEntity(metrics)} + singleStatEntity={getSingleStatEntity(metrics, !isLiveMode)} getTable={getPaymentTable} colMapper tableEntity={paymentTableEntity} diff --git a/src/screens/HyperSwitch/Analytics/PaymentsAnalytics/PaymentAnalyticsEntity.res b/src/screens/HyperSwitch/Analytics/PaymentsAnalytics/PaymentAnalyticsEntity.res index c6988eccd..02f1bad32 100644 --- a/src/screens/HyperSwitch/Analytics/PaymentsAnalytics/PaymentAnalyticsEntity.res +++ b/src/screens/HyperSwitch/Analytics/PaymentsAnalytics/PaymentAnalyticsEntity.res @@ -319,19 +319,29 @@ type colT = | RetriesAmountProcessed | ConnectorSuccessRate -let defaultColumns: array> = [ +let getColumns: bool => array> = connector_success_rate => [ { sectionName: "", - columns: [ - SuccessRate, - Count, - SuccessCount, - ProcessedAmount, - AvgTicketSize, - RetriesCount, - RetriesAmountProcessed, - ConnectorSuccessRate, - ], + columns: connector_success_rate + ? [ + SuccessRate, + Count, + SuccessCount, + ProcessedAmount, + AvgTicketSize, + RetriesCount, + RetriesAmountProcessed, + ConnectorSuccessRate, + ] + : [ + SuccessRate, + Count, + SuccessCount, + ProcessedAmount, + AvgTicketSize, + RetriesCount, + RetriesAmountProcessed, + ], }, ] @@ -413,7 +423,7 @@ let getStatData = ( ) => { switch colType { | SuccessRate => { - title: "Overall conversion rate", + title: "Overall Conversion Rate", tooltipText: "Total successful payments processed out of total payments created (This includes user dropouts at shopping cart and checkout page)", deltaTooltipComponent: AnalyticsUtils.singlestatDeltaTooltipFormat( singleStatData.payment_success_rate, @@ -504,7 +514,7 @@ let getStatData = ( } | RetriesCount => { title: "Smart Retries made", - tooltipText: "Total number of retries that were attempted after a failed payment attempt", + tooltipText: "Total number of retries that were attempted after a failed payment attempt (Note: Only date range filters are supoorted currently)", deltaTooltipComponent: AnalyticsUtils.singlestatDeltaTooltipFormat( singleStatData.retries_count->Belt.Int.toFloat, deltaTimestampData.currentSr, @@ -518,8 +528,8 @@ let getStatData = ( showDelta: false, } | RetriesAmountProcessed => { - title: `Smart retries savings`, - tooltipText: "Total savings in amount terms from retrying failed payments again through a second processor", + title: `Smart Retries Savings`, + tooltipText: "Total savings in amount terms from retrying failed payments again through a second processor (Note: Only date range filters are supoorted currently)", deltaTooltipComponent: AnalyticsUtils.singlestatDeltaTooltipFormat( singleStatData.retries_amount_processe /. 100.00, deltaTimestampData.currentSr, @@ -538,7 +548,7 @@ let getStatData = ( showDelta: false, } | ConnectorSuccessRate => { - title: "Payment success rate", + title: "Payment Success Rate", tooltipText: "Total successful payments processed out of all user confirmed payments", deltaTooltipComponent: AnalyticsUtils.singlestatDeltaTooltipFormat( singleStatData.connector_success_rate, @@ -555,7 +565,7 @@ let getStatData = ( } } -let getSingleStatEntity: 'a => DynamicSingleStat.entityType<'colType, 't, 't2> = metrics => { +let getSingleStatEntity = (metrics, connector_success_rate) => { urlConfig: [ { uri: `${HSwitchGlobalVars.hyperSwitchApiPrefix}/analytics/v1/metrics/${domain}`, @@ -564,7 +574,7 @@ let getSingleStatEntity: 'a => DynamicSingleStat.entityType<'colType, 't, 't2> = ], getObjects: itemToObjMapper, getTimeSeriesObject: timeSeriesObjMapper, - defaultColumns, + defaultColumns: getColumns(connector_success_rate), getData: getStatData, totalVolumeCol: None, matrixUriMapper: _ => `${HSwitchGlobalVars.hyperSwitchApiPrefix}/analytics/v1/metrics/${domain}`,