From 47ba5e11e0c842c241422d579875c461970a77a4 Mon Sep 17 00:00:00 2001 From: Pritish Budhiraja <1805317@kiit.ac.in> Date: Tue, 12 Dec 2023 16:50:23 +0530 Subject: [PATCH] feat: Refund enable for Partially Captured Payments --- src/screens/HyperSwitch/Order/HSwitchOrderUtils.res | 2 ++ src/screens/HyperSwitch/Order/OrderEntity.res | 11 ++++++++--- src/screens/HyperSwitch/Order/ShowOrder.res | 3 ++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/screens/HyperSwitch/Order/HSwitchOrderUtils.res b/src/screens/HyperSwitch/Order/HSwitchOrderUtils.res index 7d4194246..7b3c1294e 100644 --- a/src/screens/HyperSwitch/Order/HSwitchOrderUtils.res +++ b/src/screens/HyperSwitch/Order/HSwitchOrderUtils.res @@ -6,6 +6,7 @@ type status = | RequiresCustomerAction | RequiresPaymentMethod | RequiresConfirmation + | PartiallyCaptured | None type paymentAttemptStatus = [ @@ -44,6 +45,7 @@ let statusVariantMapper: string => status = statusLabel => | "REQUIRES_CUSTOMER_ACTION" => RequiresCustomerAction | "REQUIRES_PAYMENT_METHOD" => RequiresPaymentMethod | "REQUIRES_CONFIRMATION" => RequiresConfirmation + | "PARTIALLY_CAPTURED" => PartiallyCaptured | _ => None } diff --git a/src/screens/HyperSwitch/Order/OrderEntity.res b/src/screens/HyperSwitch/Order/OrderEntity.res index 8b8b24e33..348fe61a9 100644 --- a/src/screens/HyperSwitch/Order/OrderEntity.res +++ b/src/screens/HyperSwitch/Order/OrderEntity.res @@ -53,7 +53,9 @@ let getRefundCell = (refunds: refunds, refundsColType: refundsColType): Table.ce Label({ title: refunds.status->Js.String2.toUpperCase, color: switch refunds.status->HSwitchOrderUtils.statusVariantMapper { - | Succeeded => LabelGreen + | Succeeded + | PartiallyCaptured => + LabelGreen | Failed => LabelRed | Processing => LabelOrange | Cancelled => LabelRed @@ -488,7 +490,8 @@ let getStatus = order => { let orderStatusLabel = order.status->Js.String2.toUpperCase let fixedStatusCss = "text-sm text-white font-bold px-3 py-2 rounded-md" switch order.status->HSwitchOrderUtils.statusVariantMapper { - | Succeeded => + | Succeeded + | PartiallyCaptured =>