aligning logic to backend workflows

This commit is contained in:
2025-10-22 23:17:56 +02:00
parent 8237ed32a7
commit d8e3b88b3e
7 changed files with 151 additions and 25 deletions

View File

@@ -57,6 +57,7 @@ class ConfirmController extends ChangeNotifier {
model.isLoading = true;
notifyListeners();
// todo: find out if we still need to update these fields
transactionController
.model
.formData = transactionController.model.formData.copyWith(
@@ -66,11 +67,14 @@ class ConfirmController extends ChangeNotifier {
authType: transactionController.model.selectedPaymentProcessor.authType,
);
dynamic response = await http.post(
'/public/transaction/request',
transactionController.model.formData,
dynamic workflowResponse = await http.get(
'/public/transaction/request/'
'${transactionController.model.confirmationData['id']}/'
'${transactionController.model.selectedPaymentProcessor.authType}'
);
logger.i(response.toString());
logger.i(workflowResponse.toString());
dynamic response = workflowResponse['body'];
if (response['status'] != 'FAILED') {
model.status = response['status'];
@@ -133,4 +137,11 @@ class ConfirmController extends ChangeNotifier {
await Future.delayed(const Duration(seconds: 5));
}
}
@override
void dispose() {
// TODO: implement dispose
super.dispose();
model.isCancelled = true;
}
}