css 수정 홈 api payment api
This commit is contained in:
29
src/entities/payment/api/use-payment-card-mutaion.ts
Normal file
29
src/entities/payment/api/use-payment-card-mutaion.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_PAYMENT } from '@/shared/api/api-url-payment';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
PaymentCardParams,
|
||||
PaymentCardResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const paymentCard = (params: PaymentCardParams) => {
|
||||
return resultify(
|
||||
axios.post<PaymentCardResponse>(API_URL_PAYMENT.paymentCard(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const usePaymentCardMutation = (options?: UseMutationOptions<PaymentCardResponse, CBDCAxiosError, PaymentCardParams>) => {
|
||||
const mutation = useMutation<PaymentCardResponse, CBDCAxiosError, PaymentCardParams>({
|
||||
...options,
|
||||
mutationFn: (params: PaymentCardParams) => paymentCard(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_PAYMENT } from '@/shared/api/api-url-payment';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
PaymentInstallmentDetailParams,
|
||||
PaymentInstallmentDetailResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const paymentInstallmentDetail = (params: PaymentInstallmentDetailParams) => {
|
||||
return resultify(
|
||||
axios.post<PaymentInstallmentDetailResponse>(API_URL_PAYMENT.paymentInstallmentDetail(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const usePaymentInstallmentDetailMutation = (options?: UseMutationOptions<PaymentInstallmentDetailResponse, CBDCAxiosError, PaymentInstallmentDetailParams>) => {
|
||||
const mutation = useMutation<PaymentInstallmentDetailResponse, CBDCAxiosError, PaymentInstallmentDetailParams>({
|
||||
...options,
|
||||
mutationFn: (params: PaymentInstallmentDetailParams) => paymentInstallmentDetail(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
29
src/entities/payment/api/use-payment-installment-mutaion.ts
Normal file
29
src/entities/payment/api/use-payment-installment-mutaion.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_PAYMENT } from '@/shared/api/api-url-payment';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
PaymentInstallmentParams,
|
||||
PaymentInstallmentResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const paymentInstallment = (params: PaymentInstallmentParams) => {
|
||||
return resultify(
|
||||
axios.post<PaymentInstallmentResponse>(API_URL_PAYMENT.paymentInstallment(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const usePaymentInstallmentMutation = (options?: UseMutationOptions<PaymentInstallmentResponse, CBDCAxiosError, PaymentInstallmentParams>) => {
|
||||
const mutation = useMutation<PaymentInstallmentResponse, CBDCAxiosError, PaymentInstallmentParams>({
|
||||
...options,
|
||||
mutationFn: (params: PaymentInstallmentParams) => paymentInstallment(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
29
src/entities/payment/api/use-payment-non-card-mutation.ts
Normal file
29
src/entities/payment/api/use-payment-non-card-mutation.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_PAYMENT } from '@/shared/api/api-url-payment';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
PaymentNonCardParams,
|
||||
PaymentNonCardResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const paymentNonCard = (params: PaymentNonCardParams) => {
|
||||
return resultify(
|
||||
axios.post<PaymentNonCardResponse>(API_URL_PAYMENT.paymentNonCard(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const usePaymentNonCardMutation = (options?: UseMutationOptions<PaymentNonCardResponse, CBDCAxiosError, PaymentNonCardParams>) => {
|
||||
const mutation = useMutation<PaymentNonCardResponse, CBDCAxiosError, PaymentNonCardParams>({
|
||||
...options,
|
||||
mutationFn: (params: PaymentNonCardParams) => paymentNonCard(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
import axios from 'axios';
|
||||
import { API_URL_PAYMENT } from '@/shared/api/api-url-payment';
|
||||
import { resultify } from '@/shared/lib/resultify';
|
||||
import { CBDCAxiosError } from '@/shared/@types/error';
|
||||
import {
|
||||
PaymentNotificationDataParams,
|
||||
PaymentNotificationDataResponse
|
||||
} from '../model/types';
|
||||
import {
|
||||
useMutation,
|
||||
UseMutationOptions
|
||||
} from '@tanstack/react-query';
|
||||
|
||||
export const paymentNotificationData = (params: PaymentNotificationDataParams) => {
|
||||
return resultify(
|
||||
axios.post<PaymentNotificationDataResponse>(API_URL_PAYMENT.paymentnotificationData(), params),
|
||||
);
|
||||
};
|
||||
|
||||
export const usePaymentNotificationDataMutation = (options?: UseMutationOptions<PaymentNotificationDataResponse, CBDCAxiosError, PaymentNotificationDataParams>) => {
|
||||
const mutation = useMutation<PaymentNotificationDataResponse, CBDCAxiosError, PaymentNotificationDataParams>({
|
||||
...options,
|
||||
mutationFn: (params: PaymentNotificationDataParams) => paymentNotificationData(params),
|
||||
});
|
||||
|
||||
return {
|
||||
...mutation,
|
||||
};
|
||||
};
|
||||
@@ -9,4 +9,140 @@ export interface InfoItemProps {
|
||||
payName?: string;
|
||||
payImage?: string;
|
||||
infoLink?: string;
|
||||
};
|
||||
};
|
||||
|
||||
export interface PaymentCommonParams {
|
||||
mid: string;
|
||||
};
|
||||
export interface PaymentNotificationDataParams extends PaymentCommonParams {
|
||||
gid: string;
|
||||
};
|
||||
export interface PaymentNotificationDataResponse {
|
||||
merchantInfo: MerchantInfo;
|
||||
creditCard: CreditCard;
|
||||
accountTransfer: AccountTransfer;
|
||||
virtualAccount: VirtualAccount;
|
||||
mobilePayment: MobilePayment;
|
||||
escrowPayment: EscrowPayment
|
||||
};
|
||||
export interface MerchantInfo {
|
||||
paymentInfoType: string;
|
||||
mid: string;
|
||||
};
|
||||
export interface CreditCard {
|
||||
id: number;
|
||||
paymentMethodName: string;
|
||||
startDate: string;
|
||||
adminEmail: string;
|
||||
urlIp: string;
|
||||
retransmissionInterval: string;
|
||||
retransmissionCount: string;
|
||||
okCheck: string;
|
||||
encryptionStatus: string;
|
||||
expandable: boolean;
|
||||
detail: Record<string, any>;
|
||||
};
|
||||
export interface AccountTransfer {
|
||||
id: number;
|
||||
paymentMethodName: string;
|
||||
startDate: string;
|
||||
adminEmail: string;
|
||||
urlIp: string;
|
||||
retransmissionInterval: string;
|
||||
retransmissionCount: string;
|
||||
okCheck: string;
|
||||
encryptionStatus: string;
|
||||
expandable: boolean;
|
||||
detail: Record<string, any>;
|
||||
};
|
||||
export interface VirtualAccount {
|
||||
id: number;
|
||||
paymentMethodName: string;
|
||||
startDate: string;
|
||||
adminEmail: string;
|
||||
urlIp: string;
|
||||
retransmissionInterval: string;
|
||||
retransmissionCount: string;
|
||||
okCheck: string;
|
||||
encryptionStatus: string;
|
||||
expandable: boolean;
|
||||
detail: Record<string, any>;
|
||||
};
|
||||
export interface MobilePayment {
|
||||
id: 1,
|
||||
paymentMethodName: string;
|
||||
startDate: string;
|
||||
adminEmail: string;
|
||||
urlIp: string;
|
||||
retransmissionInterval: string;
|
||||
retransmissionCount: string;
|
||||
okCheck: string;
|
||||
encryptionStatus: string;
|
||||
expandable: boolean;
|
||||
detail: Record<string, any>;
|
||||
};
|
||||
export interface EscrowPayment {
|
||||
id: 1,
|
||||
paymentMethodName: string;
|
||||
startDate: string;
|
||||
adminEmail: string;
|
||||
urlIp: string;
|
||||
retransmissionInterval: string;
|
||||
retransmissionCount: string;
|
||||
okCheck: string;
|
||||
encryptionStatus: string;
|
||||
expandable: boolean;
|
||||
detail: Record<string, any>;
|
||||
};
|
||||
export interface PaymentNonCardParams extends PaymentCommonParams {
|
||||
paymentMethod: string;
|
||||
};
|
||||
export interface PaymentNonCardResponse {
|
||||
settlementPeriod: string;
|
||||
accountTransferData: AccountTransferData;
|
||||
mobilePaymentData: MobilePaymentData;
|
||||
otherPaymentData: OtherPaymentData;
|
||||
};
|
||||
export interface AccountTransferData {
|
||||
feeRanges: Array<Record<string, any>>;
|
||||
bankFees: Array<Record<string, any>>;
|
||||
};
|
||||
export interface MobilePaymentData {
|
||||
paymentFees: Array<Record<string, any>>;
|
||||
categoryFees: Array<Record<string, any>>;
|
||||
};
|
||||
export interface OtherPaymentData {
|
||||
feeRate: number;
|
||||
};
|
||||
export interface PaymentInstallmentParams extends PaymentCommonParams {
|
||||
paymentMethod: string;
|
||||
};
|
||||
export interface PaymentInstallmentResponse {
|
||||
installmentData: Array<Record<string, any>>;
|
||||
};
|
||||
export interface PaymentInstallmentDetailParams extends PaymentCommonParams {
|
||||
cardCompany: string;
|
||||
};
|
||||
export interface PaymentInstallmentDetailResponse {
|
||||
cardCompany: string;
|
||||
cardCompanyOptions: Array<string>;
|
||||
installmentDetails: Array<Record<string, any>>;
|
||||
};
|
||||
export interface PaymentCardParams extends PaymentCommonParams{
|
||||
paymentMethod: string;
|
||||
};
|
||||
export interface PaymentCardResponse {
|
||||
settlementPeriod: string;
|
||||
generalTab: GeneralTab;
|
||||
installmentTab: InstallmentTab;
|
||||
moneyPointTab: MoneyPointTab;
|
||||
};
|
||||
export interface GeneralTab {
|
||||
items: Array<Record<string, any>>;
|
||||
};
|
||||
export interface InstallmentTab {
|
||||
items: Array<Record<string, any>>;
|
||||
};
|
||||
export interface MoneyPointTab {
|
||||
items: Array<Record<string, any>>;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user