diff --git a/lib/analytics/flows/appointments.dart b/lib/analytics/flows/appointments.dart index 72ce8177..65fd415d 100644 --- a/lib/analytics/flows/appointments.dart +++ b/lib/analytics/flows/appointments.dart @@ -274,10 +274,10 @@ class Appointment{ // R053 // Note : - Payment flow beyond this step are same as listed under ‘Advance Payment’ section of this document - appointment_details_cancel({@required AppoitmentAllHistoryResultList appointment}){ + appointment_details_cancel({@required AppoitmentAllHistoryResultList appointment, appointment_type}){ logger('cancel_appointment', parameters: { 'flow_type' : GAnalytics.APPOINTMENT_DETAIL_FLOW_TYPE, - 'appointment_type' : appointment.appointmentType, + 'appointment_type' : appointment_type, 'clinic_type_online' : appointment.clinicName, 'hospital_name' : appointment.projectName, 'doctor_name' : (appointment.doctorName == null || appointment.doctorName == '') ? appointment.doctorNameObj : appointment.doctorName diff --git a/lib/config/config.dart b/lib/config/config.dart index 02ca3db1..b15f49a7 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,8 +20,8 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:3334/'; - var BASE_URL = 'https://uat.hmgwebservices.com/'; -// var BASE_URL = 'https://hmgwebservices.com/'; +// var BASE_URL = 'https://uat.hmgwebservices.com/'; +var BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs // var BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index a5f37d12..d10f9c74 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -46,6 +46,7 @@ class _BookSuccessState extends State { AuthenticatedUser authUser; ProjectViewModel projectViewModel; + String selectedPaymentMethod = ""; @override initState() { @@ -546,7 +547,7 @@ class _BookSuccessState extends State { openPayment(List paymentMethod, AuthenticatedUser authenticatedUser, double amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) async { widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context); - + selectedPaymentMethod = paymentMethod[0]; widget.browser.openPaymentBrowser( amount, "Appointment check in", @@ -615,10 +616,10 @@ class _BookSuccessState extends State { AppToast.showErrorToast(message: res['Response_Message']); projectViewModel.analytics.appointment.payment_fail( appointment_type: 'regular', - payment_method: payment_method, + payment_method: selectedPaymentMethod, clinic: appo.clinicName, hospital: appo.projectName, - txn_amount: "$amount", + txn_amount: widget.patientShareResponse.patientShareWithTax.toString(), txn_currency: currency, error_type: res['Response_Message']); } diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index f235c8b1..596b875e 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -614,7 +614,7 @@ class _AppointmentDetailsState extends State with SingleTick } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } - projectViewModel.analytics.appointment.appointment_details_cancel(appointment: widget.appo); + projectViewModel.analytics.appointment.appointment_details_cancel(appointment: widget.appo, appointment_type: widget.appo.isLiveCareAppointment ? "livecare" : "regular"); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 657829a8..6231d790 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -895,15 +895,32 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { } checkPaymentStatus(AppoitmentAllHistoryResultList appo) { + String txn_ref; + String amount; + String payment_method; + final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed'; GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context).then((res) { GifLoaderDialogUtils.hideDialog(context); String paymentInfo = res['Response_Message']; if (paymentInfo == 'Success') { + txn_ref = res['Merchant_Reference']; + amount = res['Amount']; + payment_method = res['PaymentMethod']; createAdvancePayment(res, appo); + projectViewModel.analytics.appointment.payment_success( + appointment_type: 'regular', payment_method: payment_method, clinic: appo.clinicName, hospital: appo.projectName, txn_amount: "$amount", txn_currency: currency, txn_number: txn_ref); } else { AppToast.showErrorToast(message: res['Response_Message']); + projectViewModel.analytics.appointment.payment_fail( + appointment_type: 'regular', + payment_method: payment_method, + clinic: appo.clinicName, + hospital: appo.projectName, + txn_amount: "$amount", + txn_currency: currency, + error_type: res['Response_Message']); } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index 80680df8..2006a900 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -42,6 +42,7 @@ import 'package:provider/provider.dart'; class ConfirmLogin extends StatefulWidget { final Function changePageViewIndex; final fromRegistration; + const ConfirmLogin({Key key, this.changePageViewIndex, this.fromRegistration = false}) : super(key: key); @override @@ -301,6 +302,7 @@ class _ConfirmLogin extends State { } int login_method = 0; + authenticateUser(int type, {int isActive}) { GifLoaderDialogUtils.showMyDialog(context); if (type == 2 || type == 3) { @@ -310,8 +312,8 @@ class _ConfirmLogin extends State { login_method = type; LoginRegistration.verificationMethod = type; - if(!widget.fromRegistration) - projectViewModel.analytics.loginRegistration.login_verfication(forRegistration: widget.fromRegistration); + // if(!widget.fromRegistration) + projectViewModel.analytics.loginRegistration.login_verfication(forRegistration: widget.fromRegistration); switch (type) { case 1: diff --git a/lib/pages/medical/prescriptions/prescription_items_page.dart b/lib/pages/medical/prescriptions/prescription_items_page.dart index 66102cf4..601e0a86 100644 --- a/lib/pages/medical/prescriptions/prescription_items_page.dart +++ b/lib/pages/medical/prescriptions/prescription_items_page.dart @@ -57,7 +57,7 @@ class PrescriptionItemsPage extends StatelessWidget { "", prescriptions.name, DateUtil.convertStringToDate(prescriptions.appointmentDate), - DateUtil.formatDateToTime(DateUtil.convertStringToDate(model.prescriptionReportEnhList[0].orderDate)), + DateUtil.formatDateToTime(DateUtil.convertStringToDate(model.prescriptionReportEnhList.length > 0 ? model.prescriptionReportEnhList[0].orderDate : model.prescriptionReportListINP[0].orderDate)), prescriptions.nationalityFlagURL, prescriptions.doctorRate, prescriptions.actualDoctorRate, diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 7b0b0161..062dfce8 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -37,13 +37,13 @@ class MyInAppBrowser extends InAppBrowser { // static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT - static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT + // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT - // static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE + static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE - static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT + // static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT - // static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store + static String PREAUTH_SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store // static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; diff --git a/pubspec.yaml b/pubspec.yaml index 0d80cd42..7c01f6d8 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -202,8 +202,6 @@ dependencies: sms_otp_auto_verify: ^2.1.0 flutter_ios_voip_kit: ^0.0.5 -# payfort_plugin: ^0.3.1 - dependency_overrides: provider : ^5.0.0 permission_handler : ^6.0.1+1