@ -748,7 +748,8 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
return Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
( myAppointmentsVM . patientAppointmentShareResponseModel ! . isCash ? ? true )
/ / ( myAppointmentsVM . patientAppointmentShareResponseModel ! . isCash ? ? true )
( true )
? Container (
height: 50. h ,
decoration: ShapeDecoration (
@ -1282,6 +1283,7 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
currency: appState . getAuthenticatedUser ( ) ! . outSa ! = = 0 ? " SAR " : " AED " ,
onFailed: ( failureResult ) async {
log ( " failureResult: ${ failureResult . message . toString ( ) } " ) ;
payfortViewModel . addApplePayPayfortResponse ( failureResult . response ) ;
LoaderBottomSheet . hideLoader ( ) ;
showCommonBottomSheetWithoutHeight (
context ,
@ -1292,10 +1294,94 @@ class _AppointmentPaymentPageState extends State<AppointmentPaymentPage> {
) ;
} ,
onSucceeded: ( successResult ) async {
payfortViewModel . addApplePayPayfortResponse ( successResult ) ;
LoaderBottomSheet . hideLoader ( ) ;
log ( " successResult: ${ successResult . responseMessage . toString ( ) } " ) ;
selectedPaymentMethod = successResult . paymentOption ? ? " VISA " ;
checkPaymentStatus ( ) ;
/ / LoaderBottomSheet . showLoader ( loadingText: LocaleKeys . checkingPaymentStatusPleaseWait . tr ( context: context ) ) ;
/ / 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: successResult . fortId ! ,
/ / patientID: appState . getAuthenticatedUser ( ) ! . patientId . toString ( ) ,
/ / patientType: appState . getAuthenticatedUser ( ) ! . patientType ! ,
/ / 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: successResult . fortId ! ,
/ / 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 ) ;
/ /
/ / getIt . get < HabibWalletViewModel > ( ) . setIsWalletAmountToBeLoaded ( true ) ;
/ / getIt . get < HabibWalletViewModel > ( ) . initHabibWalletProvider ( ) ;
/ / getIt . get < HabibWalletViewModel > ( ) . getPatientBalanceAmount ( ) ;
/ /
/ / LoaderBottomSheet . hideLoader ( ) ;
/ / 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 ( ) ;
/ /
/ / 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 ,
/ / ) ;
/ / } ) ;
} ,
/ / projectId: appo . projectID ,
/ / serviceTypeEnum: ServiceTypeEnum . appointmentPayment ,