Merge branch 'development_v3.3' of http://34.17.52.79/Haroon6138/diplomatic-quarter into dev_v3.13.6

# Conflicts:
#	android/build.gradle
#	android/gradle.properties
#	ios/Runner.xcodeproj/project.pbxproj
#	lib/config/config.dart
#	lib/core/model/prescriptions/prescription_report_inp.dart
#	lib/pages/AlHabibMedicalService/ancillary-orders/ancillaryOrdersDetails.dart
#	lib/pages/BookAppointment/BookSuccess.dart
#	lib/pages/BookAppointment/DentalComplaints.dart
#	lib/pages/BookAppointment/DoctorProfile.dart
#	lib/pages/BookAppointment/components/DocAvailableAppointments.dart
#	lib/pages/BookAppointment/widgets/DoctorView.dart
#	lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart
#	lib/pages/ToDoList/ToDo.dart
#	lib/pages/livecare/widgets/clinic_list.dart
#	lib/pages/medical/balance/confirm_payment_page.dart
#	lib/services/appointment_services/GetDoctorsList.dart
#	lib/services/clinic_services/get_clinic_service.dart
#	pubspec.yaml
dev_v3.13.6_voipcall
Sultan khan 2 years ago
commit 6983e309e0

@ -344,7 +344,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.3;
var SETUP_ID = '91877';
var LANGUAGE = 2;
// var PATIENT_OUT_SA = 0;

@ -18,7 +18,7 @@ class PrescriptionReportINP {
int? days;
String? startDate;
String? orderDate;
int? doseDailyQuantity;
num? doseDailyQuantity;
int? itemID;
dynamic productImage;
String? sKU;

@ -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

@ -591,9 +591,11 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
selectedPaymentMethod = method;
this.selectedInstallmentPlan = selectedInstallmentPlan;
if (selectedPaymentMethod == "ApplePay") {
startApplePay();
} else {
openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), null, selectedInstallmentPlan);
if (projectViewModel.havePrivilege(103)) {
startApplePay();
} else {
openPayment(selectedPaymentMethod, projectViewModel.user, double.parse(getTotalValue()), null, selectedInstallmentPlan);
}
}
},
patientShare: double.parse(getTotalValue()),
@ -617,7 +619,8 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> 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);
@ -656,25 +659,26 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
service.applePayInsertRequest(applePayInsertRequest, context).then((res) async {
await context.read<PayfortViewModel>().initiateApplePayWithPayfort(
customerName: projectViewModel.authenticatedUserObject.user.firstName! + " " + projectViewModel.authenticatedUserObject.user!.lastName!,
customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
orderDescription: "Ancillary Order Payment",
orderAmount: double.parse(getTotalValue()),
merchantReference: transID,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
currency: projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR",
onFailed: (failureResult) async {
log("failureResult: ${failureResult.toString()}");
AppToast.showErrorToast(message: failureResult.toString());
},
onSuccess: (successResult) async {
log("Payfort: ${successResult.responseMessage}");
await context.read<PayfortViewModel>().addPayfortApplePayResponse(result: successResult);
checkPaymentStatus(AppoitmentAllHistoryResultList());
},
projectId: widget.projectID,
serviceTypeEnum: ServiceTypeEnum.ancillaryOrder,
);
customerName: projectViewModel.authenticatedUserObject.user.firstName! + " " + projectViewModel.authenticatedUserObject.user!.lastName!,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com",
orderDescription: "Ancillary Order Payment",
orderAmount: double.parse(getTotalValue()),
merchantReference: transID,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
currency: projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR",
onFailed: (failureResult) async {
log("failureResult: ${failureResult.toString()}");
AppToast.showErrorToast(message: failureResult.toString());
},
onSuccess: (successResult) async {
log("Payfort: ${successResult.responseMessage}");
await context.read<PayfortViewModel>().addPayfortApplePayResponse(result: successResult);
checkPaymentStatus(AppoitmentAllHistoryResultList());
},
projectId: widget.projectID,
serviceTypeEnum: ServiceTypeEnum.ancillaryOrder,
);
}).catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);

@ -735,20 +735,15 @@ class _BookSuccessState extends State<BookSuccess> {
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);
openPayment(value, projectViewModel.user, 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');
projectViewModel.analytics.appointment.payment_method(appointment_type: 'regular', clinic: widget.docObject.clinicName, payment_method: value[0], payment_type: 'appointment');
}
});
}
@ -773,19 +768,13 @@ class _BookSuccessState extends State<BookSuccess> {
applePayInsertRequest.clientRequestID = transID;
applePayInsertRequest.clinicID = appo.clinicID;
applePayInsertRequest.currency =
projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR";
applePayInsertRequest.customerEmail =
projectViewModel.authenticatedUserObject.user.emailAddress;
applePayInsertRequest.customerID =
projectViewModel.authenticatedUserObject.user.patientID;
applePayInsertRequest.customerName =
projectViewModel.authenticatedUserObject.user.firstName! + " " +
projectViewModel.authenticatedUserObject.user.lastName!;
applePayInsertRequest.deviceToken =
await AppSharedPreferences().getString(PUSH_TOKEN);
applePayInsertRequest.voipToken =
await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN);
applePayInsertRequest.currency = projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR";
// 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);
applePayInsertRequest.voipToken = await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN);
applePayInsertRequest.doctorID = appo.doctorID;
applePayInsertRequest.projectID = appo.projectID.toString();
applePayInsertRequest.serviceID =
@ -799,7 +788,7 @@ class _BookSuccessState extends State<BookSuccess> {
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";
@ -833,31 +822,26 @@ class _BookSuccessState extends State<BookSuccess> {
service.applePayInsertRequest(applePayInsertRequest, context).then((
res) async {
await context.read<PayfortViewModel>().initiateApplePayWithPayfort(
customerName: projectViewModel.authenticatedUserObject.user.firstName! +
" " + projectViewModel.authenticatedUserObject.user.lastName!,
customerEmail: projectViewModel.authenticatedUserObject.user
.emailAddress,
orderDescription: "Appointment Payment",
orderAmount: double.parse(
patientShareResponse.patientShareWithTax.toString()),
merchantReference: transID,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
currency: projectViewModel.authenticatedUserObject.user.outSA == 1
? "AED"
: "SAR",
onFailed: (failureResult) async {
log("failureResult: ${failureResult.toString()}");
AppToast.showErrorToast(message: failureResult.toString());
},
onSuccess: (successResult) async {
log("Payfort: ${successResult.responseMessage}");
await context.read<PayfortViewModel>().addPayfortApplePayResponse(
result: successResult);
checkPaymentStatus(appo);
},
projectId: appo.projectID,
serviceTypeEnum: ServiceTypeEnum.appointmentPayment,
);
customerName: projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com",
orderDescription: "Appointment Payment",
orderAmount: double.parse(patientShareResponse.patientShareWithTax.toString()),
merchantReference: transID,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
currency: projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR",
onFailed: (failureResult) async {
log("failureResult: ${failureResult.toString()}");
AppToast.showErrorToast(message: failureResult.toString());
},
onSuccess: (successResult) async {
log("Payfort: ${successResult.responseMessage}");
await context.read<PayfortViewModel>().addPayfortApplePayResponse(result: successResult);
checkPaymentStatus(appo);
},
projectId: appo.projectID,
serviceTypeEnum: ServiceTypeEnum.appointmentPayment,
);
}).catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
@ -1207,7 +1191,6 @@ class _BookSuccessState extends State<BookSuccess> {
);
}
_getBulletPoint(bulletPoint) {
return Container(
margin: EdgeInsets.only(left: 20.0, right: 20.0),

@ -118,6 +118,7 @@ class _DentalComplaintsState extends State<DentalComplaints> {
return DoctorView(
doctor: doctor,
isLiveCareAppointment: false,
isContinueDentalPlan: hasDentalPlan,
);
}).toList(),
)),
@ -146,8 +147,8 @@ class _DentalComplaintsState extends State<DentalComplaints> {
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();
@ -261,8 +262,9 @@ class _DentalComplaintsState extends State<DentalComplaints> {
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(() {

@ -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});
late AuthenticatedUser authUser;
@ -203,6 +204,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
doctor: widget.doctor,
isLiveCareAppointment: widget.isLiveCareAppointment,
doctorSchedule: doctorSchedule,
isContinueDentalPlan: widget.isContinueDentalPlan,
),
],
controller: _tabController,

@ -65,6 +65,7 @@ class _SearchResultsState extends State<SearchResults> {
isObGyneAppointment: widget.isObGyneAppointment,
isDoctorNameSearch: widget.isDoctorNameSearch,
obGyneProcedureListResponse: widget.obGyneProcedureListResponse,
isShowDate: false,
onTap: () {
projectViewModel.analytics.appointment.book_appointment_select_doctor(appointment_type: 'regular', doctor: doctor);
});

@ -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();
@ -344,20 +345,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
print(DocAvailableAppointments.initialSlotDuration);
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.getDoctorFreeSlots(
int.parse(
docObject.doctorID.toString(),
),
int.parse(
docObject.clinicID.toString(),
),
int.parse(
docObject.projectID.toString(),
),
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) {

@ -29,15 +29,19 @@ class DoctorView extends StatelessWidget {
bool isObGyneAppointment;
bool isShowFlag;
bool isDoctorNameSearch;
OBGyneProcedureListResponse? obGyneProcedureListResponse;
final VoidCallback? onTap;
bool isContinueDentalPlan;
OBGyneProcedureListResponse obGyneProcedureListResponse;
final VoidCallback onTap;
bool isShowDate;
DoctorView(
{required this.doctor,
this.isLiveCareAppointment,
this.isObGyneAppointment = false,
this.isDoctorNameSearch = false,
this.isContinueDentalPlan = false,
this.isShowFlag = true,
this.isShowDate = true,
this.onTap,
this.obGyneProcedureListResponse});
@ -55,7 +59,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
}
@ -88,15 +92,10 @@ class DoctorView extends StatelessWidget {
style: TextStyle(fontSize: 16, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.64, height: 25 / 16),
),
),
// doctor.date ==null ? SizedBox() : Text(
// DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(doctor.date)),
Text(
doctor.date != null ? DateUtil.getDayMonthYearDateFormatted(DateUtil.convertStringToDate(doctor.date )) : DateUtil.getDayMonthYearDateFormatted(DateTime.now()).toString(),
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),
@ -213,7 +212,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<DoctorProfileList> docProfileList = [];
@ -226,7 +225,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']);
}
@ -265,7 +264,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(
@ -275,6 +274,7 @@ class DoctorView extends StatelessWidget {
docProfileList: docProfile,
isOpenAppt: isAppo,
isDoctorNameSearch: isDoctorNameSearch,
isContinueDentalPlan: isContinueDentalPlan,
),
),
);

@ -466,7 +466,7 @@ class _CovidTimeSlotsState extends State<ObGyneTimeSlots> 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) {

@ -1310,8 +1310,8 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
GifLoaderDialogUtils.showMyDialog(context);
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)
.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate,
transID, projectViewModel.isArabic ? 1 : 2, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context);
getPatientAppointmentHistory();
@ -1339,7 +1339,11 @@ class _ToDoState extends State<ToDo> 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);
}
@ -1364,7 +1368,8 @@ class _ToDoState extends State<ToDo> 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);
@ -1378,7 +1383,7 @@ class _ToDoState extends State<ToDo> 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";
@ -1403,8 +1408,9 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
service.applePayInsertRequest(applePayInsertRequest, context).then((res) async {
await context.read<PayfortViewModel>().initiateApplePayWithPayfort(
customerName: projectViewModel.authenticatedUserObject.user.firstName! + " " + projectViewModel.authenticatedUserObject.user!.lastName!,
customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerName: projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com",
orderDescription: "Appointment Payment",
orderAmount: double.parse(patientShareResponse.patientShareWithTax.toString()),
merchantReference: transID,

@ -337,7 +337,11 @@ class _clinic_listState extends State<ClinicList> {
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);
}
@ -349,7 +353,7 @@ class _clinic_listState extends State<ClinicList> {
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!);
@ -367,7 +371,8 @@ class _clinic_listState extends State<ClinicList> {
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);
@ -382,7 +387,7 @@ class _clinic_listState extends State<ClinicList> {
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;
@ -404,10 +409,11 @@ class _clinic_listState extends State<ClinicList> {
applePayInsertRequest.shaResponsePhrase = payfortProjectDetailsRespModel!.shaResponse;
applePayInsertRequest.returnURL = "";
service.applePayInsertRequest(applePayInsertRequest, localContext!).then((res) async {
await localContext?.read<PayfortViewModel>().initiateApplePayWithPayfort(
customerName: projectViewModel.authenticatedUserObject.user.firstName! + " " + projectViewModel.authenticatedUserObject.user.lastName!,
customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
service.applePayInsertRequest(applePayInsertRequest, localContext).then((res) async {
await localContext.read<PayfortViewModel>().initiateApplePayWithPayfort(
customerName: projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com",
orderDescription: "LiveCare Payment",
orderAmount: double.parse(amount),
merchantReference: transID,
@ -440,10 +446,9 @@ class _clinic_listState extends State<ClinicList> {
openPayment(List<String?> paymentMethod, AuthenticatedUser authenticatedUser, num amount, AppoitmentAllHistoryResultList appo) {
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
selectedPaymentMethod = paymentMethod[0]!;
selectedInstallmentPlan = paymentMethod[1]!;
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();
browser.openPaymentBrowser(amount, "LiveCare Payment", widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode! : transID!, "12", authenticatedUser.emailAddress!, paymentMethod[0]!,
@ -487,7 +492,7 @@ class _clinic_listState extends State<ClinicList> {
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 {
@ -511,7 +516,7 @@ class _clinic_listState extends State<ClinicList> {
updateTamaraRequestStatus("success", "14", orderID, tamaraOrderID, int.parse(selectedInstallmentPlan), appo);
} else {
updateTamaraRequestStatus(
"Failed", "00", Utils.getAppointmentTransID(appo.projectID!, appo.clinicID!, appo.appointmentNo!), tamaraOrderID != null ? tamaraOrderID : "", int.parse(selectedInstallmentPlan), appo);
"Failed", "00", transID, tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallmentPlan), appo);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
@ -528,7 +533,7 @@ class _clinic_listState extends State<ClinicList> {
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(
@ -561,7 +566,7 @@ class _clinic_listState extends State<ClinicList> {
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(

@ -221,7 +221,11 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
() 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());
}
@ -268,7 +272,8 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
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);
@ -307,8 +312,9 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
service.applePayInsertRequest(applePayInsertRequest, context).then((res) async {
await context.read<PayfortViewModel>().initiateApplePayWithPayfort(
customerName: projectViewModel.authenticatedUserObject.user.firstName! + " " + projectViewModel.authenticatedUserObject.user.lastName!,
customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerName: projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com",
orderDescription: "Advance Payment",
orderAmount: double.parse(widget.advanceModel!.amount!),
merchantReference: transID,

@ -256,7 +256,7 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> getDoctorFreeSlots(int docID, int clinicID, int projectID, BuildContext context, [ProjectViewModel? projectViewModel]) async {
Future<Map> getDoctorFreeSlots(int docID, int clinicID, int projectID, bool isContinueDentalPlan, BuildContext context, [ProjectViewModel? projectViewModel]) async {
Map<String, dynamic> request;
Request req = appGlobal.getPublicRequest();
@ -276,7 +276,8 @@ class DoctorsListService extends BaseService {
"SessionID": null,
"isDentalAllowedBackend": false,
"LanguageID": 1,
"DeviceTypeID": 1
"DeviceTypeID": 1,
"ContinueDentalPlan": isContinueDentalPlan,
};
if (clinicID == 253) {

@ -63,98 +63,7 @@ class ClinicListService extends BaseService {
return Future.value(localRes);
}
Future<Map> checkIfInPatientAPI(context) async {
Map<String, dynamic>? request;
request = {
"IsActiveAppointment": false,
};
dynamic localRes;
await baseAppClient.post(CHECK_IF_PATIENT_ADMITTED, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
Future<Map> getGeneralInstructions(int projectID, context) async {
Map<String, dynamic> request;
request = {"ProjectID": projectID};
dynamic localRes;
await baseAppClient.post(GET_GENERAL_INSTRUCTIONS, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request, isAllowAny: true);
return Future.value(localRes);
}
Future<Map> getInPatientAdvancePaymentRequests(int projectID, int admissionNo, int admissionReqNo, context) async {
Map<String, dynamic> request;
request = {"ProjectID": projectID, "AdmissionReqNo": admissionReqNo, "AdmissionNo": admissionNo};
dynamic localRes;
await baseAppClient.post(GET_INPATIENT_ADVANCE_PAYMENT_REQUESTS, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request, isAllowAny: true);
return Future.value(localRes);
}
Future<Map> getInPatientPaymentLink(int projectID, int admissionNo, int orderID, String name, String email, num amount, String nationalID, int clinicID, int paymentRequestID, context) async {
Map<String, dynamic> request;
// request = {"ProjectID": projectID, "AdmissionReqNo": admissionReqNo, "AdmissionNo": admissionNo};
request = {
"ProjectID": projectID,
"ClientOrderID": orderID,
"OrderDescription": "InPatient Advance Payment",
"CustomerName": name,
"CustomerEmail": email,
"Amount": amount,
"IsPaid": 0,
"AppointmentID": admissionNo.toString(),
"PaymentOption": "0",
"PaymentReferenceNumber": admissionNo,
"SourceType": "1",
"NationalID": nationalID,
"ClinicID": clinicID,
"PaymentRequestId": paymentRequestID,
"createdBy": 102
};
dynamic localRes;
await baseAppClient.post(GET_INPATIENT_ADVANCE_PAYMENT_LINK, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request, isAllowAny: true);
return Future.value(localRes);
}
Future<Map> getMedicalInstructions(int projectID, context) async {
Map<String, dynamic> request;
request = {"ProjectID": projectID};
dynamic localRes;
await baseAppClient.post(GET_MEDICAL_INSTRUCTIONS, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request, isAllowAny: true);
return Future.value(localRes);
}
Future<Map> getChiefComplaintsList(int clinicID, int projectID, int languageID, BuildContext context, {doctorId}) async {
Future<Map> getChiefComplaintsList(int clinicID, int projectID, int languageID, bool isContinueDentalPlan, BuildContext context, {doctorId}) async {
//Utils.showProgressDialog(context);
Map<String, dynamic> request;
@ -179,8 +88,8 @@ class ClinicListService extends BaseService {
"SessionID": null,
"isDentalAllowedBackend": true,
"DeviceTypeID": 1,
"PatientID": 1,
"ContinueDentalPlan": true,
// "PatientID": 1,
"ContinueDentalPlan": isContinueDentalPlan,
"IsSearchAppointmnetByClinicID": false,
"DateofBirth": authUser.dateofBirth
};

@ -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) {

@ -103,7 +103,7 @@ class SMSOTP {
startTimer(setState);
// startLister();
if (Platform.isAndroid) checkSignature();
if (Platform.isAndroid && type == 1) checkSignature();
}
return Container(

Loading…
Cancel
Save