diff --git a/lib/core/api/api_client.dart b/lib/core/api/api_client.dart index 96b4d9f1..56eadd57 100644 --- a/lib/core/api/api_client.dart +++ b/lib/core/api/api_client.dart @@ -211,7 +211,7 @@ class ApiClientImp implements ApiClient { } body['TokenID'] = "@dm!n"; - // body['PatientID'] = 4772993; + // body['PatientID'] = 255375; // body['PatientID'] = 89754444; // body['PatientTypeID'] = 1; // body['PatientOutSA'] = 0; diff --git a/lib/core/api_consts.dart b/lib/core/api_consts.dart index 7e368079..04d0c962 100644 --- a/lib/core/api_consts.dart +++ b/lib/core/api_consts.dart @@ -988,7 +988,10 @@ var IS_DOCTOR_AVAILABLE_BY_CALENDAR_SCHEDULE = 'Services/OUTPs.svc/REST/HIS_IsDo //PAYFORT var getPayFortProjectDetails = "Services/PayFort_Serv.svc/REST/GetPayFortProjectDetails"; -var addPayFortApplePayResponse = "Services/PayFort_Serv.svc/REST/AddResponse"; + +var ADD_PAYFORT_REQUEST = "Services/PayFort_Serv.svc/REST/AddRequest"; +var ADD_PAYFORT_RESPONSE = "Services/PayFort_Serv.svc/REST/AddResponse"; + // var payFortEnvironment = FortEnvironment.production; // var applePayMerchantId = "merchant.com.hmgwebservices"; // var payFortEnvironment = FortEnvironment.test; diff --git a/lib/features/payfort/models/payfort_request_insert_model.dart b/lib/features/payfort/models/payfort_request_insert_model.dart new file mode 100644 index 00000000..56f354f5 --- /dev/null +++ b/lib/features/payfort/models/payfort_request_insert_model.dart @@ -0,0 +1,128 @@ +class PayfortRequestInsertModel { + String? accessCode; + String? commandType; + num? amount; + String? customerEmail; + String? orderDescription; + String? serviceID; + String? returnURL; + String? paymentOption; + String? clientRequestID; + String? projectID; + String? fileNumber; + String? customerName; + String? currency; + String? liveServiceID; + String? longitude; + String? latitude; + String? merchantReference; + String? merchantIdentifier; + String? deviceToken; + String? sHARequestPhase; + String? sHAResponsePhase; + String? signature; + String? language; + String? integrationId; + String? iPAdress; + String? isSchedule; + String? appointmentDate; + String? appointmentNo; + String? doctorID; + + PayfortRequestInsertModel( + {this.accessCode, + this.commandType, + this.amount, + this.customerEmail, + this.orderDescription, + this.serviceID, + this.returnURL, + this.paymentOption, + this.clientRequestID, + this.projectID, + this.fileNumber, + this.customerName, + this.currency, + this.liveServiceID, + this.longitude, + this.latitude, + this.merchantReference, + this.merchantIdentifier, + this.deviceToken, + this.sHARequestPhase, + this.sHAResponsePhase, + this.signature, + this.language, + this.integrationId, + this.iPAdress, + this.isSchedule, + this.appointmentDate, + this.appointmentNo, + this.doctorID}); + + PayfortRequestInsertModel.fromJson(Map json) { + accessCode = json['Access_code']; + commandType = json['CommandType']; + amount = json['Amount']; + customerEmail = json['CustomerEmail']; + orderDescription = json['OrderDescription']; + serviceID = json['Service_ID']; + returnURL = json['ReturnURL']; + paymentOption = json['PaymentOption']; + clientRequestID = json['ClientRequestID']; + projectID = json['ProjectID']; + fileNumber = json['FileNumber']; + customerName = json['CustomerName']; + currency = json['Currency']; + liveServiceID = json['Live_ServiceID']; + longitude = json['Longitude']; + latitude = json['Latitude']; + merchantReference = json['Merchant_Reference']; + merchantIdentifier = json['Merchant_Identifier']; + deviceToken = json['DeviceToken']; + sHARequestPhase = json['SHA_RequestPhase']; + sHAResponsePhase = json['SHA_ResponsePhase']; + signature = json['Signature']; + language = json['Language']; + integrationId = json['Integration_Id']; + iPAdress = json['IPAdress']; + isSchedule = json['IsSchedule']; + appointmentDate = json['AppointmentDate']; + appointmentNo = json['AppointmentNo']; + doctorID = json['DoctorID']; + } + + Map toJson() { + final Map data = new Map(); + data['Access_code'] = this.accessCode; + data['CommandType'] = this.commandType; + data['Amount'] = this.amount; + data['CustomerEmail'] = this.customerEmail; + data['OrderDescription'] = this.orderDescription; + data['Service_ID'] = this.serviceID; + data['ReturnURL'] = this.returnURL; + data['PaymentOption'] = this.paymentOption; + data['ClientRequestID'] = this.clientRequestID; + data['ProjectID'] = this.projectID; + data['FileNumber'] = this.fileNumber; + data['CustomerName'] = this.customerName; + data['Currency'] = this.currency; + data['Live_ServiceID'] = this.liveServiceID; + data['Longitude'] = this.longitude; + data['Latitude'] = this.latitude; + data['Merchant_Reference'] = this.merchantReference; + data['Merchant_Identifier'] = this.merchantIdentifier; + data['DeviceToken'] = this.deviceToken; + data['SHA_RequestPhase'] = this.sHARequestPhase; + data['SHA_ResponsePhase'] = this.sHAResponsePhase; + data['Signature'] = this.signature; + data['Language'] = this.language; + data['Integration_Id'] = this.integrationId; + data['IPAdress'] = this.iPAdress; + data['IsSchedule'] = this.isSchedule; + data['AppointmentDate'] = this.appointmentDate; + data['AppointmentNo'] = this.appointmentNo; + data['DoctorID'] = this.doctorID; + return data; + } +} diff --git a/lib/features/payfort/models/payfort_response_insert_model.dart b/lib/features/payfort/models/payfort_response_insert_model.dart new file mode 100644 index 00000000..452ca2a5 --- /dev/null +++ b/lib/features/payfort/models/payfort_response_insert_model.dart @@ -0,0 +1,77 @@ +class PayfortResponseInsertModel { + String? fortId; + String? commandType; + num? amount; + String? sadadOLP; + String? paymentOption; + String? customerIP; + String? eCI; + String? responseMessage; + String? cardNumber; + String? cardBin; + int? installmentsNumber; + String? status; + String? merchantRef; + bool? isRefund; + bool? remmeberMe; + String? reconciliationReference; + + PayfortResponseInsertModel({ + this.fortId, + this.commandType, + this.amount, + this.sadadOLP, + this.paymentOption, + this.customerIP, + this.eCI, + this.responseMessage, + this.cardNumber, + this.cardBin, + this.installmentsNumber, + this.status, + this.merchantRef, + this.isRefund, + this.remmeberMe, + this.reconciliationReference, + }); + + PayfortResponseInsertModel.fromJson(Map json) { + fortId = json['Fort_id']; + commandType = json['CommandType']; + amount = json['Amount']; + sadadOLP = json['Sadad_OLP']; + paymentOption = json['Payment_Option']; + customerIP = json['Customer_IP']; + eCI = json['ECI']; + responseMessage = json['Response_Message']; + cardNumber = json['Card_Number']; + cardBin = json['Card_Bin']; + installmentsNumber = json['Installments_Number']; + status = json['Status']; + merchantRef = json['Merchant_Ref']; + isRefund = json['IsRefund']; + remmeberMe = json['RemmeberMe']; + reconciliationReference = json['Reconciliation_Reference']; + } + + Map toJson() { + final Map data = Map(); + data['Fort_id'] = this.fortId; + data['CommandType'] = this.commandType; + data['Amount'] = this.amount; + data['Sadad_OLP'] = this.sadadOLP; + data['Payment_Option'] = this.paymentOption; + data['Customer_IP'] = this.customerIP; + data['ECI'] = this.eCI; + data['Response_Message'] = this.responseMessage; + data['Card_Number'] = this.cardNumber; + data['Card_Bin'] = this.cardBin; + data['Installments_Number'] = this.installmentsNumber; + data['Status'] = this.status; + data['Merchant_Ref'] = this.merchantRef; + data['IsRefund'] = this.isRefund; + data['RemmeberMe'] = this.remmeberMe; + data['Reconciliation_Reference'] = this.reconciliationReference; + return data; + } +} diff --git a/lib/features/payfort/payfort_repo.dart b/lib/features/payfort/payfort_repo.dart index c00b01c2..3cd27a9d 100644 --- a/lib/features/payfort/payfort_repo.dart +++ b/lib/features/payfort/payfort_repo.dart @@ -8,6 +8,8 @@ import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/ import 'package:hmg_patient_app_new/features/payfort/models/apple_pay_request_insert_model.dart'; import 'package:hmg_patient_app_new/features/payfort/models/payfort_check_payment_status_response_model.dart'; import 'package:hmg_patient_app_new/features/payfort/models/payfort_project_details_resp_model.dart'; +import 'package:hmg_patient_app_new/features/payfort/models/payfort_request_insert_model.dart'; +import 'package:hmg_patient_app_new/features/payfort/models/payfort_response_insert_model.dart'; import 'package:hmg_patient_app_new/features/payfort/models/sdk_token_response_model.dart'; import 'package:hmg_patient_app_new/services/logger_service.dart'; @@ -28,6 +30,10 @@ abstract class PayfortRepo { {required String responseMessage, required String status, required String clientRequestID, required String tamaraOrderID}); Future>> getTamaraInstallmentsDetails(); + + Future>> payfortRequestInsert({required PayfortRequestInsertModel payfortRequestInsertModel}); + + Future>> payfortResponseInsert({required PayfortResponseInsertModel payfortResponseInsertModel}); } class PayfortRepoImp implements PayfortRepo { @@ -291,4 +297,57 @@ class PayfortRepoImp implements PayfortRepo { } } + @override + Future> payfortRequestInsert({required PayfortRequestInsertModel payfortRequestInsertModel}) async { + try { + GenericApiModel? apiResponse; + Failure? failure; + await apiClient.post(ADD_PAYFORT_REQUEST, body: payfortRequestInsertModel.toJson(), onFailure: (error, statusCode, {messageStatus, failureType}) { + failure = failureType; + }, onSuccess: (response, statusCode, {messageStatus, errorMessage}) { + try { + apiResponse = GenericApiModel( + messageStatus: messageStatus, + statusCode: statusCode, + errorMessage: null, + data: response, + ); + } catch (e) { + failure = DataParsingFailure(e.toString()); + } + }, isAllowAny: true, isPaymentServices: true); + if (failure != null) return Left(failure!); + if (apiResponse == null) return Left(ServerFailure("Unknown error")); + return Right(apiResponse!); + } catch (e) { + return Left(UnknownFailure(e.toString())); + } + } + + @override + Future> payfortResponseInsert({required PayfortResponseInsertModel payfortResponseInsertModel}) async { + try { + GenericApiModel? apiResponse; + Failure? failure; + await apiClient.post(ADD_PAYFORT_RESPONSE, body: payfortResponseInsertModel.toJson(), onFailure: (error, statusCode, {messageStatus, failureType}) { + failure = failureType; + }, onSuccess: (response, statusCode, {messageStatus, errorMessage}) { + try { + apiResponse = GenericApiModel( + messageStatus: messageStatus, + statusCode: statusCode, + errorMessage: null, + data: response, + ); + } catch (e) { + failure = DataParsingFailure(e.toString()); + } + }, isAllowAny: true, isPaymentServices: true); + if (failure != null) return Left(failure!); + if (apiResponse == null) return Left(ServerFailure("Unknown error")); + return Right(apiResponse!); + } catch (e) { + return Left(UnknownFailure(e.toString())); + } + } } diff --git a/lib/features/payfort/payfort_view_model.dart b/lib/features/payfort/payfort_view_model.dart index aebb8d5f..fd0cfe10 100644 --- a/lib/features/payfort/payfort_view_model.dart +++ b/lib/features/payfort/payfort_view_model.dart @@ -8,11 +8,15 @@ import 'package:flutter/services.dart'; import 'package:flutter_amazonpaymentservices/flutter_amazonpaymentservices.dart'; import 'package:hmg_patient_app_new/core/api_consts.dart'; import 'package:hmg_patient_app_new/core/app_state.dart'; +import 'package:hmg_patient_app_new/core/cache_consts.dart'; import 'package:hmg_patient_app_new/core/dependencies.dart'; +import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/features/my_appointments/models/resp_models/get_tamara_installments_details_response_model.dart'; import 'package:hmg_patient_app_new/features/payfort/models/apple_pay_request_insert_model.dart'; import 'package:hmg_patient_app_new/features/payfort/models/payfort_check_payment_status_response_model.dart'; import 'package:hmg_patient_app_new/features/payfort/models/payfort_project_details_resp_model.dart'; +import 'package:hmg_patient_app_new/features/payfort/models/payfort_request_insert_model.dart'; +import 'package:hmg_patient_app_new/features/payfort/models/payfort_response_insert_model.dart'; import 'package:hmg_patient_app_new/features/payfort/models/sdk_token_response_model.dart'; import 'package:hmg_patient_app_new/features/payfort/payfort_repo.dart'; import 'package:hmg_patient_app_new/services/error_handler_service.dart'; @@ -92,6 +96,44 @@ class PayfortViewModel extends ChangeNotifier { ); } + Future payfortRequestInsert({required PayfortRequestInsertModel payfortRequestInsertModel, Function(dynamic)? onSuccess, Function(String)? onError}) async { + final result = await payfortRepo.payfortRequestInsert(payfortRequestInsertModel: payfortRequestInsertModel); + + result.fold( + (failure) async => await errorHandlerService.handleError(failure: failure), + (apiResponse) { + if (apiResponse.messageStatus == 2) { + // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); + } else if (apiResponse.messageStatus == 1) { + // payfortProjectDetailsRespModel = apiResponse.data!; + notifyListeners(); + if (onSuccess != null) { + onSuccess(apiResponse); + } + } + }, + ); + } + + Future payfortResponseInsert({required PayfortResponseInsertModel payfortResponseInsertModel, Function(dynamic)? onSuccess, Function(String)? onError}) async { + final result = await payfortRepo.payfortResponseInsert(payfortResponseInsertModel: payfortResponseInsertModel); + + result.fold( + (failure) async => await errorHandlerService.handleError(failure: failure), + (apiResponse) { + if (apiResponse.messageStatus == 2) { + // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); + } else if (apiResponse.messageStatus == 1) { + // payfortProjectDetailsRespModel = apiResponse.data!; + notifyListeners(); + if (onSuccess != null) { + onSuccess(apiResponse); + } + } + }, + ); + } + Future checkPaymentStatus({required String transactionID, Function(dynamic)? onSuccess, Function(String)? onError}) async { final result = await payfortRepo.checkPaymentStatus(transactionID: transactionID); @@ -291,13 +333,19 @@ class PayfortViewModel extends ChangeNotifier { } Future initiatePaymentWithCard( // var request, { - { + String paymentOption, + String liveServiceID, + String isScheduleLiveCare, + String appointmentDate, + String appointmentNo, + String doctorID, { SucceededCallback? onSucceeded, FailedCallback? onFailed, String countryIsoCode = "SA", String transactionID = "", String amount = "0", String fileNumber = "0", + String orderDescription = "", }) async { dynamic paymentResult; @@ -325,6 +373,38 @@ class PayfortViewModel extends ChangeNotifier { "customer_name": "${getIt.get().getAuthenticatedUser()!.firstName} ${getIt.get().getAuthenticatedUser()!.lastName}", }; + PayfortRequestInsertModel payfortRequestInsertModel = PayfortRequestInsertModel(); + + payfortRequestInsertModel.accessCode = payfortProjectDetailsRespModel!.accessCode; + payfortRequestInsertModel.commandType = "PURCHASE"; + payfortRequestInsertModel.amount = num.parse(amount); + payfortRequestInsertModel.customerEmail = getIt.get().getAuthenticatedUser()!.emailAddress; + payfortRequestInsertModel.orderDescription = orderDescription; + payfortRequestInsertModel.serviceID = payfortProjectDetailsRespModel!.servID.toString(); + payfortRequestInsertModel.paymentOption = paymentOption; + payfortRequestInsertModel.clientRequestID = transactionID; + payfortRequestInsertModel.projectID = payfortProjectDetailsRespModel!.projectID.toString(); + payfortRequestInsertModel.fileNumber = getIt.get().getAuthenticatedUser()!.patientId.toString(); + payfortRequestInsertModel.customerName = "${getIt.get().getAuthenticatedUser()!.firstName} ${getIt.get().getAuthenticatedUser()!.lastName}"; + payfortRequestInsertModel.currency = getIt.get().getAuthenticatedUser()!.outSa! == 0 ? "SAR" : "AED"; + payfortRequestInsertModel.liveServiceID = liveServiceID; + payfortRequestInsertModel.latitude = getIt.get().userLat.toString(); + payfortRequestInsertModel.longitude = getIt.get().userLong.toString(); + payfortRequestInsertModel.merchantReference = transactionID; + payfortRequestInsertModel.merchantIdentifier = payfortProjectDetailsRespModel!.merchantIdentifier; + payfortRequestInsertModel.deviceToken = await Utils.getStringFromPrefs(CacheConst.pushToken); + payfortRequestInsertModel.sHARequestPhase = payfortProjectDetailsRespModel!.shaRequest; + payfortRequestInsertModel.sHAResponsePhase = payfortProjectDetailsRespModel!.shaResponse; + payfortRequestInsertModel.signature = sdkTokenResponse!.signature; + payfortRequestInsertModel.language = getIt.get().isArabic() ? "ar" : "en"; + payfortRequestInsertModel.integrationId = "1"; + payfortRequestInsertModel.isSchedule = isScheduleLiveCare; + payfortRequestInsertModel.appointmentDate = appointmentDate; + payfortRequestInsertModel.appointmentNo = appointmentNo; + payfortRequestInsertModel.doctorID = doctorID; + + await payfortRequestInsert(payfortRequestInsertModel: payfortRequestInsertModel); + LoaderBottomSheet.hideLoader(); paymentResult = await FlutterAmazonpaymentservices.normalPay(request, ApiConsts.payFortEnvironmentType, isShowResponsePage: false); @@ -332,6 +412,27 @@ class PayfortViewModel extends ChangeNotifier { String responseCode = paymentMap['response_code'] ?? ""; print("Payment Success Data: ${paymentMap.toString()}"); + PayfortResponseInsertModel payfortResponseInsertModel = PayfortResponseInsertModel(); + + payfortResponseInsertModel.fortId = paymentMap['fort_id'] ?? ""; + payfortResponseInsertModel.commandType = paymentMap['command'] ?? ""; + payfortResponseInsertModel.amount = num.tryParse(paymentMap['amount'] ?? "0") ?? 0; + payfortResponseInsertModel.sadadOLP = ""; + payfortResponseInsertModel.paymentOption = paymentMap['payment_option'] ?? ""; + payfortResponseInsertModel.customerIP = paymentMap['customer_ip'] ?? ""; + payfortResponseInsertModel.eCI = paymentMap['eci'] ?? ""; + payfortResponseInsertModel.responseMessage = paymentMap['response_message'] ?? ""; + payfortResponseInsertModel.cardNumber = paymentMap['card_number'] ?? ""; + payfortResponseInsertModel.cardBin = paymentMap['card_bin'] ?? ""; + payfortResponseInsertModel.installmentsNumber = int.tryParse(paymentMap['installments_number'] ?? "0") ?? 0; + payfortResponseInsertModel.status = paymentMap['status'] ?? ""; + payfortResponseInsertModel.merchantRef = paymentMap['merchant_reference'] ?? ""; + payfortResponseInsertModel.isRefund = false; + payfortResponseInsertModel.remmeberMe = true; + payfortResponseInsertModel.reconciliationReference = ""; + + await payfortResponseInsert(payfortResponseInsertModel: payfortResponseInsertModel); + if (responseCode.startsWith("14") || responseCode == "20064") { if (onSucceeded != null) { onSucceeded(PayFortResult.fromMap(paymentMap)); diff --git a/lib/presentation/appointments/appointment_payment_page.dart b/lib/presentation/appointments/appointment_payment_page.dart index b3814f00..66c88a28 100644 --- a/lib/presentation/appointments/appointment_payment_page.dart +++ b/lib/presentation/appointments/appointment_payment_page.dart @@ -228,8 +228,15 @@ class _AppointmentPaymentPageState extends State { serviceId: ServiceTypeEnum.appointmentPayment.getIdFromServiceEnum(), projectId: widget.patientAppointmentHistoryResponseModel.projectID, integrationId: 1); payfortViewModel.initiatePaymentWithCard( + "mada", + "0", + widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment! ? "true" : "false", + widget.patientAppointmentHistoryResponseModel.appointmentDate!, + widget.patientAppointmentHistoryResponseModel.appointmentNo!, + widget.patientAppointmentHistoryResponseModel.doctorID!, transactionID: transID, fileNumber: appState.getAuthenticatedUser()!.patientId.toString(), + orderDescription: "Appointment Payment", amount: myAppointmentsViewModel.patientAppointmentShareResponseModel!.patientShareWithTax!.toString(), onSucceeded: (paymentResult) async { print("Payment Success Data: ${paymentResult.toString()}"); @@ -444,9 +451,16 @@ class _AppointmentPaymentPageState extends State { serviceId: ServiceTypeEnum.appointmentPayment.getIdFromServiceEnum(), projectId: widget.patientAppointmentHistoryResponseModel.projectID, integrationId: 1); payfortViewModel.initiatePaymentWithCard( + "visa", + "0", + widget.patientAppointmentHistoryResponseModel.isLiveCareAppointment! ? "true" : "false", + widget.patientAppointmentHistoryResponseModel.appointmentDate!, + widget.patientAppointmentHistoryResponseModel.appointmentNo!, + widget.patientAppointmentHistoryResponseModel.doctorID!, transactionID: transID, fileNumber: appState.getAuthenticatedUser()!.patientId.toString(), amount: myAppointmentsViewModel.patientAppointmentShareResponseModel!.patientShareWithTax!.toString(), + orderDescription: "Appointment Payment", onSucceeded: (paymentResult) async { print("Payment Success Data: ${paymentResult.toString()}"); LoaderBottomSheet.showLoader(loadingText: LocaleKeys.checkingPaymentStatusPleaseWait.tr(context: context)); diff --git a/lib/presentation/book_appointment/livecare/immediate_livecare_payment_page.dart b/lib/presentation/book_appointment/livecare/immediate_livecare_payment_page.dart index 04fd3073..972606a9 100644 --- a/lib/presentation/book_appointment/livecare/immediate_livecare_payment_page.dart +++ b/lib/presentation/book_appointment/livecare/immediate_livecare_payment_page.dart @@ -184,9 +184,16 @@ class _ImmediateLiveCarePaymentPageState extends State { serviceId: ServiceTypeEnum.advancePayment.getIdFromServiceEnum(), projectId: habibWalletVM.selectedHospital!.iD!, integrationId: 1); payfortViewModel.initiatePaymentWithCard( + "mada", + "0", + "false", + DateUtil.convertDateToString(DateTime.now()), + "0", + "0", transactionID: transID, fileNumber: habibWalletVM.fileNumber.toString(), amount: habibWalletVM.walletRechargeAmount.toString(), + orderDescription: "Advance Payment", onSucceeded: (paymentResult) async { print("Payment Success Data: ${paymentResult.toString()}"); LoaderBottomSheet.showLoader(); @@ -204,7 +212,7 @@ class _WalletPaymentConfirmPageState extends State { habibWalletVM.setIsWalletAmountToBeLoaded(true); habibWalletVM.initHabibWalletProvider(); habibWalletVM.getPatientBalanceAmount(); - Navigator.of(getIt.get().navigatorKey.currentContext!).pop(); + // Navigator.of(getIt.get().navigatorKey.currentContext!).pop(); Navigator.of(getIt.get().navigatorKey.currentContext!).pop(); }, isFullScreen: false, isCloseButtonVisible: true, isAutoDismiss: true); }, @@ -353,9 +361,16 @@ class _WalletPaymentConfirmPageState extends State { serviceId: ServiceTypeEnum.advancePayment.getIdFromServiceEnum(), projectId: habibWalletVM.selectedHospital!.iD!, integrationId: 1); payfortViewModel.initiatePaymentWithCard( + "visa", + "0", + "false", + DateUtil.convertDateToString(DateTime.now()), + "0", + "0", transactionID: transID, fileNumber: habibWalletVM.fileNumber.toString(), amount: habibWalletVM.walletRechargeAmount.toString(), + orderDescription: "Advance Payment", onSucceeded: (paymentResult) async { print("Payment Success Data: ${paymentResult.toString()}"); LoaderBottomSheet.showLoader(); @@ -380,7 +395,7 @@ class _WalletPaymentConfirmPageState extends State { habibWalletVM.initHabibWalletProvider(); habibWalletVM.getPatientBalanceAmount(); Navigator.of(getIt.get().navigatorKey.currentContext!).pop(); - Navigator.of(getIt.get().navigatorKey.currentContext!).pop(); + // Navigator.of(getIt.get().navigatorKey.currentContext!).pop(); }, isFullScreen: false, isCloseButtonVisible: true, isAutoDismiss: true); }, onError: (err) { diff --git a/lib/presentation/todo_section/ancillary_order_payment_page.dart b/lib/presentation/todo_section/ancillary_order_payment_page.dart index 99ed0928..ae0a4c02 100644 --- a/lib/presentation/todo_section/ancillary_order_payment_page.dart +++ b/lib/presentation/todo_section/ancillary_order_payment_page.dart @@ -171,9 +171,16 @@ class _AncillaryOrderPaymentPageState extends State { ); payfortViewModel.initiatePaymentWithCard( + "mada", + "0", + "false", + DateUtil.convertDateToString(DateTime.now()), + "0", + "0", transactionID: transID, fileNumber: appState.getAuthenticatedUser()!.patientId.toString(), amount: widget.totalAmount.toString(), + orderDescription: "Ancillary Order Payment", onSucceeded: (paymentResult) async { print("Payment Success Data: ${paymentResult.toString()}"); LoaderBottomSheet.showLoader(loadingText: LocaleKeys.checkingPaymentStatusPleaseWait.tr(context: context)); @@ -286,9 +293,16 @@ class _AncillaryOrderPaymentPageState extends State { ); payfortViewModel.initiatePaymentWithCard( + "visa", + "0", + "false", + DateUtil.convertDateToString(DateTime.now()), + "0", + "0", transactionID: transID, fileNumber: appState.getAuthenticatedUser()!.patientId.toString(), amount: widget.totalAmount.toString(), + orderDescription: "Ancillary Order Payment", onSucceeded: (paymentResult) async { print("Payment Success Data: ${paymentResult.toString()}"); LoaderBottomSheet.showLoader(loadingText: LocaleKeys.checkingPaymentStatusPleaseWait.tr(context: context));