feat: Edit Stripe payment settings

This commit is contained in:
Ahmed Bouhuolia
2024-09-22 14:55:48 +02:00
parent 3129c76c30
commit 3308133736
7 changed files with 120 additions and 4 deletions

View File

@@ -114,3 +114,24 @@ export const useUpdatePaymentMethod = (): UseMutationResult<
.then((response) => response.data),
);
};
interface GetPaymentMethodResponse {}
/**
* Retrieves a specific payment method.
* @param {number} paymentMethodId - The ID of the payment method.
* @returns {UseQueryResult<GetPaymentMethodResponse, Error>}
*/
export const useGetPaymentMethod = (
paymentMethodId: number,
): UseQueryResult<GetPaymentMethodResponse, Error> => {
const apiRequest = useApiRequest();
return useQuery<GetPaymentMethodResponse, Error>(
['paymentMethod', paymentMethodId],
() => apiRequest.get(`/payment-services/${paymentMethodId}`),
{
select: (data) =>
transformToCamelCase(data.data) as GetPaymentMethodResponse,
},
);
};