파라미터 오류 수정
This commit is contained in:
@@ -16,12 +16,10 @@ export enum NotifyRowKeys {
|
|||||||
MobilePayment = 'MobilePayment',
|
MobilePayment = 'MobilePayment',
|
||||||
EscrowPayment = 'EscrowPayment',
|
EscrowPayment = 'EscrowPayment',
|
||||||
};
|
};
|
||||||
export interface PaymentCommonParams {
|
|
||||||
|
export interface PaymentNotificationDataParams {
|
||||||
mid: string;
|
mid: string;
|
||||||
};
|
};
|
||||||
export interface PaymentNotificationDataParams extends PaymentCommonParams {
|
|
||||||
gid: string;
|
|
||||||
};
|
|
||||||
export interface PaymentNotificationDataResponse {
|
export interface PaymentNotificationDataResponse {
|
||||||
merchantInfo: MerchantInfo;
|
merchantInfo: MerchantInfo;
|
||||||
creditCard: CreditCard;
|
creditCard: CreditCard;
|
||||||
@@ -46,7 +44,7 @@ export interface PaymentNotificationDataCommonType {
|
|||||||
encryptionStatus: string;
|
encryptionStatus: string;
|
||||||
expandable: boolean;
|
expandable: boolean;
|
||||||
detail: Record<string, any>;
|
detail: Record<string, any>;
|
||||||
}
|
};
|
||||||
|
|
||||||
export interface CreditCard extends PaymentNotificationDataCommonType {};
|
export interface CreditCard extends PaymentNotificationDataCommonType {};
|
||||||
export interface AccountTransfer extends PaymentNotificationDataCommonType {};
|
export interface AccountTransfer extends PaymentNotificationDataCommonType {};
|
||||||
@@ -54,7 +52,8 @@ export interface VirtualAccount extends PaymentNotificationDataCommonType {};
|
|||||||
export interface MobilePayment extends PaymentNotificationDataCommonType {};
|
export interface MobilePayment extends PaymentNotificationDataCommonType {};
|
||||||
export interface EscrowPayment extends PaymentNotificationDataCommonType {};
|
export interface EscrowPayment extends PaymentNotificationDataCommonType {};
|
||||||
|
|
||||||
export interface PaymentNonCardParams extends PaymentCommonParams {
|
export interface PaymentNonCardParams {
|
||||||
|
mid: string;
|
||||||
paymentMethod: string;
|
paymentMethod: string;
|
||||||
};
|
};
|
||||||
export interface PaymentNonCardResponse {
|
export interface PaymentNonCardResponse {
|
||||||
@@ -96,7 +95,8 @@ export interface CategoryFees {
|
|||||||
export interface OtherPaymentData {
|
export interface OtherPaymentData {
|
||||||
feeRate: number;
|
feeRate: number;
|
||||||
};
|
};
|
||||||
export interface PaymentInstallmentParams extends PaymentCommonParams {
|
export interface PaymentInstallmentParams {
|
||||||
|
mid: string;
|
||||||
paymentMethod: string;
|
paymentMethod: string;
|
||||||
};
|
};
|
||||||
export interface PaymentInstallmentResponse {
|
export interface PaymentInstallmentResponse {
|
||||||
@@ -113,7 +113,8 @@ export interface InstallmentDetails {
|
|||||||
applicationPeriod: string;
|
applicationPeriod: string;
|
||||||
applicationAmount: number;
|
applicationAmount: number;
|
||||||
};
|
};
|
||||||
export interface PaymentInstallmentDetailParams extends PaymentCommonParams {
|
export interface PaymentInstallmentDetailParams {
|
||||||
|
mid: string;
|
||||||
cardCompany: string;
|
cardCompany: string;
|
||||||
};
|
};
|
||||||
export interface PaymentInstallmentDetailResponse {
|
export interface PaymentInstallmentDetailResponse {
|
||||||
@@ -121,7 +122,8 @@ export interface PaymentInstallmentDetailResponse {
|
|||||||
cardCompanyOptions: Array<string>;
|
cardCompanyOptions: Array<string>;
|
||||||
installmentDetails: Array<InstallmentDetails>;
|
installmentDetails: Array<InstallmentDetails>;
|
||||||
};
|
};
|
||||||
export interface PaymentCardParams extends PaymentCommonParams{
|
export interface PaymentCardParams {
|
||||||
|
mid: string;
|
||||||
paymentMethod: string;
|
paymentMethod: string;
|
||||||
};
|
};
|
||||||
export interface PaymentCardResponse {
|
export interface PaymentCardResponse {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { ChangeEvent, useEffect, useState } from 'react';
|
import { ChangeEvent, useEffect, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { NotifyRowKeys } from '../model/types';
|
import { NotifyRowKeys, PaymentNotificationDataParams, PaymentNotificationDataResponse } from '../model/types';
|
||||||
import { usePaymentNotificationDataMutation } from '../api/use-payment-notification-data-mutation';
|
import { usePaymentNotificationDataMutation } from '../api/use-payment-notification-data-mutation';
|
||||||
import { useStore } from '@/shared/model/store';
|
import { useStore } from '@/shared/model/store';
|
||||||
import { NotifyRow } from './section/notify-row';
|
import { NotifyRow } from './section/notify-row';
|
||||||
@@ -26,13 +26,11 @@ export const NotificationDataWrap = () => {
|
|||||||
const { mutateAsync: paymentNotificationData } = usePaymentNotificationDataMutation();
|
const { mutateAsync: paymentNotificationData } = usePaymentNotificationDataMutation();
|
||||||
|
|
||||||
const callPaymentNotificationData = () => {
|
const callPaymentNotificationData = () => {
|
||||||
let params = {
|
let params: PaymentNotificationDataParams = {
|
||||||
mid: mid,
|
mid: mid
|
||||||
gid: mid
|
|
||||||
};
|
};
|
||||||
|
|
||||||
paymentNotificationData(params).then((rs) => {
|
paymentNotificationData(params).then((rs: PaymentNotificationDataResponse) => {
|
||||||
console.log(rs);
|
|
||||||
setMerchantInfo(rs?.merchantInfo);
|
setMerchantInfo(rs?.merchantInfo);
|
||||||
setCreditCard(rs?.creditCard.detail);
|
setCreditCard(rs?.creditCard.detail);
|
||||||
setAccountTransfer(rs?.accountTransfer.detail);
|
setAccountTransfer(rs?.accountTransfer.detail);
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
export * from './use-navigate';
|
export * from './use-navigate';
|
||||||
export * from './use-change-bg-color';
|
|
||||||
export * from './use-device-uid';
|
export * from './use-device-uid';
|
||||||
export * from './use-fix-scroll-view-safari';
|
export * from './use-fix-scroll-view-safari';
|
||||||
export * from './use-has-bio-hardware';
|
export * from './use-has-bio-hardware';
|
||||||
@@ -7,5 +6,4 @@ export * from './use-navigate';
|
|||||||
export * from './use-location-permission';
|
export * from './use-location-permission';
|
||||||
export * from './use-window-focus-change';
|
export * from './use-window-focus-change';
|
||||||
export * from './use-router-listener';
|
export * from './use-router-listener';
|
||||||
export * from './use-scroll-to-top';
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,44 +0,0 @@
|
|||||||
/* eslint-disable react-hooks/exhaustive-deps */
|
|
||||||
import { useLayoutEffect } from 'react';
|
|
||||||
|
|
||||||
import useLocalStorageState from 'use-local-storage-state';
|
|
||||||
import { DEFAULT_BACKGROUND_COLOR } from '@/shared/constants/colors';
|
|
||||||
import { StorageKeys } from '@/shared/constants/local-storage';
|
|
||||||
import { NativeFunction } from '@/shared/constants/native-function';
|
|
||||||
import { useRouterListener } from './use-router-listener';
|
|
||||||
|
|
||||||
export const useChangeBgColor = (color: string) => {
|
|
||||||
const [, setAppColor] = useAppColor();
|
|
||||||
|
|
||||||
useLayoutEffect(() => {
|
|
||||||
setAppColor(color);
|
|
||||||
window.webViewBridge.send(NativeFunction.SetAppColor, color);
|
|
||||||
document.body.style.backgroundColor = color;
|
|
||||||
}, []);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const useResetBgColor = () => {
|
|
||||||
const [, setAppColor] = useAppColor();
|
|
||||||
const defaultColor = DEFAULT_BACKGROUND_COLOR;
|
|
||||||
|
|
||||||
useLayoutEffect(() => {
|
|
||||||
setAppColor(defaultColor);
|
|
||||||
window.webViewBridge.send(NativeFunction.SetAppColor, defaultColor);
|
|
||||||
document.body.style.backgroundColor = defaultColor;
|
|
||||||
}, []);
|
|
||||||
};
|
|
||||||
|
|
||||||
export const useResetBgColorOnLeave = () => {
|
|
||||||
const [, setAppColor] = useAppColor();
|
|
||||||
const defaultColor = DEFAULT_BACKGROUND_COLOR;
|
|
||||||
|
|
||||||
useRouterListener(() => {
|
|
||||||
setAppColor(defaultColor);
|
|
||||||
document.body.style.backgroundColor = defaultColor;
|
|
||||||
window.webViewBridge.send(NativeFunction.SetAppColor, defaultColor);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export const useAppColor = () => {
|
|
||||||
return useLocalStorageState(StorageKeys.AppColor, { defaultValue: DEFAULT_BACKGROUND_COLOR });
|
|
||||||
};
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
import { CSSProperties, useEffect, useState } from 'react';
|
|
||||||
|
|
||||||
export const useFixedButtonPosition = () => {
|
|
||||||
const [buttonStyle, setButtonStyle] = useState<CSSProperties | undefined>();
|
|
||||||
|
|
||||||
const updateButtonPosition = () => {
|
|
||||||
const viewport = window.visualViewport;
|
|
||||||
const viewportHeight = viewport?.height;
|
|
||||||
const viewportOffsetTop = viewport?.offsetTop ?? 0;
|
|
||||||
|
|
||||||
if (viewportHeight && viewportHeight < window.innerHeight) {
|
|
||||||
setButtonStyle({ bottom: `${window.innerHeight - viewportHeight - viewportOffsetTop + 15}px` });
|
|
||||||
} else {
|
|
||||||
setButtonStyle(undefined);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const handleResize = () => {
|
|
||||||
updateButtonPosition();
|
|
||||||
};
|
|
||||||
|
|
||||||
visualViewport?.addEventListener('resize', handleResize);
|
|
||||||
window.addEventListener('resize', handleResize); // fallback for window resize
|
|
||||||
|
|
||||||
return () => {
|
|
||||||
visualViewport?.removeEventListener('resize', handleResize);
|
|
||||||
window.removeEventListener('resize', handleResize);
|
|
||||||
};
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const handleScroll = () => {
|
|
||||||
updateButtonPosition();
|
|
||||||
};
|
|
||||||
|
|
||||||
window.addEventListener('scroll', handleScroll);
|
|
||||||
|
|
||||||
return () => {
|
|
||||||
window.removeEventListener('scroll', handleScroll);
|
|
||||||
};
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
return buttonStyle;
|
|
||||||
};
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
import { useEffect } from 'react';
|
|
||||||
|
|
||||||
export const useScrollToTop = () => {
|
|
||||||
useEffect(() => {
|
|
||||||
document.body.scrollTop = 0;
|
|
||||||
}, []);
|
|
||||||
};
|
|
||||||
@@ -10,7 +10,6 @@ import { HeaderNavigation } from '@/widgets/navigation/header';
|
|||||||
import { FooterNavigation } from '@/widgets/navigation/footer';
|
import { FooterNavigation } from '@/widgets/navigation/footer';
|
||||||
import { PullToRefresh } from '@/widgets/pull-to-refresh/pull-to-refresh';
|
import { PullToRefresh } from '@/widgets/pull-to-refresh/pull-to-refresh';
|
||||||
import { useNavigate } from '@/shared/lib/hooks';
|
import { useNavigate } from '@/shared/lib/hooks';
|
||||||
import { useScrollToTop } from '@/shared/lib/hooks/use-scroll-to-top';
|
|
||||||
import {
|
import {
|
||||||
CodeListItem,
|
CodeListItem,
|
||||||
CodesSelectParams,
|
CodesSelectParams,
|
||||||
@@ -59,7 +58,6 @@ export interface OnSetCommonCodesProps {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const SubLayout = () => {
|
export const SubLayout = () => {
|
||||||
useScrollToTop();
|
|
||||||
const {
|
const {
|
||||||
callLogin,
|
callLogin,
|
||||||
updateUserData
|
updateUserData
|
||||||
|
|||||||
Reference in New Issue
Block a user