-
+
= {
+let getSuccessRatePerformanceEntity: entity> = {
getChartData: GaugeChartPerformanceUtils.getGaugeData,
requestBodyConfig: {
+ delta: true,
metrics: [#connector_success_rate],
},
configRequiredForChartData: {
@@ -37,8 +38,24 @@ let getSuccessRatePerformanceEntity: entity = {
getChartOption: GaugeChartPerformanceUtils.gaugeOption,
}
-let getFailureRateEntity: entity = {
+let overallPaymentCount: entity> = {
getChartData: GaugeChartPerformanceUtils.getGaugeData,
+ requestBodyConfig: {
+ delta: true,
+ metrics: [#payment_count],
+ filters: [#status],
+ excludeFilterValue: [#payment_method_awaited],
+ },
+ configRequiredForChartData: {
+ groupByKeys: [],
+ name: #payment_count,
+ },
+ title: "Overall Payment Count",
+ getChartOption: GaugeFailureRateUtils.falureGaugeOption,
+}
+
+let getFailureRateEntity: entity = {
+ getChartData: GaugeFailureRateUtils.getFailureRateData,
requestBodyConfig: {
metrics: [#payment_count],
filters: [#status],
@@ -53,11 +70,12 @@ let getFailureRateEntity: entity = {
getChartOption: GaugeFailureRateUtils.falureGaugeOption,
}
-let getStatusPerformanceEntity: entity = {
+let getStatusPerformanceEntity: entity> = {
requestBodyConfig: {
metrics: [#payment_count],
groupBy: [#status],
filters: [#status],
+ excludeFilterValue: [#payment_method_awaited],
},
configRequiredForChartData: {
groupByKeys: [#status],
@@ -73,7 +91,7 @@ let getPerformanceEntity = (
~filters: array,
~groupByKeys: array,
~title: string,
-): entity => {
+): entity> => {
requestBodyConfig: {
metrics: [#payment_count],
groupBy: [#status, ...groupBy],
@@ -90,7 +108,7 @@ let getPerformanceEntity = (
getChartOption: BarChartPerformanceUtils.getBarOption,
}
-let getConnectorFailureEntity: entity> = {
+let getConnectorFailureEntity: entity, option> = {
requestBodyConfig: {
metrics: [#payment_count],
groupBy: [#connector, #status],
@@ -106,7 +124,7 @@ let getConnectorFailureEntity: entity> = {
getChartOption: PieChartPerformanceUtils.getPieChartOptions,
}
-let getPaymentMethodFailureEntity: entity> = {
+let getPaymentMethodFailureEntity: entity, option> = {
requestBodyConfig: {
metrics: [#payment_count],
groupBy: [#payment_method, #status],
@@ -122,7 +140,7 @@ let getPaymentMethodFailureEntity: entity> = {
getChartOption: PieChartPerformanceUtils.getPieChartOptions,
}
-let getConnectorPaymentMethodFailureEntity: entity> = {
+let getConnectorPaymentMethodFailureEntity: entity, option> = {
requestBodyConfig: {
metrics: [#payment_count],
groupBy: [#connector, #payment_method, #status],
@@ -239,9 +257,9 @@ let tableEntity = EntityType.makeEntity(
~getHeading,
)
-let getFailureEntity: entity> = {
+let getFailureEntity: entity, option> = {
getChartOption: _ => Dict.make()->JSON.Encode.object,
- getChartData: (~array as _, ~config as _) => [],
+ getChartData: (~args as _) => [],
requestBodyConfig: {
metrics: [#connector_success_rate],
groupBy: [#connector],
diff --git a/src/screens/Analytics/PerformanceMonitor/PerformanceMonitorTypes.res b/src/screens/Analytics/PerformanceMonitor/PerformanceMonitorTypes.res
index 9151e410c..41e8bfb42 100644
--- a/src/screens/Analytics/PerformanceMonitor/PerformanceMonitorTypes.res
+++ b/src/screens/Analytics/PerformanceMonitor/PerformanceMonitorTypes.res
@@ -1,7 +1,7 @@
type performance = [#ConnectorPerformance | #PaymentMethodPerormance]
type dimension = [#connector | #payment_method | #payment_method_type | #status | #no_value]
-type status = [#charged | #failure]
+type status = [#charged | #failure | #payment_method_awaited]
type metrics = [#payment_count | #connector_success_rate]
type distribution = [#payment_error_message | #TOP_5]
@@ -58,17 +58,23 @@ type distributionType = {
type requestBodyConfig = {
metrics: array,
+ delta?: bool,
groupBy?: array,
filters?: array,
customFilter?: dimension,
applyFilterFor?: array,
+ excludeFilterValue?: array,
distribution?: distributionType,
}
-
-type entity<'t> = {
+type args<'t1> = {
+ array: array,
+ config: chartDataConfig,
+ optionalArgs?: 't1,
+}
+type entity<'t, 't1> = {
requestBodyConfig: requestBodyConfig,
configRequiredForChartData: chartDataConfig,
- getChartData: (~array: array, ~config: chartDataConfig) => 't,
+ getChartData: (~args: args<'t1>) => 't,
title: string,
getChartOption: 't => JSON.t,
}
diff --git a/src/screens/Analytics/PerformanceMonitor/PerformanceUtils.res b/src/screens/Analytics/PerformanceMonitor/PerformanceUtils.res
index d10ff3a94..528aadec1 100644
--- a/src/screens/Analytics/PerformanceMonitor/PerformanceUtils.res
+++ b/src/screens/Analytics/PerformanceMonitor/PerformanceUtils.res
@@ -45,6 +45,7 @@ let getFilterForPerformance = (
~filters: option>,
~custom: option=None,
~customValue: option>=None,
+ ~excludeFilterValue: option>=None,
) => {
let filtersDict = Dict.make()
let customFilter = custom->Option.getOr(#no_value)
@@ -52,11 +53,20 @@ let getFilterForPerformance = (
| Some(val) => {
val->Array.forEach(filter => {
let data = if filter == customFilter {
- customValue->Option.getOr([])->Array.map(v => (v: status :> string)->JSON.Encode.string)
+ customValue->Option.getOr([])->Array.map(v => (v: status :> string))
} else {
- getSpecificDimension(dimensions, filter).values->Array.map(v => v->JSON.Encode.string)
+ getSpecificDimension(dimensions, filter).values
}
- filtersDict->Dict.set((filter: dimension :> string), data->JSON.Encode.array)
+
+ let updatedFilters = switch excludeFilterValue {
+ | Some(excludeValues) =>
+ data->Array.filter(item => {
+ !(excludeValues->Array.map(v => (v: status :> string))->Array.includes(item))
+ })
+ | None => data
+ }->Array.map(str => str->JSON.Encode.string)
+
+ filtersDict->Dict.set((filter: dimension :> string), updatedFilters->JSON.Encode.array)
})
filtersDict->JSON.Encode.object->Some
}
@@ -79,9 +89,10 @@ let requestBody = (
~groupBy: option>=None,
~filters: option>=[]->Some,
~customFilter: option=None,
+ ~excludeFilterValue: option>=None,
~applyFilterFor: option>=None,
~distribution: option=None,
- ~delta=false,
+ ~delta: option=None,
) => {
let metrics = getMetricForPerformance(~metrics)
let filter = getFilterForPerformance(
@@ -89,6 +100,7 @@ let requestBody = (
~filters,
~custom=customFilter,
~customValue=applyFilterFor,
+ ~excludeFilterValue,
)
let groupByNames = switch groupBy {
| Some(vals) => getGroupByForPerformance(~dimensions=vals)->Some
@@ -99,7 +111,7 @@ let requestBody = (
[
AnalyticsUtils.getFilterRequestBody(
~metrics=Some(metrics),
- ~delta,
+ ~delta=delta->Option.getOr(false),
~distributionValues,
~groupByNames,
~filter,
diff --git a/src/screens/Analytics/PerformanceMonitor/PieChartPerformance/PieChartPerformance.res b/src/screens/Analytics/PerformanceMonitor/PieChartPerformance/PieChartPerformance.res
index ec2de89cf..140138494 100644
--- a/src/screens/Analytics/PerformanceMonitor/PieChartPerformance/PieChartPerformance.res
+++ b/src/screens/Analytics/PerformanceMonitor/PieChartPerformance/PieChartPerformance.res
@@ -4,7 +4,7 @@ let make = (
~startTimeVal,
~endTimeVal,
~dimensions,
- ~entity: PerformanceMonitorTypes.entity<'t>,
+ ~entity: PerformanceMonitorTypes.entity<'t, 't1>,
) => {
open APIUtils
open LogicUtils
@@ -17,6 +17,7 @@ let make = (
let metricsUrl = getURL(~entityName=ANALYTICS_PAYMENTS, ~methodType=Post, ~id=Some(domain))
let body = PerformanceUtils.requestBody(
~dimensions,
+ ~excludeFilterValue=entity.requestBodyConfig.excludeFilterValue,
~startTime=startTimeVal,
~endTime=endTimeVal,
~filters=entity.requestBodyConfig.filters,
@@ -32,7 +33,9 @@ let make = (
->getArrayFromDict("queryData", [])
if arr->Array.length > 0 {
- let configData = entity.getChartData(~array=arr, ~config=entity.configRequiredForChartData)
+ let configData = entity.getChartData(
+ ~args={array: arr, config: entity.configRequiredForChartData},
+ )
let options = entity.getChartOption(configData)
setBarOptions(_ => options)
setScreenState(_ => PageLoaderWrapper.Success)
diff --git a/src/screens/Analytics/PerformanceMonitor/PieChartPerformance/PieChartPerformanceUtils.res b/src/screens/Analytics/PerformanceMonitor/PieChartPerformance/PieChartPerformanceUtils.res
index 56492f36b..fb11f2a37 100644
--- a/src/screens/Analytics/PerformanceMonitor/PieChartPerformance/PieChartPerformanceUtils.res
+++ b/src/screens/Analytics/PerformanceMonitor/PieChartPerformance/PieChartPerformanceUtils.res
@@ -72,7 +72,8 @@ let getPieChartOptions = series => {
}->Identity.genericTypeToJson
}
-let getDonutCharData = (~array: array, ~config: chartDataConfig) => {
+let getDonutCharData = (~args) => {
+ let {array, config} = args
let {groupByKeys} = config
let grouped = PerformanceUtils.getGroupByDataForStatusAndPaymentCount(array, groupByKeys)
let keys = grouped->Dict.keysToArray
diff --git a/src/screens/Analytics/PerformanceMonitor/TablePerformance/TablePerformance.res b/src/screens/Analytics/PerformanceMonitor/TablePerformance/TablePerformance.res
index be601a04f..35908d529 100644
--- a/src/screens/Analytics/PerformanceMonitor/TablePerformance/TablePerformance.res
+++ b/src/screens/Analytics/PerformanceMonitor/TablePerformance/TablePerformance.res
@@ -4,7 +4,7 @@ let tableBorderClass = "border-collapse border border-jp-gray-940 border-opacity
let make = (
~startTimeVal,
~endTimeVal,
- ~entity: PerformanceMonitorTypes.entity<'t>,
+ ~entity: PerformanceMonitorTypes.entity<'t, 't1>,
~domain="payments",
~getTableData,
~visibleColumns,
@@ -29,6 +29,7 @@ let make = (
let body = PerformanceUtils.requestBody(
~dimensions=[],
+ ~excludeFilterValue=entity.requestBodyConfig.excludeFilterValue,
~startTime=startTimeVal,
~endTime=endTimeVal,
~filters=entity.requestBodyConfig.filters,
diff --git a/src/screens/Connectors/ConnectorTypes.res b/src/screens/Connectors/ConnectorTypes.res
index 7bab101c4..fa61123c2 100644
--- a/src/screens/Connectors/ConnectorTypes.res
+++ b/src/screens/Connectors/ConnectorTypes.res
@@ -220,13 +220,14 @@ type payment_methods_enabled = array
type frm_payment_method_type = {
payment_method_type: string,
- mutable flow: string,
- mutable action: string,
+ flow: string,
+ action: string,
}
type frm_payment_method = {
payment_method: string,
- payment_method_types: array,
+ payment_method_types?: array,
+ flow: string,
}
type frm_config = {
diff --git a/src/screens/FraudAndRisk/FRMPaymentMethods.res b/src/screens/FraudAndRisk/FRMPaymentMethods.res
index 8050dc9ff..db658e87f 100644
--- a/src/screens/FraudAndRisk/FRMPaymentMethods.res
+++ b/src/screens/FraudAndRisk/FRMPaymentMethods.res
@@ -1,44 +1,3 @@
-module RadioSection = {
- open ConnectorTypes
- open FRMTypes
- open FRMInfo
- @react.component
- let make = (~option, ~frmConfigs, ~paymentMethodTypeInfo, ~sectionType, ~setConfigJson) => {
- let isOptionSelected =
- switch sectionType {
- | FlowType => paymentMethodTypeInfo.flow
- | ActionType => paymentMethodTypeInfo.action
- } === option
-
- let handleOnClick = () => {
- switch sectionType {
- | FlowType =>
- if paymentMethodTypeInfo.flow !== option {
- switch option->getFlowTypeVariantFromString {
- | PreAuth => paymentMethodTypeInfo.action = CancelTxn->getActionTypeNameString
- | PostAuth => paymentMethodTypeInfo.action = ManualReview->getActionTypeNameString
- }
- paymentMethodTypeInfo.flow = option
- }
- | ActionType => paymentMethodTypeInfo.action = option
- }
- setConfigJson(frmConfigs->Identity.anyTypeToReactEvent)
- }
-
-
-
-
handleOnClick()}>
-
-
- {switch sectionType {
- | FlowType => option->getFlowTypeLabel->React.string
- | ActionType => option->getActionTypeLabel->LogicUtils.snakeToTitle->React.string
- }}
-
-
- }
-}
-
module ToggleSwitch = {
open FRMUtils
@react.component
@@ -68,19 +27,9 @@ module ToggleSwitch = {
}
module FormField = {
- open ConnectorTypes
open FRMInfo
- open FRMTypes
@react.component
- let make = (
- ~options,
- ~label,
- ~paymentMethodTypeInfo,
- ~frmConfigs,
- ~sectionType,
- ~setConfigJson,
- ~description,
- ) => {
+ let make = (~fromConfigIndex, ~paymentMethodIndex, ~options, ~label, ~description) => {
@@ -96,25 +45,23 @@ module FormField = {
-
-
- {paymentMethodTypeInfo.action->getActionTypeLabel->Jsx.string}
-
-
-
- {options
- ->Array.mapWithIndex((option, i) => {
- Int.toString}
- option
- paymentMethodTypeInfo
- frmConfigs
- sectionType
- setConfigJson
- />
- })
- ->React.array}
-
+
Array.map((item): SelectBox.dropdownOption => {
+ {
+ label: item->getFlowTypeLabel,
+ value: item,
+ }
+ }),
+ ~buttonText="options",
+ ~baseComponentCustomStyle="flex",
+ ~customStyle="flex gap-2 !overflow-visible",
+ ),
+ )}
+ />
}
@@ -123,9 +70,9 @@ module FormField = {
module CheckBoxRenderer = {
open FRMUtils
open FRMInfo
- open FRMTypes
@react.component
let make = (
+ ~fromConfigIndex,
~frmConfigInfo: ConnectorTypes.frm_config,
~frmConfigs,
~connectorPaymentMethods,
@@ -229,49 +176,32 @@ module CheckBoxRenderer = {
{frmConfigInfo.payment_methods
->Array.mapWithIndex((paymentMethodInfo, index) => {
Int.toString}>
- {paymentMethodInfo.payment_method_types
- ->Array.mapWithIndex((paymentMethodTypeInfo, i) => {
- Int.toString}
- initialExpandedArray=[0]
- accordion={[
- {
- title: paymentMethodTypeInfo.payment_method_type->LogicUtils.snakeToTitle,
- renderContent: () => {
-
-
Int.toString}
+ initialExpandedArray=[0]
+ accordion={[
+ {
+ title: paymentMethodInfo.payment_method->LogicUtils.snakeToTitle,
+ renderContent: () => {
+
+ Int.toString}
+ description="i. \"PreAuth\" - facilitate transaction verification prior to payment authorization.
ii. \"PostAuth\" - facilitate transaction validation post-authorization, before amount capture."
- />
- getActionTypeAllOptions}
- label="Preferred Action"
- paymentMethodTypeInfo
- frmConfigs
- sectionType={ActionType}
- setConfigJson
- description={paymentMethodTypeInfo.flow
- ->getFlowTypeVariantFromString
- ->actionDescriptionForFlow}
- />
-
- },
- renderContentOnTop: None,
+ />
+
},
- ]}
- accordianTopContainerCss="border"
- accordianBottomContainerCss="p-5"
- contentExpandCss="px-10 pb-6 pt-3 !border-t-0"
- titleStyle="font-semibold text-bold text-md"
- />
- })
- ->React.array}
+ renderContentOnTop: None,
+ },
+ ]}
+ accordianTopContainerCss="border"
+ accordianBottomContainerCss="p-5"
+ contentExpandCss="px-10 pb-6 pt-3 !border-t-0"
+ titleStyle="font-semibold text-bold text-md"
+ />
})
->React.array}
@@ -335,6 +265,7 @@ module PaymentMethodsRenderer = {
frmConfigs
connectorPaymentMethods={connectorConfig->Dict.get(configInfo.gateway)}
isUpdateFlow
+ fromConfigIndex={i->Int.toString}
/>
})
->React.array}
@@ -363,7 +294,12 @@ let make = (~setCurrentStep, ~retrivedValues=None, ~setInitialValues, ~isUpdateF
->parseFRMConfig
->Array.filter(config => config.payment_methods->Array.length > 0)
- valuesDict->Dict.set("frm_configs", filteredArray->Identity.genericTypeToJson)
+ valuesDict->Dict.set(
+ "frm_configs",
+ filteredArray->Array.length > 0
+ ? filteredArray->Identity.genericTypeToJson
+ : JSON.Encode.null,
+ )
setInitialValues(_ => valuesDict->JSON.Encode.object)
setCurrentStep(prev => prev->getNextStep)
diff --git a/src/screens/FraudAndRisk/FRMSummary.res b/src/screens/FraudAndRisk/FRMSummary.res
index 6ba554d58..8d4df3cbd 100644
--- a/src/screens/FraudAndRisk/FRMSummary.res
+++ b/src/screens/FraudAndRisk/FRMSummary.res
@@ -1,18 +1,13 @@
module InfoField = {
open LogicUtils
- open FRMInfo
@react.component
- let make = (~label, ~flowTypeValue, ~actionTypeValue) => {
+ let make = (~label, ~flowTypeValue) => {
{label->snakeToTitle->React.string}
{"Flow :"->React.string}
- {flowTypeValue->getFlowTypeLabel->React.string}
-
-
- {"Action :"->React.string}
- {actionTypeValue->getActionTypeLabel->React.string}
+ {flowTypeValue->React.string}
@@ -22,6 +17,7 @@ module InfoField = {
module ConfigInfo = {
open LogicUtils
open ConnectorTypes
+ open FRMInfo
@react.component
let make = (~frmConfigs) => {
frmConfigs
@@ -31,20 +27,28 @@ module ConfigInfo = {
{config.payment_methods
->Array.mapWithIndex((paymentMethod, ind) => {
-
Int.toString}>
- {paymentMethod.payment_method_types
+ if paymentMethod.payment_method_types->Option.getOr([])->Array.length == 0 {
+ Int.toString}
+ label={paymentMethod.payment_method}
+ flowTypeValue={paymentMethod.flow->getFlowTypeLabel}
+ />
+ } else {
+ paymentMethod.payment_method_types
+ ->Option.getOr([])
->Array.mapWithIndex(
(paymentMethodType, index) => {
- Int.toString}
- label={paymentMethodType.payment_method_type}
- flowTypeValue={paymentMethodType.flow}
- actionTypeValue={paymentMethodType.action}
- />
+
+ Int.toString}
+ label={paymentMethod.payment_method}
+ flowTypeValue={paymentMethodType.flow->getFlowTypeLabel}
+ />
+
},
)
- ->React.array}
-
+ ->React.array
+ }
})
->React.array}
diff --git a/src/screens/FraudAndRisk/FRMTypes.res b/src/screens/FraudAndRisk/FRMTypes.res
index 64396ac90..3e8e92b92 100644
--- a/src/screens/FraudAndRisk/FRMTypes.res
+++ b/src/screens/FraudAndRisk/FRMTypes.res
@@ -1,7 +1,5 @@
type filterType = Connector | FRMPlayer | ThreedsAuthenticator
-type frmPaymentMethodsSectionType = FlowType | ActionType
-
type flowType = PreAuth | PostAuth
type frmActionType = CancelTxn | AutoRefund | ManualReview | Process
diff --git a/src/screens/FraudAndRisk/FRMUtils.res b/src/screens/FraudAndRisk/FRMUtils.res
index 6ff4804ba..fc63899bf 100644
--- a/src/screens/FraudAndRisk/FRMUtils.res
+++ b/src/screens/FraudAndRisk/FRMUtils.res
@@ -134,26 +134,16 @@ let createAllOptions = connectorsConfig => {
})
}
-let generateFRMPaymentMethodsConfig = paymentMethodsDict => {
+let generateFRMPaymentMethodsConfig = (paymentMethodsDict): array<
+ ConnectorTypes.frm_payment_method,
+> => {
open ConnectorTypes
paymentMethodsDict
->Dict.keysToArray
->Array.map(paymentMethodName => {
- let paymentMethodTypesArr =
- paymentMethodsDict
- ->Dict.get(paymentMethodName)
- ->Option.getOr([])
- ->Array.map(paymentMethodType => {
- {
- payment_method_type: paymentMethodType,
- flow: "pre",
- action: "cancel_txn",
- }
- })
-
{
payment_method: paymentMethodName,
- payment_method_types: paymentMethodTypesArr,
+ flow: getFlowTypeNameString(PreAuth),
}
})
}
diff --git a/src/screens/MixpanelHook.res b/src/screens/MixpanelHook.res
index 1cda5846f..caf1537ee 100644
--- a/src/screens/MixpanelHook.res
+++ b/src/screens/MixpanelHook.res
@@ -7,7 +7,7 @@ let useSendEvent = () => {
let {email: authInfoEmail, merchantId, name} =
CommonAuthHooks.useCommonAuthInfo()->Option.getOr(CommonAuthHooks.defaultAuthInfo)
- let deviceId = switch LocalStorage.getItem("deviceid")->Nullable.toOption {
+ let deviceId = switch LocalStorage.getItem("deviceId")->Nullable.toOption {
| Some(id) => id
| None => authInfoEmail
}
diff --git a/src/screens/Order/OrderEntity.res b/src/screens/Order/OrderEntity.res
index 2e1419d06..c5c601bab 100644
--- a/src/screens/Order/OrderEntity.res
+++ b/src/screens/Order/OrderEntity.res
@@ -630,7 +630,7 @@ let getHeadingForOtherDetails = otherDetailsColType => {
}
}
-let getCellForSummary = (order, summaryColType, _): Table.cell => {
+let getCellForSummary = (order, summaryColType): Table.cell => {
switch summaryColType {
| Created => Date(order.created)
| NetAmount =>
@@ -658,11 +658,7 @@ let getCellForSummary = (order, summaryColType, _): Table.cell => {
}
}
-let getCellForAboutPayment = (
- order,
- aboutPaymentColType: aboutPaymentColType,
- connectorList: array
,
-): Table.cell => {
+let getCellForAboutPayment = (order, aboutPaymentColType: aboutPaymentColType): Table.cell => {
open HelperComponents
switch aboutPaymentColType {
| Connector => CustomCell(, "")
@@ -670,13 +666,7 @@ let getCellForAboutPayment = (
| PaymentMethodType => Text(order.payment_method_type)
| Refunds => Text(order.refunds->Array.length > 0 ? "Yes" : "No")
| AuthenticationType => Text(order.authentication_type)
- | ConnectorLabel => {
- let connectorLabel =
- connectorList
- ->Array.find(ele => order.merchant_connector_id === ele.merchant_connector_id)
- ->Option.getOr(Dict.make()->ConnectorListMapper.getProcessorPayloadType)
- Text(connectorLabel.connector_label)
- }
+ | ConnectorLabel => Text(order.connector_label)
| CardBrand => Text(order.card_brand)
| ProfileId => Text(order.profile_id)
| ProfileName => Table.CustomCell(, "")
@@ -692,7 +682,7 @@ let getCellForAboutPayment = (
}
}
-let getCellForOtherDetails = (order, aboutPaymentColType, _): Table.cell => {
+let getCellForOtherDetails = (order, aboutPaymentColType): Table.cell => {
let splittedName = order.name->String.split(" ")
switch aboutPaymentColType {
| MerchantId => Text(order.merchant_id)
@@ -963,6 +953,7 @@ let itemToObjMapper = dict => {
attempts: dict->getArrayFromDict("attempts", [])->JSON.Encode.array->getAttempts,
merchant_order_reference_id: dict->getString("merchant_order_reference_id", ""),
attempt_count: dict->getInt("attempt_count", 0),
+ connector_label: dict->getString("connector_label", "NA"),
}
}
diff --git a/src/screens/Order/OrderRefundForm.res b/src/screens/Order/OrderRefundForm.res
index abfe76db0..bc15fd77b 100644
--- a/src/screens/Order/OrderRefundForm.res
+++ b/src/screens/Order/OrderRefundForm.res
@@ -53,7 +53,10 @@ let make = (
Dict.set(dict, "amount", Math.round(amount *. 100.0)->JSON.Encode.float)
let body = dict
Dict.set(body, "payment_id", order.payment_id->JSON.Encode.string)
- Dict.set(body, "refund_type", "instant"->JSON.Encode.string)
+
+ // NOTE: Backend might change later , but for now removed as backend will have default value as scheduled
+ // Dict.set(body, "refund_type", "instant"->JSON.Encode.string)
+
if !showRefundReason {
Dict.set(body, "reason", "RETURN"->JSON.Encode.string)
}
diff --git a/src/screens/Order/OrderTypes.res b/src/screens/Order/OrderTypes.res
index 1c815bd8e..bc52c9ce3 100644
--- a/src/screens/Order/OrderTypes.res
+++ b/src/screens/Order/OrderTypes.res
@@ -111,6 +111,7 @@ type order = {
attempts: array,
merchant_order_reference_id: string,
attempt_count: int,
+ connector_label: string,
}
type refundsColType =
diff --git a/src/screens/Order/Orders.res b/src/screens/Order/Orders.res
index b00095926..483bb9925 100644
--- a/src/screens/Order/Orders.res
+++ b/src/screens/Order/Orders.res
@@ -11,9 +11,6 @@ let make = (~previewOnly=false) => {
let (totalCount, setTotalCount) = React.useState(_ => 0)
let (searchText, setSearchText) = React.useState(_ => "")
let (filters, setFilters) = React.useState(_ => None)
- let (paymentModal, setPaymentModal) = React.useState(_ => false)
- let connectorList = HyperswitchAtom.connectorListAtom->Recoil.useRecoilValueFromAtom
- let isConfigureConnector = connectorList->Array.length > 0
let (widthClass, heightClass) = React.useMemo(() => {
previewOnly ? ("w-full", "max-h-96") : ("w-full", "")
@@ -85,7 +82,10 @@ let make = (~previewOnly=false) => {
let customTitleStyle = previewOnly ? "py-0 !pt-0" : ""
- let customUI =
+ let customUI =
+
let filterUrl = getURL(~entityName=ORDERS, ~methodType=Get, ~id=Some("v2/filter"))
diff --git a/src/screens/Order/ShowOrder.res b/src/screens/Order/ShowOrder.res
index f66e82fd9..49cc5e55d 100644
--- a/src/screens/Order/ShowOrder.res
+++ b/src/screens/Order/ShowOrder.res
@@ -21,7 +21,6 @@ module ShowOrderDetails = {
~paymentStatus,
~openRefundModal,
~paymentId,
- ~connectorList=?,
~border="border border-jp-gray-940 border-opacity-75 dark:border-jp-gray-960",
~sectionTitle=?,
) => {
@@ -73,7 +72,7 @@ module ShowOrderDetails = {
Int.toString}>
Option.getOr([]))}
+ value={getCell(data, colType)}
customMoneyStyle="!font-normal !text-sm"
labelMargin="!py-0 mt-2"
overiddingHeadingStyles="text-black text-sm font-medium"
@@ -94,7 +93,6 @@ module OrderInfo = {
let make = (~order, ~openRefundModal, ~isNonRefundConnector, ~paymentId) => {
let paymentStatus = order.status
let headingStyles = "font-bold text-lg mb-5"
- let connectorList = HyperswitchAtom.connectorListAtom->Recoil.useRecoilValueFromAtom
@@ -138,7 +136,6 @@ module OrderInfo = {
paymentStatus
openRefundModal
paymentId
- connectorList
/>
diff --git a/src/screens/UserManagement/UserManagementTypes.res b/src/screens/UserManagement/UserManagementTypes.res
index 1b3006d94..d580fc73b 100644
--- a/src/screens/UserManagement/UserManagementTypes.res
+++ b/src/screens/UserManagement/UserManagementTypes.res
@@ -36,3 +36,9 @@ type getInfoType = {
description: string,
mutable isPermissionAllowed: bool,
}
+
+type userModuleType = {
+ parentGroup: string,
+ description: string,
+ groups: array
,
+}
diff --git a/src/utils/Mappers/ConnectorListMapper.res b/src/utils/Mappers/ConnectorListMapper.res
index 3189c0d7c..947e623f6 100644
--- a/src/utils/Mappers/ConnectorListMapper.res
+++ b/src/utils/Mappers/ConnectorListMapper.res
@@ -9,7 +9,7 @@ let parsePaymentMethodType = paymentMethodType => {
action: paymentMethodTypeDict->getString("action", ""),
}
}
-let parsePaymentMethod = paymentMethod => {
+let parsePaymentMethodResponse = paymentMethod => {
open LogicUtils
let paymentMethodDict = paymentMethod->getDictFromJsonObject
@@ -18,12 +18,42 @@ let parsePaymentMethod = paymentMethod => {
->getArrayFromDict("payment_method_types", [])
->Array.map(parsePaymentMethodType)
+ let flow = paymentMethodDict->getString("flow", "")
+
{
payment_method: paymentMethodDict->getString("payment_method", ""),
payment_method_types,
+ flow,
}
}
+let parsePaymentMethod = paymentMethod => {
+ open LogicUtils
+
+ let paymentMethodDict = paymentMethod->getDictFromJsonObject
+ let flow = paymentMethodDict->getString("flow", "")
+
+ {
+ payment_method: paymentMethodDict->getString("payment_method", ""),
+ flow,
+ }
+}
+
+let convertFRMConfigJsonToObjResponse = json => {
+ open LogicUtils
+
+ json->Array.map(config => {
+ let configDict = config->getDictFromJsonObject
+ let payment_methods =
+ configDict->getArrayFromDict("payment_methods", [])->Array.map(parsePaymentMethodResponse)
+
+ {
+ gateway: configDict->getString("gateway", ""),
+ payment_methods,
+ }
+ })
+}
+
let convertFRMConfigJsonToObj = json => {
open LogicUtils
@@ -93,7 +123,7 @@ let getProcessorPayloadType = dict => {
->getArrayDataFromJson(getPaymentMethodsEnabled),
profile_id: dict->getString("profile_id", ""),
merchant_connector_id: dict->getString("merchant_connector_id", ""),
- frm_configs: dict->getArrayFromDict("frm_configs", [])->convertFRMConfigJsonToObj,
+ frm_configs: dict->getArrayFromDict("frm_configs", [])->convertFRMConfigJsonToObjResponse,
status: dict->getString("status", "inactive"),
}
}