diff --git a/public/hyperswitch/icons/solid.svg b/public/hyperswitch/icons/solid.svg index b2467c422..640d696dc 100644 --- a/public/hyperswitch/icons/solid.svg +++ b/public/hyperswitch/icons/solid.svg @@ -1402,6 +1402,21 @@ License) d="M320 448v40c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24V120c0-13.255 10.745-24 24-24h72v296c0 30.879 25.121 56 56 56h168zm0-344V0H152c-13.255 0-24 10.745-24 24v368c0 13.255 10.745 24 24 24h272c13.255 0 24-10.745 24-24V128H344c-13.2 0-24-10.8-24-24zm120.971-31.029L375.029 7.029A24 24 0 0 0 358.059 0H352v96h96v-6.059a24 24 0 0 0-7.029-16.97z" > + + + + + + + + + + + + + + + "" } + | WEBHOOKS_EVENT_LOGS => + switch id { + | Some(payment_id) => `analytics/v1/outgoing_webhook_event_logs?payment_id=${payment_id}` + | None => "" + } + | CONNECTOR_EVENT_LOGS => + switch id { + | Some(payment_id) => `analytics/v1/connector_event_logs?type=Payment&payment_id=${payment_id}` + | None => "" + } | USERS => let userUrl = `user` switch userType { diff --git a/src/screens/HyperSwitch/APIUtils/APIUtilsTypes.res b/src/screens/HyperSwitch/APIUtils/APIUtilsTypes.res index d0b8eddef..46056dfbf 100644 --- a/src/screens/HyperSwitch/APIUtils/APIUtilsTypes.res +++ b/src/screens/HyperSwitch/APIUtils/APIUtilsTypes.res @@ -17,6 +17,8 @@ type entityName = | ANALYTICS_SYSTEM_METRICS | PAYMENT_LOGS | SDK_EVENT_LOGS + | WEBHOOKS_EVENT_LOGS + | CONNECTOR_EVENT_LOGS | GENERATE_SAMPLE_DATA | USERS | RECON diff --git a/src/screens/HyperSwitch/PaymentLogs/PaymentLogs.res b/src/screens/HyperSwitch/PaymentLogs/PaymentLogs.res index f7644cf63..55a3d89e7 100644 --- a/src/screens/HyperSwitch/PaymentLogs/PaymentLogs.res +++ b/src/screens/HyperSwitch/PaymentLogs/PaymentLogs.res @@ -1,8 +1,20 @@ -open OrderUtils -open APIUtils -open LogicUtils @module("js-sha256") external sha256: string => string = "sha256" + +open PaymentLogsTypes +let getLogType = dict => { + if dict->Dict.get("connector_name")->Option.isSome { + CONNECTOR + } else if dict->Dict.get("request_id")->Option.isSome { + PAYMENTS + } else if dict->Dict.get("component")->Option.isSome { + SDK + } else { + WEBHOOKS + } +} + module PrettyPrintJson = { + open LogicUtils @react.component let make = ( ~jsonToDisplay, @@ -13,7 +25,6 @@ module PrettyPrintJson = { let showToast = ToastState.useShowToast() let (isTextVisible, setIsTextVisible) = React.useState(_ => false) let (parsedJson, setParsedJson) = React.useState(_ => "") - let parseJsonValue = () => { try { let parsedValue = jsonToDisplay->Js.Json.parseExn->Js.Json.stringifyWithSpace(3) @@ -34,11 +45,11 @@ module PrettyPrintJson = { let copyParsedJson =
handleOnClickCopy(~parsedValue=parsedJson)} className="cursor-pointer"> - +
-
- String.length > 0}> +
+ isNonEmptyString}> {<> Option.isSome}>
@@ -50,12 +61,9 @@ module PrettyPrintJson = {
+              className={`${overrideBackgroundColor} p-3 text-jp-gray-900 dark:bg-jp-gray-950 dark:bg-opacity-100 text-fs-13 text font-medium`}>
               {parsedJson->React.string}
             
- {copyParsedJson}