mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
feat: Stripe payment integration
This commit is contained in:
@@ -6,7 +6,6 @@ import { transformToCamelCase } from '@/utils';
|
||||
const PaymentServicesQueryKey = 'PaymentServices';
|
||||
|
||||
export interface GetPaymentServicesResponse {}
|
||||
|
||||
/**
|
||||
* Retrieves the integrated payment services.
|
||||
* @param {UseQueryOptions<GetPaymentServicesResponse, Error>} options
|
||||
@@ -33,3 +32,31 @@ export const useGetPaymentServices = (
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
export interface GetPaymentServicesStateResponse {}
|
||||
/**
|
||||
* Retrieves the state of payment services.
|
||||
* @param {UseQueryOptions<GetPaymentServicesStateResponse, Error>} options
|
||||
* @returns {UseQueryResult<GetPaymentServicesStateResponse, Error>}
|
||||
*/
|
||||
export const useGetPaymentServicesState = (
|
||||
options?: UseQueryOptions<GetPaymentServicesStateResponse, Error>,
|
||||
): UseQueryResult<GetPaymentServicesStateResponse, Error> => {
|
||||
const apiRequest = useApiRequest();
|
||||
|
||||
return useQuery<GetPaymentServicesStateResponse, Error>(
|
||||
['PaymentServicesState'],
|
||||
() =>
|
||||
apiRequest
|
||||
.get('/payment-services/state')
|
||||
.then(
|
||||
(response) =>
|
||||
transformToCamelCase(
|
||||
response.data?.paymentServicesState,
|
||||
) as GetPaymentServicesStateResponse,
|
||||
),
|
||||
{
|
||||
...options,
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user