feat: add payment confirmation handling in LobbyScreen
This commit is contained in:
@@ -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.');
|
||||
|
||||
Reference in New Issue
Block a user