feat: add payment confirmation handling in LobbyScreen

This commit is contained in:
2025-12-20 23:16:07 +01:00
parent 1160c3a713
commit 88052b783a

View File

@@ -51,6 +51,15 @@ export default function LobbyScreen({ user, token, onLogout, onSelectTable, onRe
throw new Error(result.error.message);
}
const confirmation = await apiFetch('/api/wallet/confirm', token, {
method: 'POST',
body: JSON.stringify({ paymentIntentId: data.paymentIntentId })
});
if (confirmation.status !== 'succeeded') {
throw new Error('A fizetes meg nem teljesult.');
}
await onRefreshUser();
} catch (err) {
setDepositError(err.message || 'Nem sikerult a feltoltes.');