From 7850748ea2a4015af93f71615005ab98560fe819 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 22 Jan 2024 11:08:54 +0300 Subject: [PATCH 1/9] Dental updates --- lib/config/config.dart | 4 ++-- lib/pages/BookAppointment/DentalComplaints.dart | 8 +++++--- lib/pages/BookAppointment/DoctorProfile.dart | 4 +++- .../components/DocAvailableAppointments.dart | 5 +++-- lib/pages/BookAppointment/widgets/DoctorView.dart | 11 +++++++---- lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart | 2 +- lib/services/appointment_services/GetDoctorsList.dart | 5 +++-- lib/services/clinic_services/get_clinic_service.dart | 6 +++--- 8 files changed, 27 insertions(+), 18 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 5c5f984c..bc651005 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -21,8 +21,8 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:4422/'; -var BASE_URL = 'https://uat.hmgwebservices.com/'; -// var BASE_URL = 'https://hmgwebservices.com/'; +// var BASE_URL = 'https://uat.hmgwebservices.com/'; +var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'http://10.20.200.111:1010/'; // var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/'; diff --git a/lib/pages/BookAppointment/DentalComplaints.dart b/lib/pages/BookAppointment/DentalComplaints.dart index 487fbab4..67cd0215 100644 --- a/lib/pages/BookAppointment/DentalComplaints.dart +++ b/lib/pages/BookAppointment/DentalComplaints.dart @@ -118,6 +118,7 @@ class _DentalComplaintsState extends State { return DoctorView( doctor: doctor, isLiveCareAppointment: false, + isContinueDentalPlan: hasDentalPlan, ); }).toList(), )), @@ -146,8 +147,8 @@ class _DentalComplaintsState extends State { confirmMessage: TranslationBase.of(context).continuePlan, okText: TranslationBase.of(context).yes, cancelText: TranslationBase.of(context).no, - okFunction: () => {Navigator.of(context).pop(), continueDentalPlan()}, - cancelFunction: () => {getChiefComplaintsList()}); + okFunction: () => {Navigator.of(context).pop(), continueDentalPlan(), hasDentalPlan = true}, + cancelFunction: () => {getChiefComplaintsList(), hasDentalPlan = false}); dialog.showAlertDialog(context); } else { getChiefComplaintsList(); @@ -260,8 +261,9 @@ class _DentalComplaintsState extends State { int languageID = projectViewModel.isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); getLanguageID(); + hasDentalPlan = false; ClinicListService service = new ClinicListService(); - service.getChiefComplaintsList(widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, languageID, context).then((res) { + service.getChiefComplaintsList(widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, languageID, false, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { setState(() { diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index 1ad0bf67..9c44fabf 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -39,8 +39,9 @@ class DoctorProfile extends StatefulWidget { final bool isOpenAppt; bool isLiveCareAppointment; bool isDoctorNameSearch; + bool isContinueDentalPlan; - DoctorProfile({@required this.doctor, @required this.docProfileList, @required this.isLiveCareAppointment, this.isOpenAppt = false, this.isDoctorNameSearch = false}); + DoctorProfile({@required this.doctor, @required this.docProfileList, @required this.isLiveCareAppointment, this.isOpenAppt = false, this.isDoctorNameSearch = false, this.isContinueDentalPlan = false}); AuthenticatedUser authUser; @@ -203,6 +204,7 @@ class _DoctorProfileState extends State with TickerProviderStateM doctor: widget.doctor, isLiveCareAppointment: widget.isLiveCareAppointment, doctorSchedule: doctorSchedule, + isContinueDentalPlan: widget.isContinueDentalPlan, ), ], controller: _tabController, diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index 61e697f4..d1aaa1f5 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -27,10 +27,11 @@ class DocAvailableAppointments extends StatefulWidget { static String selectedDate; static String selectedTime; bool isLiveCareAppointment; + bool isContinueDentalPlan; final dynamic doctorSchedule; static int initialSlotDuration; - DocAvailableAppointments({@required this.doctor, this.doctorSchedule, @required this.isLiveCareAppointment}); + DocAvailableAppointments({@required this.doctor, this.doctorSchedule, @required this.isLiveCareAppointment, this.isContinueDentalPlan = false}); @override _DocAvailableAppointmentsState createState() => _DocAvailableAppointmentsState(); @@ -320,7 +321,7 @@ class _DocAvailableAppointmentsState extends State wit print(DocAvailableAppointments.initialSlotDuration); GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); - service.getDoctorFreeSlots(docObject.doctorID, docObject.clinicID, docObject.projectID, context, projectViewModel).then((res) { + service.getDoctorFreeSlots(docObject.doctorID, docObject.clinicID, docObject.projectID, widget.isContinueDentalPlan, context, projectViewModel).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { if (res['FreeTimeSlots'].length != 0) { diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index 6969302f..3e14a6fc 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -28,6 +28,7 @@ class DoctorView extends StatelessWidget { bool isObGyneAppointment; bool isShowFlag; bool isDoctorNameSearch; + bool isContinueDentalPlan; OBGyneProcedureListResponse obGyneProcedureListResponse; final VoidCallback onTap; @@ -36,6 +37,7 @@ class DoctorView extends StatelessWidget { @required this.isLiveCareAppointment, this.isObGyneAppointment = false, this.isDoctorNameSearch = false, + this.isContinueDentalPlan = false, this.isShowFlag = true, this.onTap, this.obGyneProcedureListResponse}); @@ -54,7 +56,7 @@ class DoctorView extends StatelessWidget { // showDentalChiefComplaintsList(context); // } else if (isShowFlag) { - getDoctorsProfile(context, doctor, isAppo: true); + getDoctorsProfile(context, doctor, isAppo: true, isContinueDentalPlan: isContinueDentalPlan); } (onTap ?? () {})(); // For log analytics of doctor click from book appointment } @@ -182,7 +184,7 @@ class DoctorView extends StatelessWidget { return docSpeciality; } - getDoctorsProfile(context, DoctorList docObject, {isAppo}) { + getDoctorsProfile(context, DoctorList docObject, {isAppo, bool isContinueDentalPlan = false}) { int languageID = projectViewModel.isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); List docProfileList = []; @@ -195,7 +197,7 @@ class DoctorView extends StatelessWidget { docProfileList.add(new DoctorProfileList.fromJson(v)); }); } else {} - navigateToDoctorProfile(context, docObject, docProfileList[0], isAppo: isAppo); + navigateToDoctorProfile(context, docObject, docProfileList[0], isAppo: isAppo, isContinueDentalPlan: isContinueDentalPlan); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } @@ -234,7 +236,7 @@ class DoctorView extends StatelessWidget { FadePage(page: ObGyneTimeSlots(projectID: doctor.projectID, selectedClinicID: doctor.clinicID, selectedDoctorID: doctor.doctorID, obGyneProcedureListResponse: obGyneProcedureListResponse))); } - Future navigateToDoctorProfile(context, docObject, docProfile, {isAppo}) async { + Future navigateToDoctorProfile(context, docObject, docProfile, {isAppo, bool isContinueDentalPlan = false}) async { Navigator.push( context, FadePage( @@ -244,6 +246,7 @@ class DoctorView extends StatelessWidget { docProfileList: docProfile, isOpenAppt: isAppo, isDoctorNameSearch: isDoctorNameSearch, + isContinueDentalPlan: isContinueDentalPlan, ), ), ); diff --git a/lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart b/lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart index 242a072f..0d02afe8 100644 --- a/lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart +++ b/lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart @@ -466,7 +466,7 @@ class _CovidTimeSlotsState extends State with TickerProviderSta getCovidFreeSlots(BuildContext context, int projectID) { DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); - service.getDoctorFreeSlots(widget.selectedDoctorID, widget.selectedClinicID, widget.projectID, context).then((res) { + service.getDoctorFreeSlots(widget.selectedDoctorID, widget.selectedClinicID, widget.projectID, false, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { if (res['FreeTimeSlots'].length != 0) { diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index d057dcbb..b85ec599 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -257,7 +257,7 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } - Future getDoctorFreeSlots(int docID, int clinicID, int projectID, BuildContext context, [ProjectViewModel projectViewModel]) async { + Future getDoctorFreeSlots(int docID, int clinicID, int projectID, bool isContinueDentalPlan, BuildContext context, [ProjectViewModel projectViewModel]) async { Map request; Request req = appGlobal.getPublicRequest(); @@ -277,7 +277,8 @@ class DoctorsListService extends BaseService { "SessionID": null, "isDentalAllowedBackend": false, "LanguageID": 1, - "DeviceTypeID": 1 + "DeviceTypeID": 1, + "ContinueDentalPlan": isContinueDentalPlan, }; if (clinicID == 253) { diff --git a/lib/services/clinic_services/get_clinic_service.dart b/lib/services/clinic_services/get_clinic_service.dart index 80032015..8b1098e6 100644 --- a/lib/services/clinic_services/get_clinic_service.dart +++ b/lib/services/clinic_services/get_clinic_service.dart @@ -61,7 +61,7 @@ class ClinicListService extends BaseService { return Future.value(localRes); } - Future getChiefComplaintsList(int clinicID, int projectID, int languageID, BuildContext context, {doctorId}) async { + Future getChiefComplaintsList(int clinicID, int projectID, int languageID, bool isContinueDentalPlan, BuildContext context, {doctorId}) async { //Utils.showProgressDialog(context); Map request; @@ -86,8 +86,8 @@ class ClinicListService extends BaseService { "SessionID": null, "isDentalAllowedBackend": true, "DeviceTypeID": 1, - "PatientID": 1, - "ContinueDentalPlan": true, + // "PatientID": 1, + "ContinueDentalPlan": isContinueDentalPlan, "IsSearchAppointmnetByClinicID": false, "DateofBirth": authUser.dateofBirth }; From 3792a67ae7246b1f4809cfea49e5bd644f694d77 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 23 Jan 2024 09:54:46 +0300 Subject: [PATCH 2/9] updates --- android/gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/gradle.properties b/android/gradle.properties index c5ccb9b6..73fec6d1 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,4 +1,4 @@ -org.gradle.jvmargs=-Xmx2048m +org.gradle.jvmargs=-Xmx4096m android.enableR8=true android.useAndroidX=true android.enableJetifier=true \ No newline at end of file From b4138b2066c719c955280cdac6e63f5429895fff Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 23 Jan 2024 18:13:01 +0300 Subject: [PATCH 3/9] Show Date check added in DoctorView --- lib/pages/BookAppointment/SearchResults.dart | 1 + .../BookAppointment/widgets/DoctorView.dart | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart index 3d95a694..d230f700 100644 --- a/lib/pages/BookAppointment/SearchResults.dart +++ b/lib/pages/BookAppointment/SearchResults.dart @@ -65,6 +65,7 @@ class _SearchResultsState extends State { isObGyneAppointment: widget.isObGyneAppointment, isDoctorNameSearch: widget.isDoctorNameSearch, obGyneProcedureListResponse: widget.obGyneProcedureListResponse, + isShowDate: false, onTap: () { projectViewModel.analytics.appointment.book_appointment_select_doctor(appointment_type: 'regular', doctor: doctor); }); diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index 3e14a6fc..7e1a7d53 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -31,6 +31,7 @@ class DoctorView extends StatelessWidget { bool isContinueDentalPlan; OBGyneProcedureListResponse obGyneProcedureListResponse; final VoidCallback onTap; + bool isShowDate; DoctorView( {@required this.doctor, @@ -39,6 +40,7 @@ class DoctorView extends StatelessWidget { this.isDoctorNameSearch = false, this.isContinueDentalPlan = false, this.isShowFlag = true, + this.isShowDate = true, this.onTap, this.obGyneProcedureListResponse}); @@ -55,7 +57,7 @@ class DoctorView extends StatelessWidget { // if (doctor.clinicID == 17 && isDoctorNameSearch) { // showDentalChiefComplaintsList(context); // } else - if (isShowFlag) { + if (isShowFlag) { getDoctorsProfile(context, doctor, isAppo: true, isContinueDentalPlan: isContinueDentalPlan); } (onTap ?? () {})(); // For log analytics of doctor click from book appointment @@ -89,10 +91,10 @@ class DoctorView extends StatelessWidget { style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16), ), ), - Text( + isShowDate ? Text( DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(doctor.date)), style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Color(0xff2B353E), letterSpacing: -0.48, height: 18 / 12), - ), + ) : Container(), ], ), if (doctor.doctorTitle != null) SizedBox(height: 6), @@ -171,9 +173,14 @@ class DoctorView extends StatelessWidget { searchInfo.hospital = selectedHospital; searchInfo.clinic = selectedClinic; - showDraggableDialog(context, DentalComplaints(isDoctorNameSearch: true, onSelectedMethod: () { - Navigator.pop(context); - }, searchInfo: searchInfo)); + showDraggableDialog( + context, + DentalComplaints( + isDoctorNameSearch: true, + onSelectedMethod: () { + Navigator.pop(context); + }, + searchInfo: searchInfo)); } String getDoctorSpeciality(List docSpecial) { From e28805f70f87da43645609ad7f050e7894c09944 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 24 Jan 2024 14:13:23 +0300 Subject: [PATCH 4/9] updates --- ios/Runner/Runner.entitlements | 4 ++++ lib/core/model/prescriptions/prescription_report_inp.dart | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ios/Runner/Runner.entitlements b/ios/Runner/Runner.entitlements index 44ce1b68..fbd726da 100644 --- a/ios/Runner/Runner.entitlements +++ b/ios/Runner/Runner.entitlements @@ -4,6 +4,10 @@ aps-environment development + com.apple.developer.associated-domains + + applinks:hmg.com + com.apple.developer.healthkit com.apple.developer.healthkit.access diff --git a/lib/core/model/prescriptions/prescription_report_inp.dart b/lib/core/model/prescriptions/prescription_report_inp.dart index b802337b..079b1bda 100644 --- a/lib/core/model/prescriptions/prescription_report_inp.dart +++ b/lib/core/model/prescriptions/prescription_report_inp.dart @@ -18,7 +18,7 @@ class PrescriptionReportINP { int days; String startDate; String orderDate; - int doseDailyQuantity; + num doseDailyQuantity; int itemID; Null productImage; String sKU; From 9043e3c687be72e796268a615373b70ec87033b5 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Thu, 25 Jan 2024 13:18:15 +0300 Subject: [PATCH 5/9] Apple Pay Updates --- lib/core/service/client/base_app_client.dart | 2 +- .../ancillary-orders/ancillaryOrdersDetails.dart | 12 +++++++++--- lib/pages/BookAppointment/BookSuccess.dart | 12 +++++++++--- lib/pages/ToDoList/ToDo.dart | 12 +++++++++--- lib/pages/livecare/widgets/clinic_list.dart | 12 +++++++++--- lib/pages/medical/balance/confirm_payment_page.dart | 12 +++++++++--- 6 files changed, 46 insertions(+), 16 deletions(-) diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 8818d6bb..e9fa657e 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -175,7 +175,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; //0560717232 - // body['PatientID'] = 1400563; //4609100 + // body['PatientID'] = 1374756; //4609100 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index 701fc269..66008a86 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -517,7 +517,11 @@ class _AnicllaryOrdersState extends State with SingleTic selectedPaymentMethod = method; this.selectedInstallmentPlan = selectedInstallmentPlan; if (selectedPaymentMethod == "ApplePay") { - startApplePay(); + if (projectViewModel.havePrivilege(103)) { + startApplePay(); + } else { + openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), null, selectedInstallmentPlan); + } } else { openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), null, selectedInstallmentPlan); } @@ -544,7 +548,8 @@ class _AnicllaryOrdersState extends State with SingleTic applePayInsertRequest.clientRequestID = transID; applePayInsertRequest.clinicID = 0; applePayInsertRequest.currency = projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR"; - applePayInsertRequest.customerEmail = projectViewModel.authenticatedUserObject.user.emailAddress; + // applePayInsertRequest.customerEmail = projectViewModel.authenticatedUserObject.user.emailAddress; + applePayInsertRequest.customerEmail = "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com"; applePayInsertRequest.customerID = projectViewModel.authenticatedUserObject.user.patientID; applePayInsertRequest.customerName = projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName; applePayInsertRequest.deviceToken = await AppSharedPreferences().getString(PUSH_TOKEN); @@ -584,7 +589,8 @@ class _AnicllaryOrdersState extends State with SingleTic service.applePayInsertRequest(applePayInsertRequest, context).then((res) async { await context.read().initiateApplePayWithPayfort( customerName: projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName, - customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, + // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, + customerEmail: "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com", orderDescription: "Ancillary Order Payment", orderAmount: double.parse(getTotalValue()), merchantReference: transID, diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index f6ece784..bf16e987 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -633,7 +633,11 @@ class _BookSuccessState extends State { selectedPaymentMethod = value[0]; if (value != null) { if (selectedPaymentMethod == "ApplePay") { - startApplePay(appo, patientShareResponse); + if (projectViewModel.havePrivilege(103)) { + startApplePay(appo, patientShareResponse); + } else { + openPayment(value, projectViewModel.user, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo); + } } else { openPayment(value, projectViewModel.user, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo); } @@ -658,7 +662,8 @@ class _BookSuccessState extends State { applePayInsertRequest.clientRequestID = transID; applePayInsertRequest.clinicID = appo.clinicID; applePayInsertRequest.currency = projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR"; - applePayInsertRequest.customerEmail = projectViewModel.authenticatedUserObject.user.emailAddress; + // applePayInsertRequest.customerEmail = projectViewModel.authenticatedUserObject.user.emailAddress; + applePayInsertRequest.customerEmail = "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com"; applePayInsertRequest.customerID = projectViewModel.authenticatedUserObject.user.patientID; applePayInsertRequest.customerName = projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName; applePayInsertRequest.deviceToken = await AppSharedPreferences().getString(PUSH_TOKEN); @@ -698,7 +703,8 @@ class _BookSuccessState extends State { service.applePayInsertRequest(applePayInsertRequest, context).then((res) async { await context.read().initiateApplePayWithPayfort( customerName: projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName, - customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, + // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, + customerEmail: "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com", orderDescription: "Appointment Payment", orderAmount: double.parse(patientShareResponse.patientShareWithTax.toString()), merchantReference: transID, diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 771a6557..bbd7d579 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -1310,7 +1310,11 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { if (value != null) { final appType = appo.isLiveCareAppointment ? 'livecare' : 'regular'; if (selectedPaymentMethod == "ApplePay") { - startApplePay(appo, patientShareResponse); + if (projectViewModel.havePrivilege(103)) { + startApplePay(appo, patientShareResponse); + } else { + openPayment(value, projectViewModel.user, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo); + } } else { openPayment(value, projectViewModel.user, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo); } @@ -1335,7 +1339,8 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { applePayInsertRequest.clientRequestID = transID; applePayInsertRequest.clinicID = appo.clinicID; applePayInsertRequest.currency = projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR"; - applePayInsertRequest.customerEmail = projectViewModel.authenticatedUserObject.user.emailAddress; + // applePayInsertRequest.customerEmail = projectViewModel.authenticatedUserObject.user.emailAddress; + applePayInsertRequest.customerEmail = "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com"; applePayInsertRequest.customerID = projectViewModel.authenticatedUserObject.user.patientID; applePayInsertRequest.customerName = projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName; applePayInsertRequest.deviceToken = await AppSharedPreferences().getString(PUSH_TOKEN); @@ -1375,7 +1380,8 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { service.applePayInsertRequest(applePayInsertRequest, context).then((res) async { await context.read().initiateApplePayWithPayfort( customerName: projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName, - customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, + // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, + customerEmail: "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com", orderDescription: "Appointment Payment", orderAmount: double.parse(patientShareResponse.patientShareWithTax.toString()), merchantReference: transID, diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index f0beb79b..faff8c98 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -336,7 +336,11 @@ class _clinic_listState extends State { widget.pharmacyLiveCareQRCode = pharmaLiveCareQRCodeValue; if (value != null) { if (selectedPaymentMethod == "ApplePay") { - startApplePay(appo, getERAppointmentFeesList.total); + if (projectViewModel.havePrivilege(103)) { + startApplePay(appo, getERAppointmentFeesList.total); + } else { + openPayment(value, authUser, num.parse(getERAppointmentFeesList.total), appo); + } } else { openPayment(value, authUser, num.parse(getERAppointmentFeesList.total), appo); } @@ -366,7 +370,8 @@ class _clinic_listState extends State { applePayInsertRequest.clientRequestID = transID; applePayInsertRequest.clinicID = appo.clinicID; applePayInsertRequest.currency = projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR"; - applePayInsertRequest.customerEmail = projectViewModel.authenticatedUserObject.user.emailAddress; + // applePayInsertRequest.customerEmail = projectViewModel.authenticatedUserObject.user.emailAddress; + applePayInsertRequest.customerEmail = "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com"; applePayInsertRequest.customerID = projectViewModel.authenticatedUserObject.user.patientID; applePayInsertRequest.customerName = projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName; applePayInsertRequest.deviceToken = await AppSharedPreferences().getString(PUSH_TOKEN); @@ -406,7 +411,8 @@ class _clinic_listState extends State { service.applePayInsertRequest(applePayInsertRequest, localContext).then((res) async { await localContext.read().initiateApplePayWithPayfort( customerName: projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName, - customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, + // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, + customerEmail: "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com", orderDescription: "LiveCare Payment", orderAmount: double.parse(amount), merchantReference: transID, diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index 8a70c6f9..e63264a4 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -221,7 +221,11 @@ class _ConfirmPaymentPageState extends State { () async { if (widget.advanceModel.fileNumber == projectViewModel.user.patientID.toString()) { if (widget.selectedPaymentMethod == "ApplePay") { - startApplePay(); + if (projectViewModel.havePrivilege(103)) { + startApplePay(); + } else { + openPayment(widget.selectedPaymentMethod, widget.authenticatedUser, double.parse(widget.advanceModel.amount), AppoitmentAllHistoryResultList()); + } } else { openPayment(widget.selectedPaymentMethod, widget.authenticatedUser, double.parse(widget.advanceModel.amount), AppoitmentAllHistoryResultList()); } @@ -260,7 +264,8 @@ class _ConfirmPaymentPageState extends State { applePayInsertRequest.clientRequestID = transID; applePayInsertRequest.clinicID = 0; applePayInsertRequest.currency = projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR"; - applePayInsertRequest.customerEmail = projectViewModel.authenticatedUserObject.user.emailAddress; + // applePayInsertRequest.customerEmail = projectViewModel.authenticatedUserObject.user.emailAddress; + applePayInsertRequest.customerEmail = "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com"; applePayInsertRequest.customerID = projectViewModel.authenticatedUserObject.user.patientID; applePayInsertRequest.customerName = projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName; applePayInsertRequest.deviceToken = await AppSharedPreferences().getString(PUSH_TOKEN); @@ -300,7 +305,8 @@ class _ConfirmPaymentPageState extends State { service.applePayInsertRequest(applePayInsertRequest, context).then((res) async { await context.read().initiateApplePayWithPayfort( customerName: projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName, - customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, + // customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, + customerEmail: "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com", orderDescription: "Advance Payment", orderAmount: double.parse(widget.advanceModel.amount), merchantReference: transID, From ccdf410995c58abfc51e2f0139bdbace0e4bafc2 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 28 Jan 2024 11:12:01 +0300 Subject: [PATCH 6/9] Update to stores --- ios/Runner.xcodeproj/project.pbxproj | 6 +++--- pubspec.yaml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index db84daa7..0067c96b 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -540,7 +540,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.77; + MARKETING_VERSION = 4.5.81; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -684,7 +684,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.77; + MARKETING_VERSION = 4.5.81; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -722,7 +722,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.77; + MARKETING_VERSION = 4.5.81; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/pubspec.yaml b/pubspec.yaml index 53c72f22..e346f37c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.79+1 +version: 4.5.044+4050044 environment: sdk: ">=2.7.0 <3.0.0" From 30b57ff5f034d2cb118205ea253b697f82eaf060 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 29 Jan 2024 09:09:20 +0300 Subject: [PATCH 7/9] updates --- apple-app-site-association.json | 11 +++++++++++ assetlinks.json | 26 ++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 apple-app-site-association.json create mode 100644 assetlinks.json diff --git a/apple-app-site-association.json b/apple-app-site-association.json new file mode 100644 index 00000000..3c3a8b7e --- /dev/null +++ b/apple-app-site-association.json @@ -0,0 +1,11 @@ +{ + "applinks": { + "apps": [], + "details": [ + { + "appID": "3A359E86ZF.com.HMG.HMG-Smartphone", + "paths": ["*"] + } + ] + } + } \ No newline at end of file diff --git a/assetlinks.json b/assetlinks.json new file mode 100644 index 00000000..d68ca550 --- /dev/null +++ b/assetlinks.json @@ -0,0 +1,26 @@ +[ + { + "relation": [ + "delegate_permission/common.handle_all_urls" + ], + "target": { + "namespace": "android_app", + "package_name": "com.ejada.hmg", + "sha256_cert_fingerprints": [ + "57:EA:97:F9:C2:03:52:83:C1:13:E7:D9:9E:AD:55:B3:77:07:C5:14:6C:AA:1E:C8:70:24:73:DD:7F:25:A8:7B" + ] + } + }, + { + "relation": [ + "delegate_permission/common.handle_all_urls" + ], + "target": { + "namespace": "android_app", + "package_name": "com.ejada.hmg", + "sha256_cert_fingerprints": [ + "10:AC:36:05:DD:D5:63:3F:FF:0D:88:C3:9C:92:F1:12:1D:EE:1A:A8:4D:0C:85:AE:6C:B9:A9:C0:0C:7F:03:B5" + ] + } + } +] \ No newline at end of file From cb79d625d1a20d399561283e7dd6f800f9f72da0 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 29 Jan 2024 12:21:25 +0300 Subject: [PATCH 8/9] Update to stores for LiveCare fix --- ios/Runner.xcodeproj/project.pbxproj | 6 +++--- lib/config/config.dart | 2 +- lib/pages/BookAppointment/BookSuccess.dart | 2 +- lib/pages/ToDoList/ToDo.dart | 2 +- lib/pages/livecare/widgets/clinic_list.dart | 12 ++++++------ lib/uitl/utils.dart | 5 +++-- pubspec.yaml | 2 +- 7 files changed, 16 insertions(+), 15 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 0067c96b..70c9bd9b 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -540,7 +540,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.81; + MARKETING_VERSION = 4.5.82; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -684,7 +684,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.81; + MARKETING_VERSION = 4.5.82; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -722,7 +722,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.81; + MARKETING_VERSION = 4.5.82; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/lib/config/config.dart b/lib/config/config.dart index bc651005..09255501 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -343,7 +343,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 12.0; +var VERSION_ID = 12.1; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index bf16e987..810f977b 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -677,7 +677,7 @@ class _BookSuccessState extends State { applePayInsertRequest.patientOutSA = projectViewModel.authenticatedUserObject.user.outSA; applePayInsertRequest.appointmentDate = appo.appointmentDate; applePayInsertRequest.appointmentNo = appo.appointmentNo; - applePayInsertRequest.orderDescription = "Advance Payment"; + applePayInsertRequest.orderDescription = "Appointment Payment"; applePayInsertRequest.liveServiceID = "0"; applePayInsertRequest.latitude = "0.0"; applePayInsertRequest.longitude = "0.0"; diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index bbd7d579..37161678 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -1354,7 +1354,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { applePayInsertRequest.patientOutSA = projectViewModel.authenticatedUserObject.user.outSA; applePayInsertRequest.appointmentDate = appo.appointmentDate; applePayInsertRequest.appointmentNo = appo.appointmentNo; - applePayInsertRequest.orderDescription = "Advance Payment"; + applePayInsertRequest.orderDescription = "Appointment Payment"; applePayInsertRequest.liveServiceID = "0"; applePayInsertRequest.latitude = "0.0"; applePayInsertRequest.longitude = "0.0"; diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index faff8c98..0e1ba5aa 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -352,7 +352,7 @@ class _clinic_listState extends State { void startApplePay(AppoitmentAllHistoryResultList appo, String amount) async { try { - transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo); + transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo, isAddMilliseconds: false); print("TransactionID: $transID"); GifLoaderDialogUtils.showMyDialog(localContext); @@ -445,7 +445,7 @@ class _clinic_listState extends State { openPayment(List paymentMethod, AuthenticatedUser authenticatedUser, num amount, AppoitmentAllHistoryResultList appo) { browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context); - transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo); + transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo, isAddMilliseconds: false); selectedPaymentMethod = paymentMethod[0]; selectedInstallmentPlan = paymentMethod[1]; this.amount = amount.toString(); @@ -491,7 +491,7 @@ class _clinic_listState extends State { print("onBrowserExit Called!!!!"); try { if (selectedPaymentMethod == "TAMARA") { - checkTamaraPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), appo); + checkTamaraPaymentStatus(transID, appo); // if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") { // updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallmentPlan), appo); // } else { @@ -515,7 +515,7 @@ class _clinic_listState extends State { updateTamaraRequestStatus("success", "14", orderID, tamaraOrderID, num.parse(selectedInstallmentPlan), appo); } else { updateTamaraRequestStatus( - "Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallmentPlan), appo); + "Failed", "00", transID, tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallmentPlan), appo); } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); @@ -532,7 +532,7 @@ class _clinic_listState extends State { service.updateTamaraRequestStatus(responseMessage, status, clientRequestID, tamaraOrderID, selectedInstallments).then((res) { GifLoaderDialogUtils.hideDialog(context); if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") { - addNewCallForPatientER(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo)); + addNewCallForPatientER(transID); } else { AppToast.showErrorToast(message: res['Response_Message']); projectViewModel.analytics.liveCare.livecare_immediate_consultation_payment_failed( @@ -565,7 +565,7 @@ class _clinic_listState extends State { amount = res['Amount'].toString(); payment_method = res['PaymentMethod']; if (paymentInfo == 'Success') { - addNewCallForPatientER(widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode : Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo)); + addNewCallForPatientER(widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode : transID); } else { AppToast.showErrorToast(message: res['Response_Message']); projectViewModel.analytics.liveCare.livecare_immediate_consultation_payment_failed( diff --git a/lib/uitl/utils.dart b/lib/uitl/utils.dart index 050badb9..d93cec9b 100644 --- a/lib/uitl/utils.dart +++ b/lib/uitl/utils.dart @@ -153,8 +153,9 @@ class Utils { } } - static String getAppointmentTransID(int projectID, int clinicID, int appoNo) { - return projectID.toString() + '-' + clinicID.toString() + '-' + appoNo.toString() + '-' + DateTime.now().millisecondsSinceEpoch.toString(); + static String getAppointmentTransID(int projectID, int clinicID, int appoNo, {bool isAddMilliseconds = true}) { + String currentMillis = DateTime.now().millisecondsSinceEpoch.toString(); + return projectID.toString() + '-' + clinicID.toString() + '-' + appoNo.toString() + (isAddMilliseconds ? '-' + currentMillis.substring(currentMillis.length - 5, currentMillis.length) : ""); } static String getAdvancePaymentTransID(int projectID, int fileNumber) { diff --git a/pubspec.yaml b/pubspec.yaml index e346f37c..2a44171b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.044+4050044 +version: 4.5.046+4050046 environment: sdk: ">=2.7.0 <3.0.0" From 180cc437053aa3fb65df18dd1f601c3e179f2f8b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 30 Jan 2024 09:41:21 +0300 Subject: [PATCH 9/9] Update to stores --- SmsOtpAutoVerifyPlugin.kt | 216 +++++++++++++++++++ android/build.gradle | 2 +- ios/Runner.xcodeproj/project.pbxproj | 6 +- lib/config/config.dart | 2 +- lib/pages/ToDoList/ToDo.dart | 2 +- lib/pages/livecare/widgets/clinic_list.dart | 2 +- lib/widgets/in_app_browser/InAppBrowser.dart | 4 +- lib/widgets/otp/sms-popup.dart | 2 +- pubspec.yaml | 2 +- 9 files changed, 227 insertions(+), 11 deletions(-) create mode 100644 SmsOtpAutoVerifyPlugin.kt diff --git a/SmsOtpAutoVerifyPlugin.kt b/SmsOtpAutoVerifyPlugin.kt new file mode 100644 index 00000000..a6fafd90 --- /dev/null +++ b/SmsOtpAutoVerifyPlugin.kt @@ -0,0 +1,216 @@ +package com.oohyugi.sms_otp_auto_verify + +import android.app.Activity +import android.app.PendingIntent +import android.content.Context +import android.content.Intent + +import android.content.IntentFilter +import android.content.IntentSender +import android.os.Build +import android.telephony.TelephonyManager +import android.util.Log +import androidx.annotation.RequiresApi +import com.google.android.gms.auth.api.credentials.Credential +import io.flutter.plugin.common.MethodCall +import io.flutter.plugin.common.MethodChannel +import io.flutter.plugin.common.MethodChannel.MethodCallHandler; +import com.google.android.gms.auth.api.phone.SmsRetriever; +import com.google.android.gms.auth.api.phone.SmsRetrieverClient +import io.flutter.embedding.engine.plugins.FlutterPlugin +import io.flutter.embedding.engine.plugins.activity.ActivityAware +import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding +import io.flutter.plugin.common.BinaryMessenger +import io.flutter.plugin.common.PluginRegistry +import com.google.android.gms.auth.api.credentials.Credentials +import com.google.android.gms.auth.api.credentials.HintRequest +import io.flutter.plugin.common.PluginRegistry.Registrar +import androidx.core.content.ContextCompat +import androidx.core.content.ContextCompat.RECEIVER_EXPORTED + + +/** SmsOtpAutoVerifyPlugin */ +class SmsOtpAutoVerifyPlugin : FlutterPlugin, MethodCallHandler, + MySmsListener, ActivityAware { + private var channel: MethodChannel? = null + private var pendingResult: MethodChannel.Result? = null + private var receiver: SmsBroadcastReceiver? = null + private var alreadyCalledSmsRetrieve = false + private var client: SmsRetrieverClient? = null + private var activity: Activity? = null + private var binding: ActivityPluginBinding? = null + + private val activityResultListener: PluginRegistry.ActivityResultListener = + object : PluginRegistry.ActivityResultListener { + override fun onActivityResult( + requestCode: Int, + resultCode: Int, + data: Intent? + ): Boolean { + if (requestCode == REQUEST_RESOLVE_HINT) { + if (resultCode == Activity.RESULT_OK && data != null) { + val credential: Credential? = data.getParcelableExtra(Credential.EXTRA_KEY) + val phoneNumber: String? = credential?.id + pendingResult?.success(phoneNumber) + } else { + pendingResult?.success(null) + } + return true + } + return false + } + } + + companion object { + private const val channelName = "sms_otp_auto_verify" + private const val REQUEST_RESOLVE_HINT = 1256 + + @JvmStatic + fun setup(plugin: SmsOtpAutoVerifyPlugin, binaryMessenger: BinaryMessenger) { + plugin.channel = MethodChannel(binaryMessenger, channelName) + plugin.channel?.setMethodCallHandler(plugin) + plugin.binding?.addActivityResultListener(plugin.activityResultListener) + + } + } + + + override fun onAttachedToEngine(binding: FlutterPlugin.FlutterPluginBinding) { + setup(plugin = this, binding.binaryMessenger) + } + + override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) { + unregister() + } + + @RequiresApi(Build.VERSION_CODES.O) + override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) { + when (call.method) { + "getAppSignature" -> { + activity?.let { + val signature = AppSignatureHelper(it).getAppSignatures()[0] + result.success(signature) + } + + } + + "startListening" -> { + this.pendingResult = result + receiver = SmsBroadcastReceiver() + startListening() + + } + + "stopListening" -> { + pendingResult = null + unregister() + } + + "requestPhoneHint" -> { + this.pendingResult = result + requestHint() + + } + + else -> result.notImplemented() + } + } + + private fun requestHint() { + if (!isSimSupport()) { + pendingResult?.success(null) + return + } + + val hintRequest = HintRequest.Builder() + .setPhoneNumberIdentifierSupported(true) + .build() + + activity?.apply { + val intent = Credentials.getClient(this).getHintPickerIntent(hintRequest) + try { + startIntentSenderForResult( + intent.intentSender, + REQUEST_RESOLVE_HINT, null, 0, 0, 0 + ) + } catch (e: IntentSender.SendIntentException) { + e.printStackTrace() + } + } + } + + private fun isSimSupport(): Boolean { + val telephonyManager: TelephonyManager = + activity!!.getSystemService(Context.TELEPHONY_SERVICE) as TelephonyManager + return (telephonyManager.simState == TelephonyManager.SIM_STATE_ABSENT) + } + + @RequiresApi(Build.VERSION_CODES.O) + private fun startListening() { + activity?.let { + client = SmsRetriever.getClient(it) + } + val task = client?.startSmsRetriever() + task?.addOnSuccessListener { + // Successfully started retriever, expect broadcast intent + unregister() + Log.e(javaClass::getSimpleName.name, "task started") + receiver?.setSmsListener(this) + + activity?.applicationContext?.let { it1 -> + ContextCompat.registerReceiver( + it1, receiver, + IntentFilter(SmsRetriever.SMS_RETRIEVED_ACTION), RECEIVER_EXPORTED) + } + } + } + + private fun unregister() { + alreadyCalledSmsRetrieve = false + if (receiver != null) { + try { + activity?.unregisterReceiver(receiver) + Log.d(javaClass::getSimpleName.name, "task stoped") + receiver = null + } catch (e: Exception) { + } + } + } + + override fun onOtpReceived(message: String?) { + message?.let { + if (!alreadyCalledSmsRetrieve) { + pendingResult?.success(it) + alreadyCalledSmsRetrieve = true + } else { + Log.d("onOtpReceived: ", "already called") + } + } + + } + + override fun onOtpTimeout() { + } + + + override fun onAttachedToActivity(binding: ActivityPluginBinding) { + activity = binding.activity + this.binding = binding + binding.addActivityResultListener(activityResultListener); } + + override fun onDetachedFromActivityForConfigChanges() { + unregister() + } + + override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) { + activity = binding.activity + this.binding = binding + binding.addActivityResultListener(activityResultListener); + } + + override fun onDetachedFromActivity() { + unregister() + } + + +} diff --git a/android/build.gradle b/android/build.gradle index e723adba..78038517 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.7.20' + ext.kotlin_version = '1.8.0' repositories { google() jcenter() diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 70c9bd9b..1514bc24 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -540,7 +540,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.82; + MARKETING_VERSION = 4.5.84; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -684,7 +684,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.82; + MARKETING_VERSION = 4.5.84; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -722,7 +722,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.5.82; + MARKETING_VERSION = 4.5.84; PRODUCT_BUNDLE_IDENTIFIER = "com.HMG.HMG-Smartphone"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/lib/config/config.dart b/lib/config/config.dart index 09255501..e7013cf6 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -343,7 +343,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 12.1; +var VERSION_ID = 12.3; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 37161678..d16c6579 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -1282,7 +1282,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { DoctorsListService service = new DoctorsListService(); service .insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate, - Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), projectViewModel.isArabic ? 1 : 2, context) + transID, projectViewModel.isArabic ? 1 : 2, context) .then((res) { GifLoaderDialogUtils.hideDialog(context); getPatientAppointmentHistory(); diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 0e1ba5aa..1dbf72e4 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -386,7 +386,7 @@ class _clinic_listState extends State { applePayInsertRequest.appointmentDate = appo.appointmentDate; applePayInsertRequest.appointmentNo = appo.appointmentNo; applePayInsertRequest.orderDescription = "LiveCare Payment"; - applePayInsertRequest.liveServiceID = "0"; + applePayInsertRequest.liveServiceID = selectedClinicID.toString(); applePayInsertRequest.latitude = "0.0"; applePayInsertRequest.longitude = "0.0"; applePayInsertRequest.amount = amount; diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index c9fecbf9..c71b206b 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -40,9 +40,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 diff --git a/lib/widgets/otp/sms-popup.dart b/lib/widgets/otp/sms-popup.dart index 64c981b2..d1affc14 100644 --- a/lib/widgets/otp/sms-popup.dart +++ b/lib/widgets/otp/sms-popup.dart @@ -103,7 +103,7 @@ class SMSOTP { startTimer(setState); // startLister(); - if (Platform.isAndroid) checkSignature(); + if (Platform.isAndroid && type == 1) checkSignature(); } return Container( diff --git a/pubspec.yaml b/pubspec.yaml index 2a44171b..addd6356 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.046+4050046 +version: 4.5.84+1 environment: sdk: ">=2.7.0 <3.0.0"