|
|
|
|
@ -632,7 +632,6 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
|
|
|
|
|
).paddingSymmetrical(16.h, 16.h),
|
|
|
|
|
).paddingSymmetrical(24.h, 0.h).onPress(() {
|
|
|
|
|
selectedPaymentMethod = "TAMARA";
|
|
|
|
|
|
|
|
|
|
transID = Utils.getAppointmentTransID(
|
|
|
|
|
widget.patientAppointmentHistoryResponseModel.projectID,
|
|
|
|
|
widget.patientAppointmentHistoryResponseModel.clinicID,
|
|
|
|
|
@ -660,86 +659,64 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
|
|
|
|
|
await payfortViewModel.updateTamaraRequestStatus(responseMessage: "success", status: "14", clientRequestID: transID, tamaraOrderID: tamaraOrderID);
|
|
|
|
|
await payfortViewModel.markAppointmentAsTamaraPaid(
|
|
|
|
|
projectID: widget.patientAppointmentHistoryResponseModel.projectID, appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo);
|
|
|
|
|
await myAppointmentsViewModel.createAdvancePayment(
|
|
|
|
|
paymentMethodName: selectedPaymentMethod,
|
|
|
|
|
projectID: widget.patientAppointmentHistoryResponseModel.projectID,
|
|
|
|
|
clinicID: widget.patientAppointmentHistoryResponseModel.clinicID,
|
|
|
|
|
appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo.toString(),
|
|
|
|
|
payedAmount: num.parse(myAppointmentsViewModel.patientAppointmentShareResponseModel!.patientShareWithTax!.toString()),
|
|
|
|
|
paymentReference: transactionData.transactionReference!,
|
|
|
|
|
patientID: appState.getAuthenticatedUser()!.patientId.toString(),
|
|
|
|
|
patientType: appState.getAuthenticatedUser()!.patientType!,
|
|
|
|
|
onSuccess: (value) async {
|
|
|
|
|
print(value);
|
|
|
|
|
await myAppointmentsViewModel.addAdvanceNumberRequest(
|
|
|
|
|
advanceNumber: "Tamara-Advance-0000",
|
|
|
|
|
paymentReference: transactionData.transactionReference!,
|
|
|
|
|
appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo.toString(),
|
|
|
|
|
onSuccess: (value) async {
|
|
|
|
|
if (widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment!) {
|
|
|
|
|
//TODO: Implement LiveCare Check-In API Call
|
|
|
|
|
await myAppointmentsViewModel.insertLiveCareVIDARequest(
|
|
|
|
|
clientRequestID: transID,
|
|
|
|
|
patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel,
|
|
|
|
|
onSuccess: (apiResponse) {
|
|
|
|
|
Future.delayed(Duration(milliseconds: 500), () {
|
|
|
|
|
myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true);
|
|
|
|
|
myAppointmentsViewModel.initAppointmentsViewModel();
|
|
|
|
|
myAppointmentsViewModel.getPatientAppointments(true, false);
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
await myAppointmentsViewModel.addAdvanceNumberRequest(
|
|
|
|
|
advanceNumber: "Tamara-Advance-0000",
|
|
|
|
|
paymentReference: transactionData.transactionReference!,
|
|
|
|
|
appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo.toString(),
|
|
|
|
|
onSuccess: (value) async {
|
|
|
|
|
if (widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment!) {
|
|
|
|
|
//TODO: Implement LiveCare Check-In API Call
|
|
|
|
|
await myAppointmentsViewModel.insertLiveCareVIDARequest(
|
|
|
|
|
clientRequestID: transID,
|
|
|
|
|
patientAppointmentHistoryResponseModel: widget.patientAppointmentHistoryResponseModel,
|
|
|
|
|
onSuccess: (apiResponse) {
|
|
|
|
|
Future.delayed(Duration(milliseconds: 500), () {
|
|
|
|
|
myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true);
|
|
|
|
|
myAppointmentsViewModel.initAppointmentsViewModel();
|
|
|
|
|
myAppointmentsViewModel.getPatientAppointments(true, false);
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
|
|
|
|
|
getIt.get<HabibWalletViewModel>().setIsWalletAmountToBeLoaded(true);
|
|
|
|
|
getIt.get<HabibWalletViewModel>().initHabibWalletProvider();
|
|
|
|
|
getIt.get<HabibWalletViewModel>().getPatientBalanceAmount();
|
|
|
|
|
getIt.get<HabibWalletViewModel>().setIsWalletAmountToBeLoaded(true);
|
|
|
|
|
getIt.get<HabibWalletViewModel>().initHabibWalletProvider();
|
|
|
|
|
getIt.get<HabibWalletViewModel>().getPatientBalanceAmount();
|
|
|
|
|
|
|
|
|
|
Navigator.pushAndRemoveUntil(
|
|
|
|
|
context,
|
|
|
|
|
CustomPageRoute(
|
|
|
|
|
page: LandingNavigation(),
|
|
|
|
|
),
|
|
|
|
|
(r) => false);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
onError: (error) {});
|
|
|
|
|
} else {
|
|
|
|
|
await myAppointmentsViewModel.generateAppointmentQR(
|
|
|
|
|
clinicID: widget.patientAppointmentHistoryResponseModel.clinicID,
|
|
|
|
|
projectID: widget.patientAppointmentHistoryResponseModel.projectID,
|
|
|
|
|
appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo.toString(),
|
|
|
|
|
isFollowUp: myAppointmentsViewModel.patientAppointmentShareResponseModel!.isFollowup!,
|
|
|
|
|
onSuccess: (apiResponse) {
|
|
|
|
|
Future.delayed(Duration(milliseconds: 500), () {
|
|
|
|
|
myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true);
|
|
|
|
|
myAppointmentsViewModel.initAppointmentsViewModel();
|
|
|
|
|
myAppointmentsViewModel.getPatientAppointments(true, false);
|
|
|
|
|
Navigator.pushAndRemoveUntil(
|
|
|
|
|
context,
|
|
|
|
|
CustomPageRoute(
|
|
|
|
|
page: LandingNavigation(),
|
|
|
|
|
),
|
|
|
|
|
(r) => false);
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
onError: (error) {});
|
|
|
|
|
} else {
|
|
|
|
|
await myAppointmentsViewModel.generateAppointmentQR(
|
|
|
|
|
clinicID: widget.patientAppointmentHistoryResponseModel.clinicID,
|
|
|
|
|
projectID: widget.patientAppointmentHistoryResponseModel.projectID,
|
|
|
|
|
appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo.toString(),
|
|
|
|
|
isFollowUp: myAppointmentsViewModel.patientAppointmentShareResponseModel!.isFollowup!,
|
|
|
|
|
onSuccess: (apiResponse) {
|
|
|
|
|
Future.delayed(Duration(milliseconds: 500), () {
|
|
|
|
|
myAppointmentsViewModel.setIsAppointmentDataToBeLoaded(true);
|
|
|
|
|
myAppointmentsViewModel.initAppointmentsViewModel();
|
|
|
|
|
myAppointmentsViewModel.getPatientAppointments(true, false);
|
|
|
|
|
|
|
|
|
|
getIt.get<HabibWalletViewModel>().setIsWalletAmountToBeLoaded(true);
|
|
|
|
|
getIt.get<HabibWalletViewModel>().initHabibWalletProvider();
|
|
|
|
|
getIt.get<HabibWalletViewModel>().getPatientBalanceAmount();
|
|
|
|
|
getIt.get<HabibWalletViewModel>().setIsWalletAmountToBeLoaded(true);
|
|
|
|
|
getIt.get<HabibWalletViewModel>().initHabibWalletProvider();
|
|
|
|
|
getIt.get<HabibWalletViewModel>().getPatientBalanceAmount();
|
|
|
|
|
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
Navigator.pushAndRemoveUntil(
|
|
|
|
|
context,
|
|
|
|
|
CustomPageRoute(
|
|
|
|
|
page: LandingNavigation(),
|
|
|
|
|
),
|
|
|
|
|
(r) => false);
|
|
|
|
|
});
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
Navigator.pushAndRemoveUntil(
|
|
|
|
|
context,
|
|
|
|
|
CustomPageRoute(
|
|
|
|
|
page: LandingNavigation(),
|
|
|
|
|
),
|
|
|
|
|
(r) => false);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
onError: (err) {
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
context,
|
|
|
|
|
child: Utils.getErrorWidget(loadingText: err.toString()),
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
}, onError: (err) async {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}, onError: (err) async {
|
|
|
|
|
await payfortViewModel.updateTamaraRequestStatus(responseMessage: "Failed", status: "00", clientRequestID: transID, tamaraOrderID: tamaraOrderID);
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
context,
|
|
|
|
|
|