부가서비스

- 링크결제 결제신청 API 연결
This commit is contained in:
HyeonJongKim
2025-09-22 17:00:02 +09:00
parent ea9803d442
commit b5bdd3d855
9 changed files with 327 additions and 98 deletions

View File

@@ -0,0 +1,26 @@
import axios from 'axios';
import { API_URL_ADDITIONAL_SERVICE } from '@/shared/api/api-url-additional-service';
import { resultify } from '@/shared/lib/resultify';
import { CBDCAxiosError } from '@/shared/@types/error';
import {
useMutation,
UseMutationOptions
} from '@tanstack/react-query';
import { ExtensionLinkPayRequestParams, ExtensionLinkPayRequestResponse } from '../../model/types';
export const extensionLinkPayRequest = (params: ExtensionLinkPayRequestParams) => {
return resultify(
axios.post<ExtensionLinkPayRequestResponse>(API_URL_ADDITIONAL_SERVICE.extensionLinkPaymentRequest(), params),
);
};
export const useExtensionLinkPayRequestMutation = (options?: UseMutationOptions<ExtensionLinkPayRequestResponse, CBDCAxiosError, ExtensionLinkPayRequestParams>) => {
const mutation = useMutation<ExtensionLinkPayRequestResponse, CBDCAxiosError, ExtensionLinkPayRequestParams>({
...options,
mutationFn: (params: ExtensionLinkPayRequestParams) => extensionLinkPayRequest(params),
});
return {
...mutation,
};
};

View File

@@ -13,7 +13,7 @@ import { ExtensionLinkPayWaitDeleteParams } from '../../model/types';
export const extensionLinkPayWaitDelete = async (params: ExtensionLinkPayWaitDeleteParams)=> {
return resultify(
axios.post<ExtensionLinkPayWaitDeleteRespone>(API_URL_ADDITIONAL_SERVICE.extensionLinkPayMentWaitDelete(), params)
axios.post<ExtensionLinkPayWaitDeleteRespone>(API_URL_ADDITIONAL_SERVICE.extensionLinkPaymentWaitDelete(), params)
);
};