minor fixes on status responses
This commit is contained in:
@@ -57,7 +57,7 @@ class GatewayController extends ChangeNotifier {
|
||||
|
||||
dynamic response = workflowResponse['body'];
|
||||
|
||||
model.status = response['status'];
|
||||
model.status = response['pollingStatus'];
|
||||
transactionController.model.paymentStatus = response['paymentStatus'];
|
||||
|
||||
finishLoading();
|
||||
@@ -83,7 +83,7 @@ class GatewayController extends ChangeNotifier {
|
||||
}
|
||||
|
||||
Future<ApiResponse<Map<String, dynamic>>> pollTransaction(String uid) async {
|
||||
// poll up to 30 times (~5 minutes at 10-second intervals)
|
||||
// poll up to 15 times (~45 seconds at 3-second intervals)
|
||||
int maxAttempts = 15;
|
||||
int attempt = 0;
|
||||
|
||||
@@ -100,12 +100,12 @@ class GatewayController extends ChangeNotifier {
|
||||
return result;
|
||||
}
|
||||
|
||||
await Future.delayed(const Duration(seconds: 10));
|
||||
await Future.delayed(const Duration(seconds: 3));
|
||||
if (model.isCancelled) break;
|
||||
|
||||
// Otherwise (e.g. PENDING), continue polling
|
||||
} else {
|
||||
await Future.delayed(const Duration(seconds: 10));
|
||||
await Future.delayed(const Duration(seconds: 3));
|
||||
if (model.isCancelled) break;
|
||||
|
||||
// Network error — show failure UI and stop
|
||||
|
||||
Reference in New Issue
Block a user