diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index cb1183ef..61b7eb59 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -660,27 +660,27 @@ class _AnicllaryOrdersState extends State with SingleTic service.applePayInsertRequest(applePayInsertRequest, context).then((res) async { if (res["MessageStatus"] == 1) { await context.read().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().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().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 with SingleTic createAdvancePayment(res, AppoitmentAllHistoryResultList appo) { DoctorsListService service = new DoctorsListService(); + + List 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) diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index 943f2112..54cdc11a 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -1476,7 +1476,7 @@ class DoctorsListService extends BaseService { Future HIS_createAdvancePayment(AppoitmentAllHistoryResultList appo, String projectID, double payedAmount, String paymentReference, String paymentMethodName, dynamic patientType, String patientName, dynamic patientID, BuildContext context, - {bool isAncillaryOrder = false, int clinicID = 0}) async { + {bool isAncillaryOrder = false, int clinicID = 0, dynamic orderNo, dynamic appointmentID, List selectedProcListAPI = const []}) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); @@ -1510,7 +1510,12 @@ class DoctorsListService extends BaseService { "PatientTypeID": patientType, "IsAncillaryOrder": isAncillaryOrder, // "AncillaryProcedureList": ancillaryOrdersProcedureList, - "PatientType": patientType + "PatientType": patientType, + "RequestAncillaryOrderInvoice": isAncillaryOrder + ? [ + {"MemberID": 102, "ProjectID": projectID, "AppointmentNo": appointmentID, "OrderNo": orderNo, "AncillaryOrderInvoiceProcList": selectedProcListAPI} + ] + : [], }; dynamic localRes; await baseAppClient.post(HIS_CREATE_ADVANCE_PAYMENT, onSuccess: (response, statusCode) async { @@ -1881,7 +1886,8 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future autoGenerateInvoiceERClinic(int? projectID, int? paymentMethod, String? paymentReferenceNo, num? amount, String? cardType, String? cardNumber, String? orderID, String? rrn, bool isAdvanceAvailable) async { + Future autoGenerateInvoiceERClinic( + int? projectID, int? paymentMethod, String? paymentReferenceNo, num? amount, String? cardType, String? cardNumber, String? orderID, String? rrn, bool isAdvanceAvailable) async { Map request; request = { "ProjectID": projectID, diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index ee68f743..6f61ac8a 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -38,9 +38,9 @@ class MyInAppBrowser extends InAppBrowser { static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE // static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS