fixed pay dialog flow

This commit is contained in:
Jelaletdin12
2026-09-25 21:14:38 +05:00
parent 6ccda86eff
commit 9e2a2606c9
6 changed files with 139 additions and 76 deletions

View File

@@ -111,3 +111,22 @@ export function useCheckIntlPaymentStatus() {
},
});
}
export function useCheckIntlPaymentCallback() {
const qc = useQueryClient();
return useMutation({
mutationFn: (paymentId: number) => intlPaymentApi.callback(paymentId),
onSuccess: () => {
qc.invalidateQueries({ queryKey: INTL_PAYMENT_KEYS.lists() });
},
});
}
export function useIntlPaymentCallback(paymentId: number | null) {
return useQuery({
queryKey: [...INTL_PAYMENT_KEYS.all, "callback", paymentId] as const,
queryFn: () => intlPaymentApi.callback(paymentId!),
enabled: paymentId !== null,
retry: false,
});
}