diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart index 45d6f48c..712866af 100644 --- a/lib/core/api_consts.dart +++ b/lib/core/api_consts.dart @@ -1,6 +1,7 @@ import 'package:amazon_payfort/amazon_payfort.dart'; import 'package:flutter_amazonpaymentservices/environment_type.dart'; import 'package:hmg_patient_app_new/core/enums.dart'; +import 'package:myfatoorah_flutter/myfatoorah_flutter.dart'; class ApiConsts { static const maxSmallScreen = 660; @@ -44,12 +45,17 @@ class ApiConsts { // var payFortEnvironment = FortEnvironment.test; // var applePayMerchantId = "merchant.com.hmgwebservices.uat"; + static var myFatoorahEnvironmentType = MFEnvironment.TEST; + static var myFatoorahCountry = MFCountry.SAUDIARABIA; + static setBackendURLs() { switch (appEnvironmentType) { case AppEnvironmentTypeEnum.prod: baseUrl = "https://hmgwebservices.com/"; payFortEnvironment = FortEnvironment.production; payFortEnvironmentType = EnvironmentType.production; + myFatoorahEnvironmentType = MFEnvironment.LIVE; + myFatoorahCountry = MFCountry.SAUDIARABIA; applePayMerchantId = "merchant.com.hmgwebservices"; SERVICE_URL = "https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx"; TAMARA_URL = "https://mdlaboratories.com/tamaralive/Home/Checkout"; @@ -66,6 +72,8 @@ class ApiConsts { baseUrl = "https://uat.hmgwebservices.com/"; payFortEnvironment = FortEnvironment.test; payFortEnvironmentType = EnvironmentType.sandbox; + myFatoorahEnvironmentType = MFEnvironment.TEST; + myFatoorahCountry = MFCountry.KUWAIT; applePayMerchantId = "merchant.com.hmgwebservices.uat"; SERVICE_URL = 'https://uat.hmgwebservices.com/HMGPayment/pages/SendPayFortRequest.aspx'; TAMARA_URL = "https://epharmacy.hmg.com/tamara/Home/Checkout"; @@ -77,12 +85,13 @@ class ApiConsts { symptomsCheckerApi = symptomsCheckerApiUAT; symptomsCheckerUsername = 'guest_user'; symptomsCheckerPassword = '123456'; - break; case AppEnvironmentTypeEnum.uat: baseUrl = "https://uat.hmgwebservices.com/"; payFortEnvironment = FortEnvironment.test; payFortEnvironmentType = EnvironmentType.sandbox; + myFatoorahEnvironmentType = MFEnvironment.TEST; + myFatoorahCountry = MFCountry.KUWAIT; applePayMerchantId = "merchant.com.hmgwebservices.uat"; SERVICE_URL = 'https://uat.hmgwebservices.com/HMGPayment/pages/SendPayFortRequest.aspx'; TAMARA_URL = "https://epharmacy.hmg.com/tamara/Home/Checkout"; @@ -100,6 +109,8 @@ class ApiConsts { baseUrl = "https://webservices.hmg.com/"; payFortEnvironment = FortEnvironment.production; payFortEnvironmentType = EnvironmentType.production; + myFatoorahEnvironmentType = MFEnvironment.LIVE; + myFatoorahCountry = MFCountry.SAUDIARABIA; applePayMerchantId = "merchant.com.hmgwebservices"; SERVICE_URL = "https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx"; TAMARA_URL = "https://epharmacy.hmg.com/tamara/Home/Checkout"; @@ -117,6 +128,8 @@ class ApiConsts { baseUrl = "https://uat.hmgwebservices.com/"; payFortEnvironment = FortEnvironment.test; payFortEnvironmentType = EnvironmentType.sandbox; + myFatoorahEnvironmentType = MFEnvironment.TEST; + myFatoorahCountry = MFCountry.KUWAIT; applePayMerchantId = "merchant.com.hmgwebservices.uat"; SERVICE_URL = 'https://uat.hmgwebservices.com/HMGPayment/pages/SendPayFortRequest.aspx'; TAMARA_URL = "https://epharmacy.hmg.com/tamara/Home/Checkout"; @@ -134,6 +147,8 @@ class ApiConsts { baseUrl = "https://uat.hmgwebservices.com/"; payFortEnvironment = FortEnvironment.test; payFortEnvironmentType = EnvironmentType.sandbox; + myFatoorahEnvironmentType = MFEnvironment.TEST; + myFatoorahCountry = MFCountry.KUWAIT; applePayMerchantId = "merchant.com.hmgwebservices.uat"; SERVICE_URL = 'https://uat.hmgwebservices.com/HMGPayment/pages/SendPayFortRequest.aspx'; TAMARA_URL = "https://epharmacy.hmg.com/tamara/Home/Checkout"; diff --git a/lib/core/app_state.dart b/lib/core/app_state.dart index 0d015922..ef5e306b 100644 --- a/lib/core/app_state.dart +++ b/lib/core/app_state.dart @@ -48,12 +48,18 @@ class AppState { bool isPaytabsEnabled = false; bool isPayfortHostedPageEnabled = true; + bool isMyFatoorahEnabled = false; void setIsPaytabsEnabled(bool value) { isPaytabsEnabled = value; // isPaytabsEnabled = true; } + void setIsMyFatoorahEnabled(bool value) { + isMyFatoorahEnabled = value; + // isMyFatoorahEnabled = true; + } + void setIsPayfortHostedPageEnabled(bool value) { isPayfortHostedPageEnabled = value; // isPayfortHostedPageEnabled = false; diff --git a/lib/features/my_appointments/my_appointments_view_model.dart b/lib/features/my_appointments/my_appointments_view_model.dart index b153c556..b2b990db 100644 --- a/lib/features/my_appointments/my_appointments_view_model.dart +++ b/lib/features/my_appointments/my_appointments_view_model.dart @@ -772,9 +772,9 @@ class MyAppointmentsViewModel extends ChangeNotifier { patientMyDoctorsList = apiResponse.data!; isPatientMyDoctorsLoading = false; - if (!isTop8) { - isMyDoctorsDataToBeLoaded = false; - } + // if (!isTop8) { + isMyDoctorsDataToBeLoaded = false; + // } notifyListeners(); if (onSuccess != null) { diff --git a/lib/presentation/book_appointment/widgets/doctor_card.dart b/lib/presentation/book_appointment/widgets/doctor_card.dart index 23a9cbcd..b14a3822 100644 --- a/lib/presentation/book_appointment/widgets/doctor_card.dart +++ b/lib/presentation/book_appointment/widgets/doctor_card.dart @@ -219,6 +219,9 @@ class DoctorCard extends StatelessWidget { ); } else { bookAppointmentsViewModel.setSelectedDoctor(doctorsListResponseModel); + GetClinicsListResponseModel selectedClinic = GetClinicsListResponseModel( + clinicID: doctorsListResponseModel.clinicID, clinicDescription: doctorsListResponseModel.clinicName, isLiveCareClinicAndOnline: false, liveCareServiceID: 0, liveCareClinicID: 0); + bookAppointmentsViewModel.setSelectedClinic(selectedClinic); LoaderBottomSheet.showLoader(); bookAppointmentsViewModel.isLiveCareSchedule ? await bookAppointmentsViewModel.getLiveCareDoctorFreeSlots(