diff --git a/lib/config/config.dart b/lib/config/config.dart index fde4f255..c09f2cd2 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -405,7 +405,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnar var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 8.5; +var VERSION_ID = 8.6; var SETUP_ID = '91877'; var LANGUAGE = 2; var PATIENT_OUT_SA = 0; diff --git a/lib/core/model/prescriptions/prescription_report.dart b/lib/core/model/prescriptions/prescription_report.dart index 3eb30825..adad640e 100644 --- a/lib/core/model/prescriptions/prescription_report.dart +++ b/lib/core/model/prescriptions/prescription_report.dart @@ -23,7 +23,7 @@ class PrescriptionReport { String patientName; String phoneOffice1; String prescriptionQR; - int prescriptionTimes; + num prescriptionTimes; String productImage; String productImageBase64; String productImageString; diff --git a/lib/core/model/prescriptions/prescription_report_enh.dart b/lib/core/model/prescriptions/prescription_report_enh.dart index a43c56b2..a07a30c4 100644 --- a/lib/core/model/prescriptions/prescription_report_enh.dart +++ b/lib/core/model/prescriptions/prescription_report_enh.dart @@ -22,7 +22,7 @@ class PrescriptionReportEnh { String patientName; String phoneOffice1; Null prescriptionQR; - int prescriptionTimes; + num prescriptionTimes; Null productImage; Null productImageBase64; String productImageString; diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 55684afe..d4ca669a 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -14,7 +14,6 @@ import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart' import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; -import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:http/http.dart' as http; @@ -410,7 +409,11 @@ class BaseAppClient { } Future navigateToAppUpdate(context, String text) async { - Navigator.pushReplacement(context, FadePage(page: AppUpdatePage(appUpdateText: text))); + Navigator.pushAndRemoveUntil( + context, + MaterialPageRoute(builder: (context) => AppUpdatePage(appUpdateText: text)), + (Route route) => false, + ); } get(String endPoint, diff --git a/lib/pages/ToDoList/payment_method_select.dart b/lib/pages/ToDoList/payment_method_select.dart index 46cad3aa..3c1e8745 100644 --- a/lib/pages/ToDoList/payment_method_select.dart +++ b/lib/pages/ToDoList/payment_method_select.dart @@ -199,55 +199,55 @@ class _PaymentMethodState extends State { ), ), if (projectViewModel.havePrivilege(90)) - // Container( - // width: double.infinity, - // child: InkWell( - // onTap: () { - // updateSelectedPaymentMethod("TAMARA"); - // }, - // child: Card( - // elevation: 0.0, - // margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), - // color: Colors.white, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(10), - // side: selectedPaymentMethod == "TAMARA" ? BorderSide(color: Colors.green, width: 2.0) : BorderSide(color: Colors.transparent, width: 0.0), - // ), - // child: Padding( - // padding: const EdgeInsets.all(12.0), - // child: Row( - // children: [ - // Container( - // width: 24, - // height: 24, - // decoration: containerColorRadiusBorderWidth(selectedPaymentMethod == "TAMARA" ? CustomColors.accentColor : Colors.transparent, 100, Colors.grey, 0.5), - // ), - // mWidth(12), - // Container( - // height: 60.0, - // padding: EdgeInsets.all(0.0), - // width: 60, - // child: Image.asset("assets/images/new/payment/tamara.png"), - // ), - // mFlex(1), - // if (selectedPaymentMethod == "TAMARA") - // Container( - // decoration: containerRadius(CustomColors.green, 200), - // padding: EdgeInsets.only(top: 6, bottom: 6, left: 12, right: 12), - // child: Text( - // TranslationBase.of(context).paymentSelected, - // style: TextStyle( - // color: Colors.white, - // fontSize: 11, - // ), - // ), - // ), - // ], - // ), - // ), - // ), - // ), - // ), + Container( + width: double.infinity, + child: InkWell( + onTap: () { + updateSelectedPaymentMethod("TAMARA"); + }, + child: Card( + elevation: 0.0, + margin: EdgeInsets.fromLTRB(8.0, 16.0, 8.0, 8.0), + color: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + side: selectedPaymentMethod == "TAMARA" ? BorderSide(color: Colors.green, width: 2.0) : BorderSide(color: Colors.transparent, width: 0.0), + ), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Row( + children: [ + Container( + width: 24, + height: 24, + decoration: containerColorRadiusBorderWidth(selectedPaymentMethod == "TAMARA" ? CustomColors.accentColor : Colors.transparent, 100, Colors.grey, 0.5), + ), + mWidth(12), + Container( + height: 60.0, + padding: EdgeInsets.all(0.0), + width: 60, + child: Image.asset("assets/images/new/payment/tamara.png"), + ), + mFlex(1), + if (selectedPaymentMethod == "TAMARA") + Container( + decoration: containerRadius(CustomColors.green, 200), + padding: EdgeInsets.only(top: 6, bottom: 6, left: 12, right: 12), + child: Text( + TranslationBase.of(context).paymentSelected, + style: TextStyle( + color: Colors.white, + fontSize: 11, + ), + ), + ), + ], + ), + ), + ), + ), + ), if (widget.isShowInstallments && projectViewModel.havePrivilege(91)) Container( width: double.infinity, @@ -382,6 +382,7 @@ class _PaymentMethodState extends State { ], ), ), + if(tamaraInstallmentDetails != null) Column( children: [ ...List.generate( diff --git a/lib/pages/appUpdatePage/app_update_page.dart b/lib/pages/appUpdatePage/app_update_page.dart index 06ef0a38..7ef1b6ff 100644 --- a/lib/pages/appUpdatePage/app_update_page.dart +++ b/lib/pages/appUpdatePage/app_update_page.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:in_app_update/in_app_update.dart'; import 'package:url_launcher/url_launcher.dart'; class AppUpdatePage extends StatefulWidget { @@ -93,7 +94,17 @@ class _AppUpdatePageState extends State { openAppUpdateLink() { if (Platform.isAndroid) { - _launchURL("https://play.google.com/store/apps/details?id=com.ejada.hmg"); + // _launchURL("https://play.google.com/store/apps/details?id=com.ejada.hmg"); + InAppUpdate.checkForUpdate().then((info) { + print("checkForUpdate!!!"); + print(info.toString()); + if (info.immediateUpdateAllowed) { + print("Immediate Allowed!!!"); + InAppUpdate.performImmediateUpdate().then((value) {}).catchError((e) => print(e.toString())); + } + }).catchError((e) { + print(e.toString()); + }); } if (Platform.isIOS) { _launchURL("https://itunes.apple.com/app/id733503978"); diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index 1dd94400..a3300122 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -51,6 +51,8 @@ class _ConfirmPaymentPageState extends State { String transID = ""; + String tamaraPaymentStatus; + String tamaraOrderID; Pay _payClient; @override @@ -378,6 +380,14 @@ class _ConfirmPaymentPageState extends State { print("onBrowserLoadStart"); print(url); + if (widget.selectedPaymentMethod == "TAMARA") { + Uri uri = new Uri.dataFromString(url); + tamaraPaymentStatus = uri.queryParameters['paymentStatus']; + tamaraOrderID = uri.queryParameters['orderId']; + print(tamaraPaymentStatus); + print(tamaraOrderID); + } + MyInAppBrowser.successURLS.forEach((element) { if (url.contains(element)) { if (browser.isOpened()) browser.close(); @@ -397,7 +407,19 @@ class _ConfirmPaymentPageState extends State { onBrowserExit(AppoitmentAllHistoryResultList appo, bool isPaymentMade) { print("onBrowserExit Called!!!!"); + if (widget.selectedPaymentMethod == "TAMARA" && tamaraPaymentStatus != null && tamaraPaymentStatus == "approved") { + var res = { + "Amount": double.parse(widget.advanceModel.amount), + "ErrorMessage": null, + "Fort_id": tamaraOrderID, + "Merchant_Reference": "5058637919318707883366", + "PaymentMethod": "TAMARA", + "Response_Message": "Success" + }; + createAdvancePayment(res, appo); + } else { checkPaymentStatus(appo); + } } checkPaymentStatus(AppoitmentAllHistoryResultList appo) { @@ -422,7 +444,12 @@ class _ConfirmPaymentPageState extends State { amount = widget.advanceModel.amount; payment_method = widget.selectedPaymentMethod; projectViewModel.analytics.advancePayments.payment_fail( - payment_type: 'wallet', payment_method: payment_method, txn_amount: "$amount", txn_currency: currency, hospital: widget.advanceModel.hospitalsModel.name, error_type: res['Response_Message']); + payment_type: 'wallet', + payment_method: payment_method, + txn_amount: "$amount", + txn_currency: currency, + hospital: widget.advanceModel.hospitalsModel.name, + error_type: res['Response_Message']); } }).catchError((err) { GifLoaderDialogUtils.hideDialog(AppGlobal.context); diff --git a/lib/widgets/in_app_browser/InAppBrowser.dart b/lib/widgets/in_app_browser/InAppBrowser.dart index 062dfce8..57985daf 100644 --- a/lib/widgets/in_app_browser/InAppBrowser.dart +++ b/lib/widgets/in_app_browser/InAppBrowser.dart @@ -21,14 +21,15 @@ enum _PAYMENT_TYPE { PACKAGES, PHARMACY, PATIENT } var _InAppBrowserOptions = InAppBrowserClassOptions( inAppWebViewGroupOptions: InAppWebViewGroupOptions( - crossPlatform: InAppWebViewOptions(useShouldOverrideUrlLoading: true), + crossPlatform: InAppWebViewOptions(useShouldOverrideUrlLoading: true, transparentBackground: false), ios: IOSInAppWebViewOptions( applePayAPIEnabled: true, )), - crossPlatform: InAppBrowserOptions(hideUrlBar: true), + crossPlatform: InAppBrowserOptions(hideUrlBar: true, toolbarTopBackgroundColor: Colors.black), ios: IOSInAppBrowserOptions( - hideToolbarBottom: false, + hideToolbarBottom: true, toolbarBottomBackgroundColor: Colors.white, + presentationStyle: IOSUIModalPresentationStyle.OVER_FULL_SCREEN )); class MyInAppBrowser extends InAppBrowser { @@ -55,9 +56,9 @@ class MyInAppBrowser extends InAppBrowser { static String PACKAGES_PAYMENT_SUCCESS_URL = '$EXA_CART_API_BASE_URL/Checkout/MobilePaymentSuccess'; static String PACKAGES_PAYMENT_FAIL_URL = '$EXA_CART_API_BASE_URL/Checkout/MobilePaymentFailed'; - static List successURLS = ['success', 'PayFortResponse', 'PayFortSucess', 'mobilepaymentcomplete', 'orderdetails']; + static List successURLS = ['success', 'PayFortResponse', 'PayFortSucess', 'mobilepaymentcomplete', 'orderdetails', 'redirectToApplePay']; - static List errorURLS = ['PayfortCancel', 'errorpage', 'Failed', 'orderdetails']; + static List errorURLS = ['PayfortCancel', 'errorpage', 'Failed', 'orderdetails', 'redirectToApplePay']; final Function onExitCallback; final Function onLoadStartCallback; diff --git a/pubspec.yaml b/pubspec.yaml index 37345cbc..72c5fbb5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: diplomaticquarterapp description: A new Flutter application. -version: 4.4.97+404097 +version: 4.4.98+404098 environment: sdk: ">=2.7.0 <3.0.0"