|
|
|
|
@ -87,8 +87,9 @@ export const useFormSubmit = ({ onAddSuccess }: Props) => { |
|
|
|
|
const [errorMessage, setErrorMessage] = useState('') |
|
|
|
|
const [loader, setLoader] = useState(false) |
|
|
|
|
const dataHighlights = useRecoilValue(dataForPayHighlights) |
|
|
|
|
|
|
|
|
|
const { |
|
|
|
|
onConfirmationSuccessHiglights, |
|
|
|
|
onSuccessfulHighlights, |
|
|
|
|
onUnsuccessfulSubscription, |
|
|
|
|
} = useBuyMatchPopupStore() |
|
|
|
|
|
|
|
|
|
@ -189,7 +190,7 @@ export const useFormSubmit = ({ onAddSuccess }: Props) => { |
|
|
|
|
cardId: defaultCard?.id, |
|
|
|
|
order: { ...dataHighlights?.data }, |
|
|
|
|
}) |
|
|
|
|
.then(() => onConfirmationSuccessHiglights, onUnsuccessfulSubscription) |
|
|
|
|
.then(onSuccessfulHighlights, onUnsuccessfulSubscription) |
|
|
|
|
.catch(() => setErrorMessage(translate('error_payment_unsuccessful'))) |
|
|
|
|
.finally(() => setLoader(false)) |
|
|
|
|
return |
|
|
|
|
@ -234,7 +235,7 @@ export const useFormSubmit = ({ onAddSuccess }: Props) => { |
|
|
|
|
cardId: defaultCard.id, |
|
|
|
|
order: { ...dataHighlights?.data }, |
|
|
|
|
}) |
|
|
|
|
.then(() => onConfirmationSuccessHiglights, onUnsuccessfulSubscription) |
|
|
|
|
.then(onSuccessfulHighlights, onUnsuccessfulSubscription) |
|
|
|
|
.catch(() => setErrorMessage(translate('error_payment_unsuccessful'))) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|