|  |  |  | @ -98,7 +98,7 @@ class _WalletPaymentConfirmPageState extends State<WalletPaymentConfirmPage> { | 
		
	
		
			
				|  |  |  |  |                       ).paddingSymmetrical(16.h, 16.h), | 
		
	
		
			
				|  |  |  |  |                     ).paddingSymmetrical(24.h, 0.h).onPress(() { | 
		
	
		
			
				|  |  |  |  |                       selectedPaymentMethod = "MADA"; | 
		
	
		
			
				|  |  |  |  |                       // openPaymentURL("mada"); | 
		
	
		
			
				|  |  |  |  |                       openPaymentURL("mada"); | 
		
	
		
			
				|  |  |  |  |                     }), | 
		
	
		
			
				|  |  |  |  |                     SizedBox(height: 16.h), | 
		
	
		
			
				|  |  |  |  |                     Container( | 
		
	
	
		
			
				
					|  |  |  | @ -137,7 +137,7 @@ class _WalletPaymentConfirmPageState extends State<WalletPaymentConfirmPage> { | 
		
	
		
			
				|  |  |  |  |                       ).paddingSymmetrical(16.h, 16.h), | 
		
	
		
			
				|  |  |  |  |                     ).paddingSymmetrical(24.h, 0.h).onPress(() { | 
		
	
		
			
				|  |  |  |  |                       selectedPaymentMethod = "VISA"; | 
		
	
		
			
				|  |  |  |  |                       // openPaymentURL("visa"); | 
		
	
		
			
				|  |  |  |  |                       openPaymentURL("visa"); | 
		
	
		
			
				|  |  |  |  |                     }), | 
		
	
		
			
				|  |  |  |  |                   ], | 
		
	
		
			
				|  |  |  |  |                 ), | 
		
	
	
		
			
				
					|  |  |  | @ -188,7 +188,9 @@ class _WalletPaymentConfirmPageState extends State<WalletPaymentConfirmPage> { | 
		
	
		
			
				|  |  |  |  |                       ).paddingSymmetrical(24.h, 0.h).onPress(() { | 
		
	
		
			
				|  |  |  |  |                         if (Utils.havePrivilege(103)) { | 
		
	
		
			
				|  |  |  |  |                           startApplePay(); | 
		
	
		
			
				|  |  |  |  |                         } else {} | 
		
	
		
			
				|  |  |  |  |                         } else { | 
		
	
		
			
				|  |  |  |  |                           openPaymentURL("applepay"); | 
		
	
		
			
				|  |  |  |  |                         } | 
		
	
		
			
				|  |  |  |  |                       }) | 
		
	
		
			
				|  |  |  |  |                     : SizedBox(height: 12.h), | 
		
	
		
			
				|  |  |  |  |                 SizedBox(height: 32.h), | 
		
	
	
		
			
				
					|  |  |  | @ -327,50 +329,6 @@ class _WalletPaymentConfirmPageState extends State<WalletPaymentConfirmPage> { | 
		
	
		
			
				|  |  |  |  |                     }); | 
		
	
		
			
				|  |  |  |  |               }, | 
		
	
		
			
				|  |  |  |  |               onError: (err) {}); | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |             // await myAppointmentsViewModel.createAdvancePayment( | 
		
	
		
			
				|  |  |  |  |             //     paymentMethodName: selectedPaymentMethod, | 
		
	
		
			
				|  |  |  |  |             //     projectID: widget.patientAppointmentHistoryResponseModel.projectID, | 
		
	
		
			
				|  |  |  |  |             //     clinicID: widget.patientAppointmentHistoryResponseModel.clinicID, | 
		
	
		
			
				|  |  |  |  |             //     appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo.toString(), | 
		
	
		
			
				|  |  |  |  |             //     payedAmount: payfortViewModel.payfortCheckPaymentStatusResponseModel!.amount!, | 
		
	
		
			
				|  |  |  |  |             //     paymentReference: payfortViewModel.payfortCheckPaymentStatusResponseModel!.fortId!, | 
		
	
		
			
				|  |  |  |  |             //     patientID: "4767477", | 
		
	
		
			
				|  |  |  |  |             //     patientType: 1, | 
		
	
		
			
				|  |  |  |  |             //     onSuccess: (value) async { | 
		
	
		
			
				|  |  |  |  |             //       print(value); | 
		
	
		
			
				|  |  |  |  |             //       await myAppointmentsViewModel.addAdvanceNumberRequest( | 
		
	
		
			
				|  |  |  |  |             //           advanceNumber: Utils.isVidaPlusProject(widget.patientAppointmentHistoryResponseModel.projectID) | 
		
	
		
			
				|  |  |  |  |             //               ? value.data['OnlineCheckInAppointments'][0]['AdvanceNumber_VP'].toString() | 
		
	
		
			
				|  |  |  |  |             //               : value.data['OnlineCheckInAppointments'][0]['AdvanceNumber'].toString(), | 
		
	
		
			
				|  |  |  |  |             //           paymentReference: payfortViewModel.payfortCheckPaymentStatusResponseModel!.fortId!, | 
		
	
		
			
				|  |  |  |  |             //           appointmentNo: widget.patientAppointmentHistoryResponseModel.appointmentNo.toString(), | 
		
	
		
			
				|  |  |  |  |             //           onSuccess: (value) async { | 
		
	
		
			
				|  |  |  |  |             //             if (widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment!) { | 
		
	
		
			
				|  |  |  |  |             //               //TODO: Implement LiveCare Check-In API Call | 
		
	
		
			
				|  |  |  |  |             //             } 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), () { | 
		
	
		
			
				|  |  |  |  |             //                       Navigator.of(context).pop(); | 
		
	
		
			
				|  |  |  |  |             //                       Navigator.pushAndRemoveUntil( | 
		
	
		
			
				|  |  |  |  |             //                           context, | 
		
	
		
			
				|  |  |  |  |             //                           CustomPageRoute( | 
		
	
		
			
				|  |  |  |  |             //                             page: LandingNavigation(), | 
		
	
		
			
				|  |  |  |  |             //                           ), | 
		
	
		
			
				|  |  |  |  |             //                               (r) => false); | 
		
	
		
			
				|  |  |  |  |             //                       Navigator.of(context).push( | 
		
	
		
			
				|  |  |  |  |             //                         CustomPageRoute(page: MyAppointmentsPage()), | 
		
	
		
			
				|  |  |  |  |             //                       ); | 
		
	
		
			
				|  |  |  |  |             //                     }); | 
		
	
		
			
				|  |  |  |  |             //                   }); | 
		
	
		
			
				|  |  |  |  |             //             } | 
		
	
		
			
				|  |  |  |  |             //           }); | 
		
	
		
			
				|  |  |  |  |             //     }); | 
		
	
		
			
				|  |  |  |  |         } else { | 
		
	
		
			
				|  |  |  |  |           showCommonBottomSheetWithoutHeight( | 
		
	
		
			
				|  |  |  |  |             context, | 
		
	
	
		
			
				
					|  |  |  | @ -380,6 +338,86 @@ class _WalletPaymentConfirmPageState extends State<WalletPaymentConfirmPage> { | 
		
	
		
			
				|  |  |  |  |             isCloseButtonVisible: true, | 
		
	
		
			
				|  |  |  |  |           ); | 
		
	
		
			
				|  |  |  |  |         } | 
		
	
		
			
				|  |  |  |  |       }, | 
		
	
		
			
				|  |  |  |  |     ); | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   onBrowserLoadStart(String url) { | 
		
	
		
			
				|  |  |  |  |     print("onBrowserLoadStart"); | 
		
	
		
			
				|  |  |  |  |     print(url); | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |     if (selectedPaymentMethod == "tamara") { | 
		
	
		
			
				|  |  |  |  |       if (Platform.isAndroid) { | 
		
	
		
			
				|  |  |  |  |         Uri uri = new Uri.dataFromString(url); | 
		
	
		
			
				|  |  |  |  |         // tamaraPaymentStatus = uri.queryParameters['status']!; | 
		
	
		
			
				|  |  |  |  |         // tamaraOrderID = uri.queryParameters['AuthorizePaymentId']!; | 
		
	
		
			
				|  |  |  |  |       } else { | 
		
	
		
			
				|  |  |  |  |         Uri uri = new Uri.dataFromString(url); | 
		
	
		
			
				|  |  |  |  |         // tamaraPaymentStatus = uri.queryParameters['paymentStatus']!; | 
		
	
		
			
				|  |  |  |  |         // tamaraOrderID = uri.queryParameters['orderId']!; | 
		
	
		
			
				|  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |     // if(selectedPaymentMethod != "TAMARA") { | 
		
	
		
			
				|  |  |  |  |     MyInAppBrowser.successURLS.forEach((element) { | 
		
	
		
			
				|  |  |  |  |       if (url.contains(element)) { | 
		
	
		
			
				|  |  |  |  |         browser?.close(); | 
		
	
		
			
				|  |  |  |  |         MyInAppBrowser.isPaymentDone = true; | 
		
	
		
			
				|  |  |  |  |         return; | 
		
	
		
			
				|  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |     }); | 
		
	
		
			
				|  |  |  |  |     // } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |     // if(selectedPaymentMethod != "TAMARA") { | 
		
	
		
			
				|  |  |  |  |     MyInAppBrowser.errorURLS.forEach((element) { | 
		
	
		
			
				|  |  |  |  |       if (url.contains(element)) { | 
		
	
		
			
				|  |  |  |  |         browser?.close(); | 
		
	
		
			
				|  |  |  |  |         MyInAppBrowser.isPaymentDone = false; | 
		
	
		
			
				|  |  |  |  |         return; | 
		
	
		
			
				|  |  |  |  |       } | 
		
	
		
			
				|  |  |  |  |     }); | 
		
	
		
			
				|  |  |  |  |     // } | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   onBrowserExit(bool isPaymentMade) async { | 
		
	
		
			
				|  |  |  |  |     print("onBrowserExit Called!!!!"); | 
		
	
		
			
				|  |  |  |  |     if (selectedPaymentMethod == "TAMARA") { | 
		
	
		
			
				|  |  |  |  |       // checkTamaraPaymentStatus(transID!, appo); | 
		
	
		
			
				|  |  |  |  |       // if (tamaraPaymentStatus != null && tamaraPaymentStatus.toLowerCase() == "approved") { | 
		
	
		
			
				|  |  |  |  |       //   updateTamaraRequestStatus("success", "14", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo); | 
		
	
		
			
				|  |  |  |  |       // } else { | 
		
	
		
			
				|  |  |  |  |       //   updateTamaraRequestStatus("Failed", "00", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), tamaraOrderID, num.parse(selectedInstallments), appo); | 
		
	
		
			
				|  |  |  |  |       // } | 
		
	
		
			
				|  |  |  |  |     } else { | 
		
	
		
			
				|  |  |  |  |       checkPaymentStatus(); | 
		
	
		
			
				|  |  |  |  |       // checkPaymentStatus(appo); | 
		
	
		
			
				|  |  |  |  |     } | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |   openPaymentURL(String paymentMethod) { | 
		
	
		
			
				|  |  |  |  |     browser = MyInAppBrowser(onExitCallback: onBrowserExit, onLoadStartCallback: onBrowserLoadStart, context: context); | 
		
	
		
			
				|  |  |  |  |     transID = Utils.getAdvancePaymentTransID(habibWalletVM.selectedHospital!.iD!, int.parse(habibWalletVM.fileNumber)); | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  |     browser?.openPaymentBrowser( | 
		
	
		
			
				|  |  |  |  |         habibWalletVM.walletRechargeAmount, | 
		
	
		
			
				|  |  |  |  |         "Advance Payment", | 
		
	
		
			
				|  |  |  |  |         transID, | 
		
	
		
			
				|  |  |  |  |         habibWalletVM.selectedHospital!.iD!.toString(), | 
		
	
		
			
				|  |  |  |  |         "CustID_${appState.getAuthenticatedUser()!.patientId.toString()}@HMG.com", | 
		
	
		
			
				|  |  |  |  |         selectedPaymentMethod, | 
		
	
		
			
				|  |  |  |  |         appState.getAuthenticatedUser()!.patientType.toString(), | 
		
	
		
			
				|  |  |  |  |         "${appState.getAuthenticatedUser()!.firstName} ${appState.getAuthenticatedUser()!.lastName}", | 
		
	
		
			
				|  |  |  |  |         appState.getAuthenticatedUser()!.patientId.toString(), | 
		
	
		
			
				|  |  |  |  |         appState.getAuthenticatedUser()!, | 
		
	
		
			
				|  |  |  |  |         browser!, | 
		
	
		
			
				|  |  |  |  |         false, | 
		
	
		
			
				|  |  |  |  |         "3", | 
		
	
		
			
				|  |  |  |  |         "0", | 
		
	
		
			
				|  |  |  |  |         context, | 
		
	
		
			
				|  |  |  |  |         "", | 
		
	
		
			
				|  |  |  |  |         "", | 
		
	
		
			
				|  |  |  |  |         "", | 
		
	
		
			
				|  |  |  |  |         "", | 
		
	
		
			
				|  |  |  |  |         "3"); | 
		
	
		
			
				|  |  |  |  |   } | 
		
	
		
			
				|  |  |  |  | } | 
		
	
	
		
			
				
					|  |  |  | 
 |