orderPendingApi method
Implementation
Future<PaymentPendingResponse?> orderPendingApi(
{required int entityId}) async {
String requestTime = "";
String responseTime = "";
try {
Helper.progressDialog(Get.context!, "");
PaymentPendingResponse model = await ApiClient(
baseUrl: ApiConstant.posBaseUrl,
receiveTimeout: Constants.defaultSubmitTimeout,
connectTimeout: Constants.defaultSubmitTimeout,
onFetchRequestTime: (time) {
requestTime = time;
},
onFetchResponseTime: (time) {
responseTime = time;
},
screenName: "stockOrderScreen",
).getOrderPending(
entityId: entityId,
entityType: "DEALER", // DEALER / STORE
paymentPendingValidate: true,
);
Helper.close();
if ((model.status ?? "").trim() == "POS200") {
validationResults.value = model.data?.validationResults ?? [];
Helper.logEvent(
"RESPONSE_EVENT",
success: true,
endPoint: Api.orderPending,
responseDate: responseTime,
screenName: "stockOrderScreen",
requestDate: requestTime,
);
return model;
}
} catch (err, stacktrace) {
Helper.close();
ConditionalLogs().customLog("$err");
ConditionalLogs().customLog("$stacktrace");
}
return null;
}