결제데이터통보
This commit is contained in:
@@ -52,9 +52,11 @@ export const DataNotificationPage = () => {
|
||||
<div className="tab-content">
|
||||
<div className="tab-pane pt-46 active">
|
||||
<PaymentTab activeTab={ activeTab }></PaymentTab>
|
||||
<DataNotificationWrap
|
||||
paymentNotificationData={ paymentNotificationDataResult }
|
||||
></DataNotificationWrap>
|
||||
{ !!paymentNotificationDataResult &&
|
||||
<DataNotificationWrap
|
||||
paymentNotificationData={ paymentNotificationDataResult }
|
||||
></DataNotificationWrap>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
@@ -3,7 +3,7 @@ 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 { PaymentCardResponse, PaymentNonCardResponse, PaymentTabKeys } from '@/entities/payment/model/types';
|
||||
import { PaymentCardResponse, PaymentInstallmentResponse, 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';
|
||||
@@ -13,18 +13,21 @@ import {
|
||||
useSetFooterMode,
|
||||
useSetOnBack
|
||||
} from '@/widgets/sub-layout/use-sub-layout';
|
||||
import { usePaymentInstallmentMutation } from '@/entities/payment/api/use-payment-installment-mutation';
|
||||
|
||||
export const InfoPage = () => {
|
||||
const { navigate } = useNavigate();
|
||||
|
||||
const { mutateAsync: paymentCard } = usePaymentCardMutation();
|
||||
const { mutateAsync: paymentNonCard } = usePaymentNonCardMutation();
|
||||
const { mutateAsync: paymentInstallment } = usePaymentInstallmentMutation();
|
||||
|
||||
const [activeTab, setActiveTab] = useState<PaymentTabKeys>(PaymentTabKeys.Info);
|
||||
const [mid, setMid] = useState<string>('nictest00g');
|
||||
|
||||
const [paymentCardResult, setPaymentCardResult] = useState<PaymentCardResponse>();
|
||||
const [paymentNonCardResult, setPaymentNonCardResult] = useState<PaymentNonCardResponse>();
|
||||
const [paymentInstallmentResult, setPaymentInstallResult] = useState<PaymentInstallmentResponse>();
|
||||
|
||||
useSetHeaderTitle('결제 관리');
|
||||
useSetHeaderType(HeaderType.LeftArrow);
|
||||
@@ -55,10 +58,22 @@ export const InfoPage = () => {
|
||||
setPaymentNonCardResult(rs);
|
||||
});
|
||||
};
|
||||
const callPaymentIntallment = () => {
|
||||
let params = {
|
||||
mid: mid,
|
||||
paymentMethod: 'CREDIT_CARD'
|
||||
};
|
||||
|
||||
paymentInstallment(params).then((rs) => {
|
||||
console.log(rs);
|
||||
setPaymentInstallResult(rs);
|
||||
});
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
callPaymentCard();
|
||||
callPaymentNonCard();
|
||||
callPaymentIntallment();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
@@ -70,6 +85,7 @@ export const InfoPage = () => {
|
||||
<InfoWrap
|
||||
paymentCard={ paymentCardResult }
|
||||
paymentNonCard={ paymentNonCardResult }
|
||||
paymentInstallment={ paymentInstallmentResult }
|
||||
></InfoWrap>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user