@page "{id:int}" @model Admin.Pages.Payments.Danal.Cancel.ViewModel @using Domain.Entities.Payments.ValueObject @using SharedKernel.Extensions @{ ViewData["Title"] = "다날 취소 상세"; string MethodName(PaymentMethod m) => m switch { PaymentMethod.Card => "신용카드", PaymentMethod.VirtualAccount => "가상계좌", PaymentMethod.Mobile => "휴대폰", PaymentMethod.Transfer => "계좌이체", PaymentMethod.NaverPay => "네이버페이", PaymentMethod.KakaoPay => "카카오페이", PaymentMethod.Payco => "페이코", PaymentMethod.Integrated => "통합", _ => "-" }; }

@ViewData["Title"]


@if (Model.Data is null) {
취소 내역을 불러올 수 없습니다.
} else { var cancel = Model.Data; var isSuccess = cancel.ResponseCode == "0000";
다날 취소 정보
@cancel.ID
[@cancel.MemberID] @(cancel.MemberName ?? "-") / @cancel.MemberEmail
@MethodName(cancel.Method)
@if (cancel.CancelType == Domain.Entities.Payments.Danal.ValueObject.DanalCancelType.Full) { 전액 환불 } else { 부분 환불 }
@cancel.TransactionID
@cancel.OrderID
@cancel.Amount.ToString("N0") 원
@cancel.MerchantID
@(cancel.CancelRequester ?? "-")
@(cancel.CancelReason ?? "-")

다날 취소 응답
@if (string.IsNullOrEmpty(cancel.ResponseCode)) {
취소 응답이 기록되지 않았습니다.
} else {
@if (isSuccess) { 성공 } else { 실패 } [@cancel.ResponseCode] @cancel.ResponseMessage
@(cancel.OriginalTransactionID ?? "-")
@(cancel.CancelledAmount.HasValue ? cancel.CancelledAmount.Value.ToString("N0") + " 원" : "-")
@(string.IsNullOrEmpty(cancel.TransDate) && string.IsNullOrEmpty(cancel.TransTime) ? "-" : $"{cancel.TransDate} {cancel.TransTime}")
@(cancel.Balance.HasValue ? cancel.Balance.Value.ToString("N0") + " 원" : "-")
@(cancel.RemainedAmount.HasValue ? cancel.RemainedAmount.Value.ToString("N0") + " 원" : "-")
@(cancel.ApprovalDateTime ?? "-")
} @if (cancel.UpdatedAt is not null) {
@cancel.UpdatedAt.GetDateAt()
}
@cancel.CreatedAt.GetDateAt()




}