test
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
VITE_APP_ENV=development
|
||||
VITE_APP_AUTH_PROXY_HOST='http://3.35.79.250:8090'
|
||||
VITE_APP_API_PROXY_HOST='http://3.35.79.250:8080'
|
||||
VITE_APP_ENV=production
|
||||
VITE_APP_AUTH_PROXY_HOST='http://auth.nicepay.co.kr'
|
||||
VITE_APP_API_PROXY_HOST='http://partner.nicepay.co.kr'
|
||||
GENERATE_SOURCEMAP=false
|
||||
SENTRY_AUTH_TOKEN=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
|
||||
17
server.js
17
server.js
@@ -1,9 +1,24 @@
|
||||
require('dotenv').config({ path: '.env.local.server' });
|
||||
require('dotenv').config({ path: '.env.production' });
|
||||
const express = require('express');
|
||||
const { createProxyMiddleware } = require('http-proxy-middleware');
|
||||
const path = require('path');
|
||||
|
||||
const app = express();
|
||||
console.log('start server')
|
||||
app.use(
|
||||
'/auth',
|
||||
createProxyMiddleware({
|
||||
target: process.env.VITE_APP_AUTH_PROXY_HOST,
|
||||
changeOrigin: true,
|
||||
}),
|
||||
);
|
||||
app.use(
|
||||
'/api',
|
||||
createProxyMiddleware({
|
||||
target: process.env.VITE_APP_API_PROXY_HOST,
|
||||
changeOrigin: true,
|
||||
}),
|
||||
);
|
||||
|
||||
app.use(express.static(path.join(__dirname, 'dist')));
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
|
||||
export const paymentNotificationData = (params: PaymentNotificationDataParams) => {
|
||||
return resultify(
|
||||
axios.post<PaymentNotificationDataResponse>(API_URL_PAYMENT.paymentnotificationData(), params),
|
||||
axios.post<PaymentNotificationDataResponse>(API_URL_PAYMENT.paymentNotificationData(), params),
|
||||
);
|
||||
};
|
||||
|
||||
@@ -2,10 +2,15 @@ export enum PaymentTabKeys {
|
||||
Info = 'Info',
|
||||
DataNotification = 'DataNotification',
|
||||
};
|
||||
export enum PaymentInfoItemType {
|
||||
Comission = 'Comission',
|
||||
NoInterest = 'NoInterest'
|
||||
};
|
||||
export interface PaymentTabProps {
|
||||
activeTab: PaymentTabKeys;
|
||||
};
|
||||
export interface InfoItemProps {
|
||||
type?: PaymentInfoItemType;
|
||||
payName?: string;
|
||||
payImage?: string;
|
||||
infoLink?: string;
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
export const DataNotificationWrap = () => {
|
||||
import { PaymentNotificationDataResponse } from '../model/types';
|
||||
|
||||
export interface DataNotificationWrapProps {
|
||||
paymentNotificationData?: PaymentNotificationDataResponse;
|
||||
};
|
||||
export const DataNotificationWrap = ({
|
||||
paymentNotificationData
|
||||
}: DataNotificationWrapProps) => {
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -1,8 +1,18 @@
|
||||
import { IMAGE_ROOT } from "@/shared/constants/common";
|
||||
import { InfoItem } from "./info-item";
|
||||
import { InfoItemProps } from "../model/types";
|
||||
import { InfoItemProps, PaymentCardResponse, PaymentInfoItemType, PaymentInstallmentResponse, PaymentNonCardResponse } from "../model/types";
|
||||
|
||||
export interface InfoWrapProp {
|
||||
paymentCard?: PaymentCardResponse,
|
||||
paymentNonCard?: PaymentNonCardResponse,
|
||||
paymentInstallment?: PaymentInstallmentResponse
|
||||
};
|
||||
export const InfoWrap = ({
|
||||
paymentCard,
|
||||
paymentNonCard,
|
||||
paymentInstallment
|
||||
}: InfoWrapProp) => {
|
||||
|
||||
export const InfoWrap = () => {
|
||||
|
||||
const list1 = [
|
||||
{payName: '신용카드', payImage: 'pay_01.svg', infoLink: ''},
|
||||
@@ -38,24 +48,33 @@ export const InfoWrap = () => {
|
||||
{payName: '삼성페이(카드)', payImage: 'pay_04.svg', infoLink: ''},
|
||||
];
|
||||
|
||||
const getList = (type: 'comission' | 'NoInterest') => {
|
||||
const getList = (type: PaymentInfoItemType) => {
|
||||
let rs = [];
|
||||
let arr: Array<InfoItemProps> = [];
|
||||
if(type === 'comission'){
|
||||
arr = list1;
|
||||
if(type === PaymentInfoItemType.Comission){
|
||||
for(let i=0;i<list1.length;i++){
|
||||
rs.push(
|
||||
<InfoItem
|
||||
type={ type }
|
||||
payName={ list1[i]?.payName }
|
||||
payImage={ IMAGE_ROOT + '/' + list1[i]?.payImage }
|
||||
infoLink={ list1[i]?.infoLink }
|
||||
></InfoItem>
|
||||
);
|
||||
}
|
||||
}
|
||||
else if(type === 'NoInterest'){
|
||||
arr = list2;
|
||||
}
|
||||
for(let i=0;i<arr.length;i++){
|
||||
rs.push(
|
||||
<InfoItem
|
||||
payName={ arr[i]?.payName }
|
||||
payImage={ IMAGE_ROOT + '/' + arr[i]?.payImage }
|
||||
infoLink={ arr[i]?.infoLink }
|
||||
></InfoItem>
|
||||
);
|
||||
else if(type === PaymentInfoItemType.NoInterest){
|
||||
for(let i=0;i<list2.length;i++){
|
||||
rs.push(
|
||||
<InfoItem
|
||||
type={ type }
|
||||
payName={ list2[i]?.payName }
|
||||
payImage={ IMAGE_ROOT + '/' + list2[i]?.payImage }
|
||||
infoLink={ list2[i]?.infoLink }
|
||||
></InfoItem>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return rs;
|
||||
}
|
||||
|
||||
@@ -65,12 +84,12 @@ export const InfoWrap = () => {
|
||||
<div className="ing-list">
|
||||
<div className="ing-title">서비스 이용, 수수료 및 정산주기</div>
|
||||
<ul className="ing-card-list">
|
||||
{ getList('comission') }
|
||||
{ getList(PaymentInfoItemType.Comission) }
|
||||
</ul>
|
||||
|
||||
<div className="ing-title">가맹점 분담 무이자 정보</div>
|
||||
<ul className="ing-card-list">
|
||||
{ getList('NoInterest') }
|
||||
{ getList(PaymentInfoItemType.NoInterest) }
|
||||
</ul>
|
||||
</div>
|
||||
</>
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { useState } from 'react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { PATHS } from '@/shared/constants/paths';
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { PaymentTab } from '@/entities/payment/ui/payment-tab';
|
||||
import { DataNotificationWrap } from '@/entities/payment/ui/data-notification-wrap';
|
||||
import { PaymentTabKeys } from '@/entities/payment/model/types';
|
||||
import { PaymentNonCardResponse, PaymentNotificationDataResponse, PaymentTabKeys } from '@/entities/payment/model/types';
|
||||
import { usePaymentNotificationDataMutation } from '@/entities/payment/api/use-payment-notification-data-mutation';
|
||||
import { HeaderType } from '@/entities/common/model/types';
|
||||
import {
|
||||
useSetHeaderTitle,
|
||||
@@ -15,7 +16,12 @@ import {
|
||||
export const DataNotificationPage = () => {
|
||||
const { navigate } = useNavigate();
|
||||
|
||||
const { mutateAsync: paymentNotificationData } = usePaymentNotificationDataMutation();
|
||||
|
||||
const [activeTab, setActiveTab] = useState<PaymentTabKeys>(PaymentTabKeys.DataNotification);
|
||||
const [mid, setMid] = useState<string>('nictest00g');
|
||||
const [gid, setGid] = useState<string>('nictest00g');
|
||||
const [paymentNotificationDataResult, setPaymentNotificationDataResult] = useState<PaymentNotificationDataResponse>();
|
||||
|
||||
useSetHeaderTitle('결제 관리');
|
||||
useSetHeaderType(HeaderType.LeftArrow);
|
||||
@@ -24,13 +30,31 @@ export const DataNotificationPage = () => {
|
||||
navigate(PATHS.home);
|
||||
});
|
||||
|
||||
const callPaymentNotificationData = () => {
|
||||
let params = {
|
||||
mid: mid,
|
||||
gid: gid
|
||||
};
|
||||
|
||||
paymentNotificationData(params).then((rs) => {
|
||||
console.log(rs);
|
||||
setPaymentNotificationDataResult(rs);
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
callPaymentNotificationData();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
<main>
|
||||
<div className="tab-content">
|
||||
<div className="tab-pane pt-46 active">
|
||||
<PaymentTab activeTab={ activeTab }></PaymentTab>
|
||||
<DataNotificationWrap></DataNotificationWrap>
|
||||
<DataNotificationWrap
|
||||
paymentNotificationData={ paymentNotificationDataResult }
|
||||
></DataNotificationWrap>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import { useState } from 'react';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { PATHS } from '@/shared/constants/paths';
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { PaymentTab } from '@/entities/payment/ui/payment-tab';
|
||||
import { InfoWrap } from '@/entities/payment/ui/info-wrap';
|
||||
import { PaymentTabKeys } from '@/entities/payment/model/types';
|
||||
import { PaymentCardResponse, PaymentNonCardResponse, PaymentTabKeys } from '@/entities/payment/model/types';
|
||||
import { usePaymentCardMutation } from '@/entities/payment/api/use-payment-card-mutation';
|
||||
import { usePaymentNonCardMutation } from '@/entities/payment/api/use-payment-non-card-mutation';
|
||||
import { HeaderType } from '@/entities/common/model/types';
|
||||
import {
|
||||
useSetHeaderTitle,
|
||||
@@ -15,7 +17,14 @@ import {
|
||||
export const InfoPage = () => {
|
||||
const { navigate } = useNavigate();
|
||||
|
||||
const { mutateAsync: paymentCard } = usePaymentCardMutation();
|
||||
const { mutateAsync: paymentNonCard } = usePaymentNonCardMutation();
|
||||
|
||||
const [activeTab, setActiveTab] = useState<PaymentTabKeys>(PaymentTabKeys.Info);
|
||||
const [mid, setMid] = useState<string>('nictest00g');
|
||||
|
||||
const [paymentCardResult, setPaymentCardResult] = useState<PaymentCardResponse>();
|
||||
const [paymentNonCardResult, setPaymentNonCardResult] = useState<PaymentNonCardResponse>();
|
||||
|
||||
useSetHeaderTitle('결제 관리');
|
||||
useSetHeaderType(HeaderType.LeftArrow);
|
||||
@@ -24,13 +33,44 @@ export const InfoPage = () => {
|
||||
navigate(PATHS.home);
|
||||
});
|
||||
|
||||
const callPaymentCard = () => {
|
||||
let params = {
|
||||
mid: mid,
|
||||
paymentMethod: 'CREDIT_CARD'
|
||||
};
|
||||
|
||||
paymentCard(params).then((rs) => {
|
||||
console.log(rs);
|
||||
setPaymentCardResult(rs);
|
||||
});
|
||||
};
|
||||
const callPaymentNonCard = () => {
|
||||
let params = {
|
||||
mid: mid,
|
||||
paymentMethod: 'ACCOUNT_TRANSFER'
|
||||
};
|
||||
|
||||
paymentNonCard(params).then((rs) => {
|
||||
console.log(rs);
|
||||
setPaymentNonCardResult(rs);
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
callPaymentCard();
|
||||
callPaymentNonCard();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
<main>
|
||||
<div className="tab-content">
|
||||
<div className="tab-pane pt-46 active">
|
||||
<PaymentTab activeTab={ activeTab }></PaymentTab>
|
||||
<InfoWrap></InfoWrap>
|
||||
<InfoWrap
|
||||
paymentCard={ paymentCardResult }
|
||||
paymentNonCard={ paymentNonCardResult }
|
||||
></InfoWrap>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useLocation } from 'react-router';
|
||||
import { PATHS } from '@/shared/constants/paths';
|
||||
import { useNoticeDetailMutation } from '@/entities/support/api/use-notice-detail-mutaion';
|
||||
import { useNoticeDetailMutation } from '@/entities/support/api/use-notice-detail-mutation';
|
||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||
import { HeaderType } from '@/entities/common/model/types';
|
||||
import { NoticeItem } from '@/entities/support/model/types';
|
||||
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
useSetFooterMode
|
||||
} from '@/widgets/sub-layout/use-sub-layout';
|
||||
import { CashReceitPurposeUpdateBottomSheet } from '@/entities/transaction/ui/cash-receit-purpose-update-bottom-sheet';
|
||||
import { useCashReceiptPurposeUpdateMutation } from '@/entities/transaction/api/use-cash-receipt-purpose-update';
|
||||
import { useCashReceiptPurposeUpdateMutation } from '@/entities/transaction/api/use-cash-receipt-purpose-update-mutation';
|
||||
|
||||
export const CashReceiptDetailPage = () => {
|
||||
const { navigate } = useNavigate();
|
||||
|
||||
@@ -6,7 +6,7 @@ import { CashReceiptHandWrittenIssuanceStep2 } from '@/entities/transaction/ui/c
|
||||
import { CashReceiptPurposeType, ProcessStep } from '@/entities/transaction/model/types';
|
||||
import { HeaderType} from '@/entities/common/model/types';
|
||||
import { useSetFooterMode, useSetHeaderTitle, useSetHeaderType } from '@/widgets/sub-layout/use-sub-layout';
|
||||
import { useCashReceiptManualIssueMutation } from '@/entities/transaction/api/use-cash-receipt-manual-issue';
|
||||
import { useCashReceiptManualIssueMutation } from '@/entities/transaction/api/use-cash-receipt-manual-issue-mutation';
|
||||
|
||||
export const CashReceitHandWrittenIssuancePage = () => {
|
||||
const { navigate } = useNavigate();
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
API_URL_KEY,
|
||||
} from './../constants/url';
|
||||
|
||||
/* Hoem Management = 홈 API */
|
||||
/* Home Management = 홈 API */
|
||||
export const API_URL_HOME = {
|
||||
homeToday: () => {
|
||||
// POST: 오늘 매출 및 정산 조회
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
|
||||
/* Payment Management = 결제관리 API */
|
||||
export const API_URL_PAYMENT = {
|
||||
paymentnotificationData: () => {
|
||||
paymentNotificationData: () => {
|
||||
// POST: 결제데이터 통보 조회
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/payment/notification/data`;
|
||||
},
|
||||
|
||||
@@ -110,80 +110,6 @@ export const API_URL = {
|
||||
},
|
||||
|
||||
|
||||
/* Extension Management - 부가서비스 API */
|
||||
extensionSmsResend: () => {
|
||||
// POST: SMS 결제 통보 > SMS 재발송
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/sms/resend`;
|
||||
},
|
||||
extensionSmsList: () => {
|
||||
// POST: SMS 결제 통보 목록 조회
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/sms/list`;
|
||||
},
|
||||
extensionSmsDownloadExcel: () => {
|
||||
// POST: SMS 결제 통보 엑셀 다운
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/sms/download/excel`;
|
||||
},
|
||||
extensionSmsDetail: () => {
|
||||
// POST: SMS 결제 통보 상세 조회
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/sms/detail`;
|
||||
},
|
||||
extensionList: () => {
|
||||
// POST: 부가서비스 조회
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/list`;
|
||||
},
|
||||
extensionKeyinList: () => {
|
||||
// POST: KEY-IN 결제 목록 조회
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/keyin/list`;
|
||||
},
|
||||
extensionKeyinDownloadExcel: () => {
|
||||
// POST: KEY-IN 결제 엑셀 다운
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/keyin/download/excel`;
|
||||
},
|
||||
extensionKeyinApply: () => {
|
||||
// POST: KEY-IN 결제 > 결제 신청
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/keyin/apply`;
|
||||
},
|
||||
extensionArsResend: () => {
|
||||
// POST: SMS 신용카드 ARS 결제 > SMS 재전송
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/ars/resend`;
|
||||
},
|
||||
extensionArsList: () => {
|
||||
// POST: 신용카드 ARS 결제 > 목록 조회
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/ars/list`;
|
||||
},
|
||||
extensionArsDownloadExcel: () => {
|
||||
// POST: 신용카드 ARS 결제 > 엑셀 다운
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/ars/download/excel`;
|
||||
},
|
||||
extensionArsDetail: () => {
|
||||
// POST: 신용카드 ARS 결제 > 상세 내용 조회
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/ars/detail`;
|
||||
},
|
||||
extensionArsApply: () => {
|
||||
// POST: 신용카드 ARS 결제 > 결제 신청
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/ars/apply`;
|
||||
},
|
||||
extensionAlimtalkSettingSave: () => {
|
||||
// POST: 알림톡 결제 통보 > 서비스 설정 저장
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/alimtalk/setting/save`;
|
||||
},
|
||||
extensionAlimtalkSettingDetail: () => {
|
||||
// POST: 알림톡 결제 통보 > 서비스 설정 목록 조회
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/alimtalk/setting/detail`;
|
||||
},
|
||||
extensionAlimtalkList: () => {
|
||||
// POST: 알림톡 결제 통보 목록 조회
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/alimtalk/list`;
|
||||
},
|
||||
extensionAlimtalkDownloadExcel: () => {
|
||||
// POST: 알림톡 결제 통보 엑셀 다운
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/alimtalk/download/excel`;
|
||||
},
|
||||
extensionAlimtalkDetail: () => {
|
||||
// POST: 알림톡 결제 통보 상세 조회
|
||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/extension/alimtalk/detail`;
|
||||
},
|
||||
|
||||
/* Empty Token API Management - jwt 토큰이 없는 API 관리 */
|
||||
emptyTokenVerifyCode: () => {
|
||||
// POST: 인증 코드 검증
|
||||
|
||||
@@ -2,7 +2,12 @@ const { origin } = window.location;
|
||||
export const CURRENT_URL = `${origin}`;
|
||||
|
||||
const getAPIBaseUrl = () => {
|
||||
return CURRENT_URL;
|
||||
let rs = CURRENT_URL;
|
||||
console.log('VITE_APP_ENV : ', import.meta.env.VITE_APP_ENV);
|
||||
if(import.meta.env.VITE_APP_ENV === 'production'){
|
||||
rs = import.meta.env.VITE_APP_API_PROXY_HOST;
|
||||
}
|
||||
return rs;
|
||||
};
|
||||
const getHeaderUserAgent = () => {
|
||||
let os = 'Android';
|
||||
|
||||
Reference in New Issue
Block a user