- ars,SMS,KeyIn 수정
This commit is contained in:
@@ -30,7 +30,6 @@ export const ArsDetailPage = () => {
|
||||
|
||||
const tid = location.state.tid;
|
||||
const mid = location.state.mid;
|
||||
const amount = location.state.amount;
|
||||
|
||||
const [detail, setDetail] = useState<ExtensionArsDetailResponse>();
|
||||
const [bottomSheetOn, setBottomSheetOn] = useState<boolean>(false);
|
||||
@@ -86,7 +85,7 @@ export const ArsDetailPage = () => {
|
||||
<div className="num-amount">
|
||||
<span className="amount">
|
||||
<NumericFormat
|
||||
value={ amount }
|
||||
value={ detail?.amount }
|
||||
thousandSeparator
|
||||
displayType="text"
|
||||
suffix='원'
|
||||
@@ -153,7 +152,7 @@ export const ArsDetailPage = () => {
|
||||
<button
|
||||
className="btn-50 btn-blue flex-1"
|
||||
onClick={ () => onClickToOpenResendBottomSheet() }
|
||||
disabled={ detail?.orderStatus !== OrderStatus.PENDING }
|
||||
//disabled={ detail?.orderStatus !== OrderStatus.PENDING }
|
||||
>SMS 재전송</button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -187,8 +187,8 @@ export const ArsListPage = () => {
|
||||
for (let i = 0; i < listItems.length; i++) {
|
||||
let item = listItems[i];
|
||||
if (!!item) {
|
||||
let paymentDate = item?.paymentDate || '';
|
||||
let itemDate = paymentDate.substring(0, 8);
|
||||
let orderDate = item?.orderDate || '';
|
||||
let itemDate = orderDate.substring(0, 8);
|
||||
if (!!itemDate) {
|
||||
if (i === 0) {
|
||||
date = itemDate;
|
||||
|
||||
@@ -11,13 +11,17 @@ import {
|
||||
useSetFooterMode,
|
||||
useSetOnBack
|
||||
} from '@/widgets/sub-layout/use-sub-layout';
|
||||
import { ArsPaymentMethod, ExtensionArsApplyParams } from '@/entities/additional-service/model/ars/types';
|
||||
import { ArsPaymentMethod, ExtensionArsApplyParams, ExtensionArsApplyResponse } from '@/entities/additional-service/model/ars/types';
|
||||
import { ArsRequestSuccessPage } from './request-success-page';
|
||||
import { useStore } from '@/shared/model/store';
|
||||
import { snackBar } from '@/shared/lib';
|
||||
|
||||
export const ArsRequestPage = () => {
|
||||
const { navigate } = useNavigate();
|
||||
const location = useLocation();
|
||||
|
||||
const midOptions = useStore.getState().UserStore.selectOptionsMids
|
||||
|
||||
const { mid: receivedMid } = location.state || {};
|
||||
|
||||
const { mutateAsync: arsApply } = useExtensionArsApplyMutation();
|
||||
@@ -26,7 +30,7 @@ export const ArsRequestPage = () => {
|
||||
const [moid, setMoid] = useState<string>('');
|
||||
const [goodsName, setGoodsName] = useState<string>('');
|
||||
const [amount, setAmount] = useState<number>(0);
|
||||
const [instmntMonth, setInstmntMonth] = useState<string>('');
|
||||
const [instmntMonth, setInstmntMonth] = useState<string>('00');
|
||||
const [buyerName, setBuyerName] = useState<string>('');
|
||||
const [phoneNumber, setPhoneNumber] = useState<string>('');
|
||||
const [email, setEamil] = useState<string>('');
|
||||
@@ -53,15 +57,18 @@ export const ArsRequestPage = () => {
|
||||
email: email,
|
||||
arsPaymentMethod: arsPaymentMethod,
|
||||
};
|
||||
arsApply(arsApplyParams).then((rs) => {
|
||||
console.log(rs)
|
||||
setResultMessage('결제 신청이 완료되었습니다');
|
||||
setSuccessPageOn(true);
|
||||
}).catch(() => {
|
||||
|
||||
}).finally(() => {
|
||||
|
||||
});
|
||||
arsApply(arsApplyParams)
|
||||
.then((rs: ExtensionArsApplyResponse) => {
|
||||
if (rs.status === true) {
|
||||
setSuccessPageOn(true);
|
||||
} else {
|
||||
const errorMessage = rs.error?.message || '신청을 실패하였습니다.';
|
||||
snackBar(`[실패] ${errorMessage}`);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
snackBar(`[실패] ${error?.response?.data?.message || error?.response?.data?.error?.message}` || '[실패] 신청을 실패하였습니다.')
|
||||
})
|
||||
|
||||
};
|
||||
|
||||
@@ -116,10 +123,19 @@ export const ArsRequestPage = () => {
|
||||
<div className="billing-row">
|
||||
<div className="billing-label">가맹점 <span>*</span></div>
|
||||
<div className="billing-field">
|
||||
<input
|
||||
type="text"
|
||||
<select
|
||||
value={mid}
|
||||
/>
|
||||
onChange={(e: ChangeEvent<HTMLSelectElement>) => setMid(e.target.value)}
|
||||
>
|
||||
{
|
||||
midOptions.map((value) => (
|
||||
<option
|
||||
key={value.value}
|
||||
value={value.value}
|
||||
>{value.name}</option>
|
||||
))
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -164,9 +180,12 @@ export const ArsRequestPage = () => {
|
||||
<div className="billing-row">
|
||||
<div className="billing-label">할부기간 <span>*</span></div>
|
||||
<div className="billing-field">
|
||||
<select disabled>
|
||||
<option selected>일시불</option>
|
||||
<option>일시불</option>
|
||||
<select
|
||||
disabled
|
||||
value={instmntMonth}
|
||||
onChange={(e: ChangeEvent<HTMLSelectElement>) => setInstmntMonth(e.target.value)}
|
||||
>
|
||||
<option value="00">일시불</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -77,7 +77,7 @@ export const KeyInPaymentPage = () => {
|
||||
const callList = (type?: string) => {
|
||||
setOnActionIntersect(false);
|
||||
let listParams = {
|
||||
mid: mid,
|
||||
mid: 'nictest02m',
|
||||
startDate: startDate,
|
||||
endDate: endDate,
|
||||
transactionType: transactionType,
|
||||
|
||||
@@ -64,12 +64,11 @@ export const KeyInPaymentRequestPage = () => {
|
||||
|
||||
const callKeyInPaymentRequest = () => {
|
||||
const cardNo = `${cardNo1}${cardNo2}${cardNo3}${cardNo4}`;
|
||||
|
||||
const cardExpire = `${expMon}${expYear}`
|
||||
let keyInApplyParams = {
|
||||
mid: mid,
|
||||
cardNo: cardNo,
|
||||
expYear: expYear,
|
||||
expMon: expMon,
|
||||
cardExpire: cardExpire,
|
||||
instmnt: instmnt,
|
||||
amount: amount,
|
||||
productName: productName,
|
||||
|
||||
Reference in New Issue
Block a user