|
|
|
|
@ -660,27 +660,27 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
|
|
|
|
|
service.applePayInsertRequest(applePayInsertRequest, context).then((res) async {
|
|
|
|
|
if (res["MessageStatus"] == 1) {
|
|
|
|
|
await context.read<PayfortViewModel>().initiateApplePayWithPayfort(
|
|
|
|
|
customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!,
|
|
|
|
|
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
|
|
|
|
|
customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com",
|
|
|
|
|
orderDescription: "Ancillary Order Payment",
|
|
|
|
|
orderAmount: double.parse(getTotalValue()),
|
|
|
|
|
merchantReference: transID,
|
|
|
|
|
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
|
|
|
|
|
currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR",
|
|
|
|
|
onFailed: (failureResult) async {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
log("failureResult: ${failureResult.toString()}");
|
|
|
|
|
AppToast.showErrorToast(message: failureResult.toString());
|
|
|
|
|
},
|
|
|
|
|
onSuccess: (successResult) async {
|
|
|
|
|
log("Payfort: ${successResult.responseMessage}");
|
|
|
|
|
await context.read<PayfortViewModel>().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult);
|
|
|
|
|
checkPaymentStatus(AppoitmentAllHistoryResultList());
|
|
|
|
|
},
|
|
|
|
|
projectId: widget.projectID,
|
|
|
|
|
serviceTypeEnum: ServiceTypeEnum.ancillaryOrder,
|
|
|
|
|
);
|
|
|
|
|
customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!,
|
|
|
|
|
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
|
|
|
|
|
customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com",
|
|
|
|
|
orderDescription: "Ancillary Order Payment",
|
|
|
|
|
orderAmount: double.parse(getTotalValue()),
|
|
|
|
|
merchantReference: transID,
|
|
|
|
|
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
|
|
|
|
|
currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR",
|
|
|
|
|
onFailed: (failureResult) async {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
log("failureResult: ${failureResult.toString()}");
|
|
|
|
|
AppToast.showErrorToast(message: failureResult.toString());
|
|
|
|
|
},
|
|
|
|
|
onSuccess: (successResult) async {
|
|
|
|
|
log("Payfort: ${successResult.responseMessage}");
|
|
|
|
|
await context.read<PayfortViewModel>().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult);
|
|
|
|
|
checkPaymentStatus(AppoitmentAllHistoryResultList());
|
|
|
|
|
},
|
|
|
|
|
projectId: widget.projectID,
|
|
|
|
|
serviceTypeEnum: ServiceTypeEnum.ancillaryOrder,
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
AppToast.showErrorToast(message: "An error occurred while processing your request");
|
|
|
|
|
@ -819,10 +819,20 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
|
|
|
|
|
|
|
|
|
|
createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
|
|
|
|
|
|
List<dynamic> selectedProcListAPI = [];
|
|
|
|
|
selectedProcList.forEach((element) {
|
|
|
|
|
selectedProcListAPI.add({
|
|
|
|
|
"ApprovalLineItemNo": element.approvalLineItemNo,
|
|
|
|
|
"OrderLineItemNo": element.orderLineItemNo,
|
|
|
|
|
"ProcedureID": element.procedureID,
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
String paymentReference = res['Fort_id'].toString();
|
|
|
|
|
service.HIS_createAdvancePayment(appo, widget.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], projectViewModel.user.patientType,
|
|
|
|
|
projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!, projectViewModel.user.patientID, localContext,
|
|
|
|
|
isAncillaryOrder: true)
|
|
|
|
|
isAncillaryOrder: true, orderNo: widget.orderNo, appointmentID: widget.appoNo, selectedProcListAPI: selectedProcListAPI)
|
|
|
|
|
.then((res) {
|
|
|
|
|
addAdvancedNumberRequest(
|
|
|
|
|
Utils.isVidaPlusProject(projectViewModel, widget.projectID)
|
|
|
|
|
|