fix: support method query param fallback for external browser redirects

When payment providers redirect to external browser, sessionStorage is
unavailable. TopUpResult now reads method from URL query params and
polls via /latest endpoint as fallback.
This commit is contained in:
Fringg
2026-03-09 04:34:37 +03:00
parent 8897561fb2
commit 7ce5341e95
2 changed files with 58 additions and 15 deletions

View File

@@ -114,6 +114,14 @@ export const balanceApi = {
return response.data;
},
// Get latest pending payment by method (fallback when sessionStorage unavailable)
getLatestPayment: async (method: string): Promise<PendingPayment> => {
const response = await apiClient.get<PendingPayment>(
`/cabinet/balance/pending-payments/${encodeURIComponent(method)}/latest`,
);
return response.data;
},
// Manually check payment status
checkPaymentStatus: async (method: string, paymentId: number): Promise<ManualCheckResponse> => {
const response = await apiClient.post<ManualCheckResponse>(