aligning logic to backend workflows
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user