added bank payment api
This commit is contained in:
@@ -88,9 +88,15 @@ export function usePayIntlPayment() {
|
||||
const { t } = useTranslation();
|
||||
return useMutation({
|
||||
mutationFn: ({ id, payload }: { id: string; payload: PayPayload }) => intlPaymentApi.pay(id, payload),
|
||||
onSuccess: () => {
|
||||
onSuccess: (data) => {
|
||||
qc.invalidateQueries({ queryKey: INTL_PAYMENT_KEYS.lists() });
|
||||
toast.success(t("intlPayment.paySuccess", "Töleg üstünlikli amala aşyryldy"));
|
||||
if (data?.formUrl) {
|
||||
const newWindow = window.open(data.formUrl, "_blank");
|
||||
if (!newWindow || newWindow.closed || typeof newWindow.closed === "undefined") {
|
||||
window.location.href = data.formUrl;
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user