@ -768,24 +768,20 @@ class _BookSuccessState extends State<BookSuccess> {
applePayInsertRequest . clientRequestID = transID ;
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 = " CustID_ ${ projectViewModel . authenticatedUserObject. user. patientID } @HMG.com " ;
applePayInsertRequest . customerID = projectViewModel . authenticatedUserObject. user. patientID ;
applePayInsertRequest . customerName = projectViewModel . authenticatedUserObject. user. firstName ! + " " + projectViewModel ! . authenticatedUserObject . user ! . lastName ! ;
applePayInsertRequest . customerEmail = " CustID_ ${ projectViewModel . user. patientID } @HMG.com " ;
applePayInsertRequest . customerID = projectViewModel . user. patientID ;
applePayInsertRequest . customerName = projectViewModel . user. firstName ! + " " + projectViewModel . 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 =
ServiceTypeEnum . advancePayment . getIdFromServiceEnum ( ) . toString ( ) ;
applePayInsertRequest . serviceID = ServiceTypeEnum . appointmentPayment . getIdFromServiceEnum ( ) . toString ( ) ;
applePayInsertRequest . channelID = 3 ;
applePayInsertRequest . patientID =
projectViewModel . authenticatedUserObject . user . patientID ;
applePayInsertRequest . patientTypeID =
projectViewModel . authenticatedUserObject . user . patientType ;
applePayInsertRequest . patientOutSA =
projectViewModel . authenticatedUserObject . user . outSA ;
applePayInsertRequest . patientID = projectViewModel . user . patientID ;
applePayInsertRequest . patientTypeID = projectViewModel . user . patientType ;
applePayInsertRequest . patientOutSA = projectViewModel . user . outSA ;
applePayInsertRequest . appointmentDate = appo . appointmentDate ;
applePayInsertRequest . appointmentNo = appo . appointmentNo ;
applePayInsertRequest . orderDescription = " Appointment Payment " ;
@ -797,12 +793,9 @@ class _BookSuccessState extends State<BookSuccess> {
applePayInsertRequest . isSchedule = appo . isLiveCareAppointment ! ? " 1 " : " 0 " ;
applePayInsertRequest . language = projectViewModel . isArabic ? ' ar ' : ' en ' ;
applePayInsertRequest . languageID = projectViewModel . isArabic ? 1 : 2 ;
applePayInsertRequest . userName =
projectViewModel . authenticatedUserObject . user . patientID ;
applePayInsertRequest . responseContinueURL =
" http://hmg.com/Documents/success.html " ;
applePayInsertRequest . backClickUrl =
" http://hmg.com/Documents/success.html " ;
applePayInsertRequest . userName = projectViewModel . user . patientID ;
applePayInsertRequest . responseContinueURL = " http://hmg.com/Documents/success.html " ;
applePayInsertRequest . backClickUrl = " http://hmg.com/Documents/success.html " ;
applePayInsertRequest . paymentOption = " ApplePay " ;
applePayInsertRequest . isMobSDK = true ;
@ -822,21 +815,21 @@ 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 ! ,
customerName: projectViewModel . user. firstName ! + " " + projectViewModel . user . lastName ! ,
/ / customerEmail: projectViewModel . authenticatedUserObject . user . emailAddress ,
customerEmail: " CustID_ ${ projectViewModel . authenticatedUserObject. user. patientID } @HMG.com " ,
customerEmail: " CustID_ ${ projectViewModel . 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 " ,
currency: projectViewModel . 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 ) ;
await context . read < PayfortViewModel > ( ) . addPayfortApplePayResponse ( projectViewModel . user . patientID ! , result: successResult ) ;
checkPaymentStatus ( appo ) ;
} ,
projectId: appo . projectID ,
@ -912,13 +905,13 @@ class _BookSuccessState extends State<BookSuccess> {
onBrowserExit ( AppoitmentAllHistoryResultList appo , bool isPaymentMade ) {
try {
if ( selectedPaymentMethod = = " TAMARA " ) {
checkTamaraPaymentStatus ( U tils. getAppointmentT ransID( appo . projectID ! , appo . clinicID ! , appo . appointmentNo ! ) , 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 ! = null ? tamaraOrderID : " " , num . parse ( selectedInstallments ) , appo ) ;
/ / }
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 ! ! = null ? tamaraOrderID ! : " " , num . parse ( selectedInstallments ! ) , appo ) ;
}
} else {
checkPaymentStatus ( appo ) ;
}
@ -954,7 +947,7 @@ class _BookSuccessState extends State<BookSuccess> {
} ) ;
}
updateTamaraRequestStatus ( String responseMessage , String status , String clientRequestID , String tamaraOrderID , int selectedInstallments , AppoitmentAllHistoryResultList appo ) {
updateTamaraRequestStatus ( String responseMessage , String status , String clientRequestID , String tamaraOrderID , num selectedInstallments , AppoitmentAllHistoryResultList appo ) {
GifLoaderDialogUtils . showMyDialog ( context ) ;
try {
DoctorsListService service = new DoctorsListService ( ) ;