@ -1155,7 +1155,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
onBrowserExit ( AppoitmentAllHistoryResultList appo , bool isPaymentMade ) {
onBrowserExit ( AppoitmentAllHistoryResultList appo , bool isPaymentMade ) {
print ( " onBrowserExit Called!!!! " ) ;
print ( " onBrowserExit Called!!!! " ) ;
if ( selectedPaymentMethod = = " TAMARA " ) {
if ( selectedPaymentMethod = = " TAMARA " ) {
checkTamaraPaymentStatus ( U tils. getAppointmentT ransID( appo . projectID ! , appo . clinicID ! , appo . appointmentNo ! ) , appo ) ;
checkTamaraPaymentStatus ( transID! , appo ) ;
/ / if ( tamaraPaymentStatus ! = null & & tamaraPaymentStatus . toLowerCase ( ) = = " approved " ) {
/ / if ( tamaraPaymentStatus ! = null & & tamaraPaymentStatus . toLowerCase ( ) = = " approved " ) {
/ / updateTamaraRequestStatus ( " success " , " 14 " , Utils . getAppointmentTransID ( appo . projectID , appo . clinicID , appo . appointmentNo ) , tamaraOrderID , num . parse ( selectedInstallments ) , appo ) ;
/ / updateTamaraRequestStatus ( " success " , " 14 " , Utils . getAppointmentTransID ( appo . projectID , appo . clinicID , appo . appointmentNo ) , tamaraOrderID , num . parse ( selectedInstallments ) , appo ) ;
/ / } else {
/ / } else {
@ -1174,8 +1174,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
if ( res [ " status " ] . toString ( ) . toLowerCase ( ) = = " success " ) {
if ( res [ " status " ] . toString ( ) . toLowerCase ( ) = = " success " ) {
updateTamaraRequestStatus ( " success " , " 14 " , orderID , res [ " tamara_order_id " ] , int . parse ( selectedInstallments ! ) , appo ) ;
updateTamaraRequestStatus ( " success " , " 14 " , orderID , res [ " tamara_order_id " ] , int . parse ( selectedInstallments ! ) , appo ) ;
} else {
} else {
updateTamaraRequestStatus (
updateTamaraRequestStatus ( " Failed " , " 00 " , transID ! , tamaraOrderID ! = null ? tamaraOrderID : " " , int . parse ( selectedInstallments ) , appo ) ;
" Failed " , " 00 " , Utils . getAppointmentTransID ( appo . projectID ! , appo . clinicID ! , appo . appointmentNo ! ) , tamaraOrderID ! = null ? tamaraOrderID : " " , int . parse ( selectedInstallments ! ) , appo ) ;
}
}
} ) . catchError ( ( err ) {
} ) . catchError ( ( err ) {
GifLoaderDialogUtils . hideDialog ( context ) ;
GifLoaderDialogUtils . hideDialog ( context ) ;
@ -1309,10 +1308,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
addVIDARequestInsert ( String advanceNumber , String paymentReference , AppoitmentAllHistoryResultList appo ) {
addVIDARequestInsert ( String advanceNumber , String paymentReference , AppoitmentAllHistoryResultList appo ) {
GifLoaderDialogUtils . showMyDialog ( context ) ;
GifLoaderDialogUtils . showMyDialog ( context ) ;
DoctorsListService service = new DoctorsListService ( ) ;
DoctorsListService service = new DoctorsListService ( ) ;
service
service . insertVIDARequest ( appo . appointmentNo , appo . clinicID , appo . projectID , appo . serviceID , appo . doctorID , appo . appointmentDate ! , transID ! , projectViewModel . isArabic ? 1 : 2 , context ) . then ( ( res ) {
. insertVIDARequest ( appo . appointmentNo , appo . clinicID , appo . projectID , appo . serviceID , appo . doctorID , appo . appointmentDate ! ,
transID ! , projectViewModel . isArabic ? 1 : 2 , context )
. then ( ( res ) {
GifLoaderDialogUtils . hideDialog ( context ) ;
GifLoaderDialogUtils . hideDialog ( context ) ;
getPatientAppointmentHistory ( ) ;
getPatientAppointmentHistory ( ) ;
} ) . catchError ( ( err ) {
} ) . catchError ( ( err ) {
@ -1367,20 +1363,20 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
applePayInsertRequest . clientRequestID = transID ;
applePayInsertRequest . clientRequestID = transID ;
applePayInsertRequest . clinicID = appo . clinicID ;
applePayInsertRequest . clinicID = appo . clinicID ;
applePayInsertRequest . currency = projectViewModel . authenticatedUserObject. user. outSA = = 1 ? " AED " : " SAR " ;
applePayInsertRequest . currency = projectViewModel . 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 . customerEmail = " CustID_ ${ projectViewModel . user. patientID } @HMG.com " ;
applePayInsertRequest . customerID = projectViewModel . authenticatedUserObject. user. patientID ;
applePayInsertRequest . customerID = projectViewModel . user. patientID ;
applePayInsertRequest . customerName = projectViewModel . authenticatedUserObject. user. firstName ! + " " + projectViewModel . authenticatedUserObject. user! . lastName ! ;
applePayInsertRequest . customerName = projectViewModel . user. firstName ! + " " + projectViewModel . user. lastName ! ;
applePayInsertRequest . deviceToken = await AppSharedPreferences ( ) . getString ( PUSH_TOKEN ) ;
applePayInsertRequest . deviceToken = await AppSharedPreferences ( ) . getString ( PUSH_TOKEN ) ;
applePayInsertRequest . voipToken = await AppSharedPreferences ( ) . getString ( ONESIGNAL_APNS_TOKEN ) ;
applePayInsertRequest . voipToken = await AppSharedPreferences ( ) . getString ( ONESIGNAL_APNS_TOKEN ) ;
applePayInsertRequest . doctorID = appo . doctorID ;
applePayInsertRequest . doctorID = appo . doctorID ;
applePayInsertRequest . projectID = appo . projectID . toString ( ) ;
applePayInsertRequest . projectID = appo . projectID . toString ( ) ;
applePayInsertRequest . serviceID = ServiceTypeEnum . a dvance Payment. getIdFromServiceEnum ( ) . toString ( ) ;
applePayInsertRequest . serviceID = ServiceTypeEnum . a ppointment Payment. getIdFromServiceEnum ( ) . toString ( ) ;
applePayInsertRequest . channelID = 3 ;
applePayInsertRequest . channelID = 3 ;
applePayInsertRequest . patientID = projectViewModel . authenticatedUserObject. user. patientID ;
applePayInsertRequest . patientID = projectViewModel . user. patientID ;
applePayInsertRequest . patientTypeID = projectViewModel . authenticatedUserObject. user. patientType ;
applePayInsertRequest . patientTypeID = projectViewModel . user. patientType ;
applePayInsertRequest . patientOutSA = projectViewModel . authenticatedUserObject. user. outSA ;
applePayInsertRequest . patientOutSA = projectViewModel . user. outSA ;
applePayInsertRequest . appointmentDate = appo . appointmentDate ;
applePayInsertRequest . appointmentDate = appo . appointmentDate ;
applePayInsertRequest . appointmentNo = appo . appointmentNo ;
applePayInsertRequest . appointmentNo = appo . appointmentNo ;
applePayInsertRequest . orderDescription = " Appointment Payment " ;
applePayInsertRequest . orderDescription = " Appointment Payment " ;
@ -1391,7 +1387,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
applePayInsertRequest . isSchedule = appo . isLiveCareAppointment ! ? " 1 " : " 0 " ;
applePayInsertRequest . isSchedule = appo . isLiveCareAppointment ! ? " 1 " : " 0 " ;
applePayInsertRequest . language = projectViewModel . isArabic ? ' ar ' : ' en ' ;
applePayInsertRequest . language = projectViewModel . isArabic ? ' ar ' : ' en ' ;
applePayInsertRequest . languageID = projectViewModel . isArabic ? 1 : 2 ;
applePayInsertRequest . languageID = projectViewModel . isArabic ? 1 : 2 ;
applePayInsertRequest . userName = projectViewModel . authenticatedUserObject. user. patientID ;
applePayInsertRequest . userName = projectViewModel . user. patientID ;
applePayInsertRequest . responseContinueURL = " http://hmg.com/Documents/success.html " ;
applePayInsertRequest . responseContinueURL = " http://hmg.com/Documents/success.html " ;
applePayInsertRequest . backClickUrl = " http://hmg.com/Documents/success.html " ;
applePayInsertRequest . backClickUrl = " http://hmg.com/Documents/success.html " ;
applePayInsertRequest . paymentOption = " ApplePay " ;
applePayInsertRequest . paymentOption = " ApplePay " ;
@ -1408,21 +1404,21 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
service . applePayInsertRequest ( applePayInsertRequest , context ) . then ( ( res ) async {
service . applePayInsertRequest ( applePayInsertRequest , context ) . then ( ( res ) async {
await context . read < PayfortViewModel > ( ) . initiateApplePayWithPayfort (
await context . read < PayfortViewModel > ( ) . initiateApplePayWithPayfort (
customerName: projectViewModel . authenticatedUserObject. user. firstName ! + " " + projectViewModel . authenticatedUserObject . user . lastName ! ,
customerName: projectViewModel . user. firstName ! + " " + projectViewModel . user . lastName ! ,
/ / customerEmail: projectViewModel . authenticatedUserObject . user . emailAddress ,
/ / customerEmail: projectViewModel . authenticatedUserObject . user . emailAddress ,
customerEmail: " CustID_ ${ projectViewModel . authenticatedUserObject. user. patientID } @HMG.com " ,
customerEmail: " CustID_ ${ projectViewModel . user. patientID } @HMG.com " ,
orderDescription: " Appointment Payment " ,
orderDescription: " Appointment Payment " ,
orderAmount: double . parse ( patientShareResponse . patientShareWithTax . toString ( ) ) ,
orderAmount: double . parse ( patientShareResponse . patientShareWithTax . toString ( ) ) ,
merchantReference: transID ,
merchantReference: transID ,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel ,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel ,
currency: projectViewModel . authenticatedUserObject. user. outSA = = 1 ? " AED " : " SAR " ,
currency: projectViewModel . user. outSA = = 1 ? " AED " : " SAR " ,
onFailed: ( failureResult ) async {
onFailed: ( failureResult ) async {
log ( " failureResult: ${ failureResult . toString ( ) } " ) ;
log ( " failureResult: ${ failureResult . toString ( ) } " ) ;
AppToast . showErrorToast ( message: failureResult . toString ( ) ) ;
AppToast . showErrorToast ( message: failureResult . toString ( ) ) ;
} ,
} ,
onSuccess: ( successResult ) async {
onSuccess: ( successResult ) async {
log ( " Payfort: ${ successResult . responseMessage } " ) ;
log ( " Payfort: ${ successResult . responseMessage } " ) ;
await context . read < PayfortViewModel > ( ) . addPayfortApplePayResponse ( result: successResult ) ;
await context . read < PayfortViewModel > ( ) . addPayfortApplePayResponse ( projectViewModel . user . patientID ! , result: successResult ) ;
checkPaymentStatus ( appo ) ;
checkPaymentStatus ( appo ) ;
} ,
} ,
projectId: appo . projectID ,
projectId: appo . projectID ,