Skip to content

Commit

Permalink
chore: payment ops changes (#795)
Browse files Browse the repository at this point in the history
  • Loading branch information
gitanjli525 authored Jun 7, 2024
1 parent b762f39 commit f3f3a1c
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 50 deletions.
12 changes: 12 additions & 0 deletions src/screens/Order/OrderEntity.res
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,8 @@ let defaultColumns: array<colType> = [
Status,
PaymentMethod,
PaymentMethodType,
Description,
Metadata,
Created,
]

Expand All @@ -407,10 +409,12 @@ let allColumns = [
PaymentMethodType,
SetupFutureUsage,
Status,
Metadata,
]

let getHeading = (colType: colType) => {
switch colType {
| Metadata => Table.makeHeaderInfo(~key="metadata", ~title="Metadata", ~showSort=false, ())
| PaymentId => Table.makeHeaderInfo(~key="payment_id", ~title="Payment ID", ~showSort=false, ())
| MerchantId =>
Table.makeHeaderInfo(~key="merchant_id", ~title="Merchant ID", ~showSort=false, ())
Expand Down Expand Up @@ -767,6 +771,14 @@ let getCell = (order, colType: colType): Table.cell => {
open HelperComponents
let orderStatus = order.status->HSwitchOrderUtils.statusVariantMapper
switch colType {
| Metadata =>
CustomCell(
<HelperComponents.CopyTextCustomComp
displayValue={order.metadata->JSON.Encode.object->JSON.stringify}
customTextCss="text-nowrap"
/>,
"",
)
| PaymentId => Text(order.payment_id)
| MerchantId => Text(order.merchant_id)
| Connector => CustomCell(<ConnectorCustomCell connectorName={order.connector} />, "")
Expand Down
1 change: 1 addition & 0 deletions src/screens/Order/OrderTypes.res
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ type colType =
| CancellationReason
| ErrorCode
| ErrorMessage
| Metadata

type summaryColType =
| Created
Expand Down
100 changes: 50 additions & 50 deletions src/screens/Order/ShowOrder.res
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,56 @@ let make = (~id) => {
/>
</div>
</UIUtils.RenderIf>
<RenderAccordian
accordion={[
{
title: "More Payment Details",
renderContent: () => {
<div className="mb-10">
<ShowOrderDetails
data=orderData
getHeading=OrderEntity.getHeadingForOtherDetails
getCell=OrderEntity.getCellForOtherDetails
detailsFields=[
FirstName,
LastName,
Phone,
Email,
CustomerId,
Description,
Shipping,
Billing,
BillingEmail,
AmountCapturable,
ErrorCode,
MandateData,
MerchantId,
ReturnUrl,
OffSession,
CaptureOn,
NextAction,
SetupFutureUsage,
CancellationReason,
StatementDescriptorName,
StatementDescriptorSuffix,
PaymentExperience,
FRMName,
FRMTransactionType,
FRMStatus,
]
isNonRefundConnector={isNonRefundConnector(orderData.connector)}
paymentStatus={orderData.status}
openRefundModal={() => ()}
widthClass="md:w-1/4 w-full"
paymentId={orderData.payment_id}
border=""
/>
</div>
},
renderContentOnTop: None,
},
]}
/>
<div className="overflow-scroll">
<RenderAccordian
accordion={[
Expand Down Expand Up @@ -819,56 +869,6 @@ let make = (~id) => {
]}
/>
</UIUtils.RenderIf>
<RenderAccordian
accordion={[
{
title: "More Payment Details",
renderContent: () => {
<div className="mb-10">
<ShowOrderDetails
data=orderData
getHeading=OrderEntity.getHeadingForOtherDetails
getCell=OrderEntity.getCellForOtherDetails
detailsFields=[
FirstName,
LastName,
Phone,
Email,
CustomerId,
Description,
Shipping,
Billing,
BillingEmail,
AmountCapturable,
ErrorCode,
MandateData,
MerchantId,
ReturnUrl,
OffSession,
CaptureOn,
NextAction,
SetupFutureUsage,
CancellationReason,
StatementDescriptorName,
StatementDescriptorSuffix,
PaymentExperience,
FRMName,
FRMTransactionType,
FRMStatus,
]
isNonRefundConnector={isNonRefundConnector(orderData.connector)}
paymentStatus={orderData.status}
openRefundModal={() => ()}
widthClass="md:w-1/4 w-full"
paymentId={orderData.payment_id}
border=""
/>
</div>
},
renderContentOnTop: None,
},
]}
/>
</div>
</PageLoaderWrapper>
</div>
Expand Down

0 comments on commit f3f3a1c

Please sign in to comment.