수정
This commit is contained in:
@@ -14,64 +14,69 @@ export const PaymentInfoSection = ({
|
||||
}: InfoSectionProps) => {
|
||||
|
||||
const subItems: Record<string, Record<string, string>> = {
|
||||
approvalAcquire: {name: '승인매입', type: 'string'},
|
||||
approvalReturn: {name: '승인반송(횟수)', type: 'number'},
|
||||
approvalReAcquire: {name: '승인재매입(횟수)', type: 'number'},
|
||||
approvalPurchase: {name: '승인매입', type: 'string'},
|
||||
approvalRejectCount: {name: '승인반송(횟수)', type: 'number', addString: '건'},
|
||||
approvalRepurchaseCount: {name: '승인재매입(횟수)', type: 'number', addString: '건'},
|
||||
approvalVAN: {name: '승인VAN', type: 'string'},
|
||||
cancelAcquire: {name: '취소매입', type: 'string'},
|
||||
cancelReturn: {name: '취소반송', type: 'string'},
|
||||
cancelReAcquire: {name: '취소재매입', type: 'string'},
|
||||
acquireVAN: {name: '매입VAN', type: 'string'},
|
||||
acquireCompany: {name: '매입사(발급사)', type: 'string'},
|
||||
cardNumber: {name: '카드번호', type: 'string'},
|
||||
approvalNumber: {name: '승인번호', type: 'string'},
|
||||
installmentPeriod: {name: '할부기간', type: 'number'},
|
||||
cancelPurchase: {name: '취소매입', type: 'string'},
|
||||
cancelRejectCount: {name: '취소반송', type: 'number', addString: '건'},
|
||||
cancelRepurchaseCount: {name: '취소재매입', type: 'number', addString: '건'},
|
||||
purchaseVan: {name: '매입VAN', type: 'string'},
|
||||
purchaseCompany: {name: '매입사(발급사)', type: 'string'},
|
||||
cardNo: {name: '카드번호', type: 'string'},
|
||||
approvalNo: {name: '승인번호', type: 'string'},
|
||||
installmentMonth: {name: '할부기간', type: 'string', addString: '개월'},
|
||||
authentication: {name: '인증', type: 'string'},
|
||||
accountType: {name: '유형', type: 'string'},
|
||||
|
||||
joinType: {name: '유형', type: 'string'},
|
||||
bankName: {name: '은행명', type: 'string'},
|
||||
accountNumber: {name: '계좌번호', type: 'string'},
|
||||
accountNo: {name: '계좌번호', type: 'string'},
|
||||
refundCompleteDate: {name: '환불완료일', type: 'string'},
|
||||
customerId: {name: '고객ID', type: 'string'},
|
||||
|
||||
culturelandId: {name: '컬처랜드ID', type: 'string'},
|
||||
|
||||
partner: {name: '제휴사', type: 'string'},
|
||||
cpid: {name: 'CPID', type: 'string'},
|
||||
goodsCategory: {name: '상품구분', type: 'string'},
|
||||
cellphoneNo: {name: '휴대폰번호', type: 'string'},
|
||||
|
||||
giftCardNumber: {name: '상품권번호', type: 'string'},
|
||||
|
||||
depositBankName: {name: '입금금융기관명', type: 'string'},
|
||||
depositorName: {name: '입금자명', type: 'string'},
|
||||
depositDeadline: {name: '입금기한', type: 'date'},
|
||||
depositDate: {name: '입금일', type: 'date'},
|
||||
refundScheduleDate: {name: '환불예정일', type: 'date'},
|
||||
refundBankName: {name: '환불은행명', type: 'string'},
|
||||
refundAccountNumber: {name: '환불계좌번호', type: 'string'},
|
||||
refundAccountNo: {name: '환불계좌번호', type: 'string'},
|
||||
accountHolder: {name: '예금주', type: 'string'},
|
||||
refundCompleteDate: {name: '환불완료일', type: 'date'},
|
||||
partner: {name: '제휴사', type: 'string'},
|
||||
cpid: {name: 'CPID', type: 'string'},
|
||||
productCategory: {name: '상품구분', type: 'string'},
|
||||
phoneNumber: {name: '휴대폰번호', type: 'string'},
|
||||
customerId: {name: '고객ID', type: 'string'},
|
||||
giftCardNumber: {name: '상품권번호', type: 'string'},
|
||||
culturelandId: {name: '컬처랜드ID', type: 'string'},
|
||||
};
|
||||
|
||||
const openSubItems: Record<string, Array<string>> = {
|
||||
// 신용카드
|
||||
'01': ['approvalAcquire', 'approvalReturn', 'approvalReAcquire',
|
||||
'approvalVAN', 'cancelAcquire', 'cancelReturn', 'cancelReAcquire',
|
||||
'acquireVAN', 'acquireCompany', 'cardNumber', 'approvalNumber',
|
||||
'installmentPeriod', 'authentication'],
|
||||
'01': ['approvalPurchase', 'approvalRejectCount', 'approvalRepurchaseCount',
|
||||
'approvalVAN', 'cancelPurchase', 'cancelRejectCount', 'cancelRepurchaseCount',
|
||||
'purchaseVan', 'purchaseCompany', 'cardNo', 'approvalNo',
|
||||
'installmentMonth', 'authentication'],
|
||||
// 계좌이체
|
||||
'02': ['accountType', 'bankName', 'accountNumber'],
|
||||
'02': ['joinType', 'bankName', 'accountNo'],
|
||||
// 가상계좌
|
||||
'03': ['bankName', 'accountNumber', 'depositBankName', 'depositorName',
|
||||
'03': ['bankName', 'accountNo', 'depositBankName', 'depositorName',
|
||||
'depositDeadline', 'depositDate', 'refundScheduleDate',
|
||||
'refundBankName', 'refundAccountNumber', 'accountHolder'],
|
||||
'refundBankName', 'refundAccountNo', 'accountHolder'],
|
||||
// 휴대폰
|
||||
'04': ['refundCompleteDate', 'partner', 'cpid', 'productCategory', 'phoneNumber'],
|
||||
// 계좌간편결제
|
||||
'26': ['bankName', 'refundCompleteDate', 'accountHolder', 'accountType', 'customerId'],
|
||||
'05': ['refundCompleteDate', 'partner', 'cpid', 'goodsCategory', 'cellphoneNo'],
|
||||
// 문화상품권
|
||||
'14': ['culturelandId'],
|
||||
// SSG머니
|
||||
'21': ['giftCardNumber'],
|
||||
// SSG은행계좌
|
||||
'24': [],
|
||||
// 문화상품권
|
||||
'14': ['culturelandId'],
|
||||
// 계좌간편결제
|
||||
'26': ['bankName', 'refundCompleteDate', 'accountHolder', 'joinType', 'customerId'],
|
||||
// 티머니페이
|
||||
'31': ['cardNumber', 'approvalNumber', 'cpid'],
|
||||
'31': ['cardNo', 'approvalNo', 'cpid'],
|
||||
};
|
||||
|
||||
const checkValue = (val: any) => {
|
||||
@@ -93,14 +98,23 @@ export const PaymentInfoSection = ({
|
||||
<span className="k">· { subItems[k]?.name }</span>
|
||||
<span className="v">
|
||||
{ (checkValue(newPaymentInfo[k]) && subItems[k]?.type === 'string') &&
|
||||
newPaymentInfo[k]
|
||||
(k === 'installmentMonth' && newPaymentInfo[k] === '00') &&
|
||||
'일시불'
|
||||
}
|
||||
{ (checkValue(newPaymentInfo[k]) && subItems[k]?.type === 'string') &&
|
||||
(k === 'installmentMonth' && newPaymentInfo[k] !== '00') &&
|
||||
newPaymentInfo[k] + (subItems[k]?.addString || '')
|
||||
}
|
||||
{ (checkValue(newPaymentInfo[k]) && subItems[k]?.type === 'string') &&
|
||||
( k!== 'installmentMonth' ) &&
|
||||
newPaymentInfo[k] + (subItems[k]?.addString || '')
|
||||
}
|
||||
{ (checkValue(newPaymentInfo[k]) && subItems[k]?.type === 'number') &&
|
||||
<NumericFormat
|
||||
value={ newPaymentInfo[k] }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
suffix='원'
|
||||
suffix={ subItems[k]?.addString }
|
||||
></NumericFormat>
|
||||
}
|
||||
{ (checkValue(newPaymentInfo[k]) && subItems[k]?.type === 'date') &&
|
||||
|
||||
Reference in New Issue
Block a user