mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 17:43:47 +00:00
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:
@@ -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>(
|
||||
|
||||
Reference in New Issue
Block a user