diff --git a/lib/config/config.dart b/lib/config/config.dart index ec7f6255..f050011f 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,8 +20,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:3334/'; - 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/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart index fc2d5ecc..1dd34876 100644 --- a/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart +++ b/lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart @@ -484,7 +484,7 @@ class _AnicllaryOrdersState extends State with SingleTic onSelectedMethod: (String method, [String selectedInstallmentPlan]) { selectedPaymentMethod = method; this.selectedInstallmentPlan = selectedInstallmentPlan; - openPayment(selectedPaymentMethod, projectViewModel.authenticatedUserObject.user, double.parse(getTotalValue()), null, model, selectedInstallmentPlan); + openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), null, model, selectedInstallmentPlan); }, patientShare: double.parse(getTotalValue()), isFromAdvancePayment: !projectViewModel.havePrivilege(94), @@ -494,18 +494,18 @@ class _AnicllaryOrdersState extends State with SingleTic openPayment(String paymentMethod, AuthenticatedUser authenticatedUser, num amount, AppoitmentAllHistoryResultList appo, AnciallryOrdersViewModel model, [String selectedInstallmentPlan]) { browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart); - transID = Utils.getAdvancePaymentTransID(widget.projectID, projectViewModel.authenticatedUserObject.user.patientID); + transID = Utils.getAdvancePaymentTransID(widget.projectID, projectViewModel.user.patientID); browser.openPaymentBrowser( amount, "Ancillary Orders Payment", transID, widget.projectID.toString(), - projectViewModel.authenticatedUserObject.user.emailAddress, + projectViewModel.user.emailAddress, paymentMethod, - projectViewModel.authenticatedUserObject.user.patientType, - projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName, - projectViewModel.authenticatedUserObject.user.patientID, + projectViewModel.user.patientType, + projectViewModel.user.firstName + " " + projectViewModel.user.lastName, + projectViewModel.user.patientID, authenticatedUser, browser, false, @@ -628,9 +628,9 @@ class _AnicllaryOrdersState extends State with SingleTic res['Amount'], res['Fort_id'], res['PaymentMethod'], - projectViewModel.authenticatedUserObject.user.patientType, - projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName, - projectViewModel.authenticatedUserObject.user.patientID, + projectViewModel.user.patientType, + projectViewModel.user.firstName + " " + projectViewModel.user.lastName, + projectViewModel.user.patientID, localContext) .then((res) { addAdvancedNumberRequest(res['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), paymentReference, 0, appo); diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index 98f370ba..890b96d8 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -46,7 +46,7 @@ class BookSuccess extends StatefulWidget { class _BookSuccessState extends State { AppSharedPreferences sharedPref = AppSharedPreferences(); - AuthenticatedUser authUser; + // AuthenticatedUser authUser; ProjectViewModel projectViewModel; String selectedPaymentMethod = ""; @@ -535,13 +535,6 @@ class _BookSuccessState extends State { } Future navigateToPaymentMethod(context, PatientShareResponse patientShareResponse) async { - if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); - setState(() { - authUser = data; - }); - } - AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList(); appo.projectID = widget.patientShareResponse.projectID; appo.clinicID = widget.patientShareResponse.clinicID; @@ -563,7 +556,7 @@ class _BookSuccessState extends State { patientShare: widget.patientShareResponse.patientShareWithTax))) .then((value) { if (value != null) { - openPayment(value, authUser, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo); + openPayment(value, projectViewModel.user, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo); projectViewModel.analytics.appointment.payment_method(appointment_type: 'regular', clinic: widget.docObject.clinicName, payment_method: value[0], payment_type: 'appointment'); } }); diff --git a/lib/pages/livecare/live_care_payment_page.dart b/lib/pages/livecare/live_care_payment_page.dart index c21a293c..78627450 100644 --- a/lib/pages/livecare/live_care_payment_page.dart +++ b/lib/pages/livecare/live_care_payment_page.dart @@ -298,24 +298,28 @@ class _LiveCarePatmentPageState extends State { if (_selected == 0) { AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms); } else { - askVideoCallPermission().then((value) async { - if (value == true) { - locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context); - locationUtils.getCurrentLocation(callBack: (value) { - print(value); - }); - if (Platform.isAndroid && !(await PlatformBridge.shared().isDrawOverAppsPermissionAllowed())) { - await drawOverAppsMessageDialog(context).then((value) { - return false; + if (widget.isPharmaLiveCare) { + Navigator.pop(context, true); + } else { + askVideoCallPermission().then((value) async { + if (value == true) { + locationUtils = new LocationUtils(isShowConfirmDialog: false, context: context); + locationUtils.getCurrentLocation(callBack: (value) { + print(value); }); + if (Platform.isAndroid && !(await PlatformBridge.shared().isDrawOverAppsPermissionAllowed())) { + await drawOverAppsMessageDialog(context).then((value) { + return false; + }); + } else { + Navigator.pop(context, true); + projectViewModel.analytics.liveCare.livecare_immediate_consultation_TnC(clinic: widget.clinicName); + } } else { - Navigator.pop(context, true); - projectViewModel.analytics.liveCare.livecare_immediate_consultation_TnC(clinic: widget.clinicName); + openPermissionsDialog(); } - } else { - openPermissionsDialog(); - } - }); + }); + } } }, color: CustomColors.green, @@ -332,7 +336,7 @@ class _LiveCarePatmentPageState extends State { @override void dispose() { - cancelAPI(); + // cancelAPI(); super.dispose(); } diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 6e799c89..361d2381 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -462,7 +462,10 @@ class _clinic_listState extends State { final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed'; DoctorsListService service = new DoctorsListService(); GifLoaderDialogUtils.showMyDialog(context); - service.checkPaymentStatus(widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode : Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), widget.isPharmacyLiveCare, context).then((res) { + service + .checkPaymentStatus( + widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode : Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), widget.isPharmacyLiveCare, context) + .then((res) { GifLoaderDialogUtils.hideDialog(context); String paymentInfo = res['Response_Message']; amount = res['Amount'].toString(); @@ -595,7 +598,7 @@ class _clinic_listState extends State { widget.isPharmacyLiveCare = true; widget.pharmacyLiveCareQRCode = value.split("/")[1]; liveCareClinicIDs = await sharedPref.getString(LIVECARE_CLINIC_DATA); - selectedClinicID = 7; + selectedClinicID = 1; selectedClinicName = TranslationBase.of(context).pharmaLiveCare; sharedPref.remove(LIVECARE_CLINIC_DATA); startLiveCare(); diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 4fbc41cc..5d13216f 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -37,9 +37,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 PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; @@ -63,7 +63,7 @@ class MyInAppBrowser extends InAppBrowser { AuthProvider authProvider = new AuthProvider(); InAppBrowser browser = new InAppBrowser(); - AuthenticatedUser authUser; + // AuthenticatedUser authUser; AppoitmentAllHistoryResultList appo; String deviceToken; @@ -125,16 +125,16 @@ class MyInAppBrowser extends InAppBrowser { this.deviceToken = deviceToken; } - getPatientData() async { - if (await this.sharedPref.getObject(USER_PROFILE) != null) { - var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); - authUser = data; - } - if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) { - lat = await this.sharedPref.getDouble(USER_LAT); - long = await this.sharedPref.getDouble(USER_LONG); - } - } + // getPatientData() async { + // if (await this.sharedPref.getObject(USER_PROFILE) != null) { + // var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); + // authUser = data; + // } + // if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) { + // lat = await this.sharedPref.getDouble(USER_LAT); + // long = await this.sharedPref.getDouble(USER_LONG); + // } + // } openPackagesPaymentBrowser({@required int customer_id, @required int order_id}) { paymentType = _PAYMENT_TYPE.PACKAGES; @@ -146,7 +146,7 @@ class MyInAppBrowser extends InAppBrowser { AuthenticatedUser authenticatedUser, InAppBrowser browser, bool isLiveCareAppo, var servID, var LiveServID, BuildContext context, [var appoDate, var appoNo, var clinicID, var doctorID, var installments]) async { this.browser = browser; - await getPatientData(); + // await getPatientData(); if (paymentMethod == "ApplePay") { getDeviceToken(); MyChromeSafariBrowser safariBrowser = new MyChromeSafariBrowser(new MyInAppBrowser(), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo); @@ -213,7 +213,7 @@ class MyInAppBrowser extends InAppBrowser { tamaraRequestModel.orderDescription = orderDesc; tamaraRequestModel.isInstallment = true; tamaraRequestModel.projectID = num.parse(projId); - tamaraRequestModel.accessCode = authUser.mobileNumber; + tamaraRequestModel.accessCode = authenticatedUser.mobileNumber; tamaraRequestModel.appointmentNo = (appoNo != null && appoNo != "") ? appoNo.toString() : "0"; tamaraRequestModel.customerName = patientName; tamaraRequestModel.fileNumber = patientID.toString(); @@ -254,7 +254,7 @@ class MyInAppBrowser extends InAppBrowser { AuthenticatedUser authenticatedUser, InAppBrowser browser) { this.browser = browser; MyChromeSafariBrowser safariBrowser = new MyChromeSafariBrowser(new MyInAppBrowser(), onExitCallback: browser.onExit, onLoadStartCallback: this.browser.onLoadStart, appo: this.appo); - getPatientData(); + // getPatientData(); generatePharmacyURL(order, amount, orderDesc, transactionID, emailId, paymentMethod, patientName, patientID, authenticatedUser).then((value) { if (order.customValuesXml.contains("ApplePay")) { safariBrowser.open(url: Uri.parse(value)); @@ -300,7 +300,7 @@ class MyInAppBrowser extends InAppBrowser { // if (servID == "4") // form = form.replaceFirst('SERVICE_URL_VALUE', MyInAppBrowser.PREAUTH_SERVICE_URL); // else - form = form.replaceFirst('SERVICE_URL_VALUE', MyInAppBrowser.SERVICE_URL); + form = form.replaceFirst('SERVICE_URL_VALUE', MyInAppBrowser.SERVICE_URL); if (servID != null) { form = form.replaceFirst('SERV_ID', servID); diff --git a/pubspec.yaml b/pubspec.yaml index cd09986f..49f12ca2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.5.015+4050015 +version: 4.5.60+1 environment: sdk: ">=2.7.0 <3.0.0"