|
|
|
|
@ -128,9 +128,7 @@ class _ErOnlineCheckinPaymentPageState extends State<ErOnlineCheckinPaymentPage>
|
|
|
|
|
emergencyServicesViewModel.selectedHospital!.iD,
|
|
|
|
|
appState.getAuthenticatedUser()!.patientId!,
|
|
|
|
|
);
|
|
|
|
|
paytabsViewModel.setPaymentConfiguration(
|
|
|
|
|
"ER Online Check-In Payment",
|
|
|
|
|
emergencyServicesViewModel.erOnlineCheckInPaymentDetailsResponse.patientShareWithTax!,
|
|
|
|
|
paytabsViewModel.setPaymentConfiguration("ER Online Check-In Payment", emergencyServicesViewModel.erOnlineCheckInPaymentDetailsResponse.patientShareWithTax!,
|
|
|
|
|
ServiceTypeEnum.erOnlineCheckIn.getIdFromServiceEnum(), emergencyServicesViewModel.selectedHospital!.iD);
|
|
|
|
|
paytabsViewModel.startCardPayment(
|
|
|
|
|
paymentOption: selectedPaymentMethod,
|
|
|
|
|
@ -147,45 +145,46 @@ class _ErOnlineCheckinPaymentPageState extends State<ErOnlineCheckinPaymentPage>
|
|
|
|
|
projectID: emergencyServicesViewModel.selectedHospital!.iD.toString(),
|
|
|
|
|
onSuccess: (PaytabsTransactionResponseModel transactionData) async {
|
|
|
|
|
if (emergencyServicesViewModel.isERBookAppointment) {
|
|
|
|
|
await emergencyServicesViewModel.ER_CreateAdvancePayment(
|
|
|
|
|
paymentMethodName: selectedPaymentMethod,
|
|
|
|
|
paymentReference: transactionData.transactionReference!,
|
|
|
|
|
onSuccess: (value) async {
|
|
|
|
|
await emergencyServicesViewModel.addAdvanceNumberRequest(
|
|
|
|
|
advanceNumber: value,
|
|
|
|
|
paymentReference: transactionData.transactionReference!,
|
|
|
|
|
appointmentNo: "0",
|
|
|
|
|
onSuccess: (val) {
|
|
|
|
|
emergencyServicesViewModel.setIsAdvanceERBalanceNeedToBeLoaded(true);
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
if (emergencyServicesViewModel.isERBookAppointment) {
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
context,
|
|
|
|
|
child: Utils.getSuccessWidget(loadingText: LocaleKeys.erAppointmentBookedSuccess.tr(context: context)),
|
|
|
|
|
callBackFunc: () {
|
|
|
|
|
Navigator.pushAndRemoveUntil(
|
|
|
|
|
context,
|
|
|
|
|
CustomPageRoute(
|
|
|
|
|
page: LandingNavigation(),
|
|
|
|
|
),
|
|
|
|
|
(r) => false);
|
|
|
|
|
},
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
);
|
|
|
|
|
} else {}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else {}
|
|
|
|
|
}, onError: (errMsg) {
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
context,
|
|
|
|
|
child: Utils.getErrorWidget(loadingText: errMsg.toString()),
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
await emergencyServicesViewModel.ER_CreateAdvancePayment(
|
|
|
|
|
paymentMethodName: selectedPaymentMethod,
|
|
|
|
|
paymentReference: transactionData.transactionReference!,
|
|
|
|
|
onSuccess: (value) async {
|
|
|
|
|
await emergencyServicesViewModel.addAdvanceNumberRequest(
|
|
|
|
|
advanceNumber: value,
|
|
|
|
|
paymentReference: transactionData.transactionReference!,
|
|
|
|
|
appointmentNo: "0",
|
|
|
|
|
onSuccess: (val) {
|
|
|
|
|
emergencyServicesViewModel.setIsAdvanceERBalanceNeedToBeLoaded(true);
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
if (emergencyServicesViewModel.isERBookAppointment) {
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
context,
|
|
|
|
|
child: Utils.getSuccessWidget(loadingText: LocaleKeys.erAppointmentBookedSuccess.tr(context: context)),
|
|
|
|
|
callBackFunc: () {
|
|
|
|
|
Navigator.pushAndRemoveUntil(
|
|
|
|
|
context,
|
|
|
|
|
CustomPageRoute(
|
|
|
|
|
page: LandingNavigation(),
|
|
|
|
|
),
|
|
|
|
|
(r) => false);
|
|
|
|
|
},
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
);
|
|
|
|
|
} else {}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else {}
|
|
|
|
|
},
|
|
|
|
|
onError: (errMsg) {
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
context,
|
|
|
|
|
child: Utils.getErrorWidget(loadingText: errMsg.toString()),
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
openPaymentURL("mada");
|
|
|
|
|
}
|
|
|
|
|
@ -235,9 +234,7 @@ class _ErOnlineCheckinPaymentPageState extends State<ErOnlineCheckinPaymentPage>
|
|
|
|
|
emergencyServicesViewModel.selectedHospital!.iD,
|
|
|
|
|
appState.getAuthenticatedUser()!.patientId!,
|
|
|
|
|
);
|
|
|
|
|
paytabsViewModel.setPaymentConfiguration(
|
|
|
|
|
"ER Online Check-In Payment",
|
|
|
|
|
emergencyServicesViewModel.erOnlineCheckInPaymentDetailsResponse.patientShareWithTax!,
|
|
|
|
|
paytabsViewModel.setPaymentConfiguration("ER Online Check-In Payment", emergencyServicesViewModel.erOnlineCheckInPaymentDetailsResponse.patientShareWithTax!,
|
|
|
|
|
ServiceTypeEnum.erOnlineCheckIn.getIdFromServiceEnum(), emergencyServicesViewModel.selectedHospital!.iD);
|
|
|
|
|
paytabsViewModel.startCardPayment(
|
|
|
|
|
paymentOption: selectedPaymentMethod,
|
|
|
|
|
@ -254,45 +251,46 @@ class _ErOnlineCheckinPaymentPageState extends State<ErOnlineCheckinPaymentPage>
|
|
|
|
|
projectID: emergencyServicesViewModel.selectedHospital!.iD.toString(),
|
|
|
|
|
onSuccess: (PaytabsTransactionResponseModel transactionData) async {
|
|
|
|
|
if (emergencyServicesViewModel.isERBookAppointment) {
|
|
|
|
|
await emergencyServicesViewModel.ER_CreateAdvancePayment(
|
|
|
|
|
paymentMethodName: selectedPaymentMethod,
|
|
|
|
|
paymentReference: transactionData.transactionReference!,
|
|
|
|
|
onSuccess: (value) async {
|
|
|
|
|
await emergencyServicesViewModel.addAdvanceNumberRequest(
|
|
|
|
|
advanceNumber: value,
|
|
|
|
|
paymentReference: transactionData.transactionReference!,
|
|
|
|
|
appointmentNo: "0",
|
|
|
|
|
onSuccess: (val) {
|
|
|
|
|
emergencyServicesViewModel.setIsAdvanceERBalanceNeedToBeLoaded(true);
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
if (emergencyServicesViewModel.isERBookAppointment) {
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
context,
|
|
|
|
|
child: Utils.getSuccessWidget(loadingText: LocaleKeys.erAppointmentBookedSuccess.tr(context: context)),
|
|
|
|
|
callBackFunc: () {
|
|
|
|
|
Navigator.pushAndRemoveUntil(
|
|
|
|
|
context,
|
|
|
|
|
CustomPageRoute(
|
|
|
|
|
page: LandingNavigation(),
|
|
|
|
|
),
|
|
|
|
|
(r) => false);
|
|
|
|
|
},
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
);
|
|
|
|
|
} else {}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else {}
|
|
|
|
|
}, onError: (errMsg) {
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
context,
|
|
|
|
|
child: Utils.getErrorWidget(loadingText: errMsg.toString()),
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
await emergencyServicesViewModel.ER_CreateAdvancePayment(
|
|
|
|
|
paymentMethodName: selectedPaymentMethod,
|
|
|
|
|
paymentReference: transactionData.transactionReference!,
|
|
|
|
|
onSuccess: (value) async {
|
|
|
|
|
await emergencyServicesViewModel.addAdvanceNumberRequest(
|
|
|
|
|
advanceNumber: value,
|
|
|
|
|
paymentReference: transactionData.transactionReference!,
|
|
|
|
|
appointmentNo: "0",
|
|
|
|
|
onSuccess: (val) {
|
|
|
|
|
emergencyServicesViewModel.setIsAdvanceERBalanceNeedToBeLoaded(true);
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
if (emergencyServicesViewModel.isERBookAppointment) {
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
context,
|
|
|
|
|
child: Utils.getSuccessWidget(loadingText: LocaleKeys.erAppointmentBookedSuccess.tr(context: context)),
|
|
|
|
|
callBackFunc: () {
|
|
|
|
|
Navigator.pushAndRemoveUntil(
|
|
|
|
|
context,
|
|
|
|
|
CustomPageRoute(
|
|
|
|
|
page: LandingNavigation(),
|
|
|
|
|
),
|
|
|
|
|
(r) => false);
|
|
|
|
|
},
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
);
|
|
|
|
|
} else {}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else {}
|
|
|
|
|
},
|
|
|
|
|
onError: (errMsg) {
|
|
|
|
|
showCommonBottomSheetWithoutHeight(
|
|
|
|
|
context,
|
|
|
|
|
child: Utils.getErrorWidget(loadingText: errMsg.toString()),
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
isFullScreen: false,
|
|
|
|
|
isCloseButtonVisible: true,
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
openPaymentURL("visa");
|
|
|
|
|
}
|
|
|
|
|
@ -332,7 +330,7 @@ class _ErOnlineCheckinPaymentPageState extends State<ErOnlineCheckinPaymentPage>
|
|
|
|
|
).paddingSymmetrical(16.h, 16.h),
|
|
|
|
|
).paddingSymmetrical(24.h, 0.h).onPress(() {
|
|
|
|
|
selectedPaymentMethod = "TAMARA";
|
|
|
|
|
openPaymentURL("tamara");
|
|
|
|
|
openPaymentURL("TAMARA");
|
|
|
|
|
})
|
|
|
|
|
: SizedBox.shrink(),
|
|
|
|
|
],
|
|
|
|
|
@ -353,39 +351,39 @@ class _ErOnlineCheckinPaymentPageState extends State<ErOnlineCheckinPaymentPage>
|
|
|
|
|
children: [
|
|
|
|
|
(emergencyServicesViewModel.erOnlineCheckInPaymentDetailsResponse.isCash ?? true)
|
|
|
|
|
? Container(
|
|
|
|
|
height: 50.h,
|
|
|
|
|
decoration: ShapeDecoration(
|
|
|
|
|
color: AppColors.secondaryLightRedBorderColor,
|
|
|
|
|
shape: SmoothRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(24), topRight: Radius.circular(24)),
|
|
|
|
|
smoothness: 1,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
height: 50.h,
|
|
|
|
|
decoration: ShapeDecoration(
|
|
|
|
|
color: AppColors.secondaryLightRedBorderColor,
|
|
|
|
|
shape: SmoothRectangleBorder(
|
|
|
|
|
borderRadius: BorderRadius.only(topLeft: Radius.circular(24), topRight: Radius.circular(24)),
|
|
|
|
|
smoothness: 1,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
child: Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
LocaleKeys.insuranceExpiredOrInactive.tr(context: context).toText14(color: AppColors.primaryRedColor, isBold: true).paddingSymmetrical(24.h, 0.h),
|
|
|
|
|
CustomButton(
|
|
|
|
|
text: LocaleKeys.updateInsurance.tr(context: context),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.of(context).push(
|
|
|
|
|
CustomPageRoute(
|
|
|
|
|
page: InsuranceHomePage(),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
backgroundColor: AppColors.primaryRedColor,
|
|
|
|
|
borderColor: AppColors.secondaryLightRedBorderColor,
|
|
|
|
|
textColor: AppColors.whiteColor,
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
isBold: true,
|
|
|
|
|
borderRadius: 8,
|
|
|
|
|
padding: EdgeInsets.fromLTRB(15, 0, 15, 0),
|
|
|
|
|
height: 30.h,
|
|
|
|
|
).paddingSymmetrical(24.h, 0.h),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
text: LocaleKeys.updateInsurance.tr(context: context),
|
|
|
|
|
onPressed: () {
|
|
|
|
|
Navigator.of(context).push(
|
|
|
|
|
CustomPageRoute(
|
|
|
|
|
page: InsuranceHomePage(),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
backgroundColor: AppColors.primaryRedColor,
|
|
|
|
|
borderColor: AppColors.secondaryLightRedBorderColor,
|
|
|
|
|
textColor: AppColors.whiteColor,
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
isBold: true,
|
|
|
|
|
borderRadius: 8,
|
|
|
|
|
padding: EdgeInsets.fromLTRB(15, 0, 15, 0),
|
|
|
|
|
height: 30.h,
|
|
|
|
|
).paddingSymmetrical(24.h, 0.h),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: const SizedBox(),
|
|
|
|
|
SizedBox(height: 24.h),
|
|
|
|
|
LocaleKeys.totalAmountToPay.tr(context: context).toText18(isBold: true).paddingSymmetrical(24.h, 0.h),
|
|
|
|
|
@ -403,7 +401,9 @@ class _ErOnlineCheckinPaymentPageState extends State<ErOnlineCheckinPaymentPage>
|
|
|
|
|
children: [
|
|
|
|
|
LocaleKeys.vat15.tr(context: context).toText14(isBold: true, color: AppColors.greyTextColor),
|
|
|
|
|
Utils.getPaymentAmountWithSymbol(
|
|
|
|
|
emergencyServicesViewModel.erOnlineCheckInPaymentDetailsResponse.patientTaxAmount.toString().toText14(isBold: true, color: AppColors.greyTextColor), AppColors.greyTextColor, 13,
|
|
|
|
|
emergencyServicesViewModel.erOnlineCheckInPaymentDetailsResponse.patientTaxAmount.toString().toText14(isBold: true, color: AppColors.greyTextColor),
|
|
|
|
|
AppColors.greyTextColor,
|
|
|
|
|
13,
|
|
|
|
|
isSaudiCurrency: true),
|
|
|
|
|
],
|
|
|
|
|
).paddingSymmetrical(24.h, 0.h),
|
|
|
|
|
@ -417,14 +417,8 @@ class _ErOnlineCheckinPaymentPageState extends State<ErOnlineCheckinPaymentPage>
|
|
|
|
|
],
|
|
|
|
|
).paddingSymmetrical(24.h, 0.h),
|
|
|
|
|
Platform.isIOS
|
|
|
|
|
? Utils.buildSvgWithAssets(
|
|
|
|
|
icon: AppAssets.apple_pay_button,
|
|
|
|
|
width: 200.h,
|
|
|
|
|
height: 80.h,
|
|
|
|
|
fit: BoxFit.contain,
|
|
|
|
|
applyThemeColor: false
|
|
|
|
|
).paddingSymmetrical(24.h, 0.h).onPress(() {
|
|
|
|
|
if (Utils.havePrivilege(103)) {
|
|
|
|
|
? Utils.buildSvgWithAssets(icon: AppAssets.apple_pay_button, width: 200.h, height: 80.h, fit: BoxFit.contain, applyThemeColor: false).paddingSymmetrical(24.h, 0.h).onPress(() {
|
|
|
|
|
if (Utils.havePrivilege(103)) {
|
|
|
|
|
startApplePay();
|
|
|
|
|
} else {
|
|
|
|
|
openPaymentURL("ApplePay");
|
|
|
|
|
@ -530,9 +524,7 @@ class _ErOnlineCheckinPaymentPageState extends State<ErOnlineCheckinPaymentPage>
|
|
|
|
|
if (appState.isPaytabsEnabled) {
|
|
|
|
|
selectedPaymentMethod = "VISA";
|
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
|
paytabsViewModel.setPaymentConfiguration(
|
|
|
|
|
"ER Online Check-In Payment",
|
|
|
|
|
emergencyServicesViewModel.erOnlineCheckInPaymentDetailsResponse.patientShareWithTax!,
|
|
|
|
|
paytabsViewModel.setPaymentConfiguration("ER Online Check-In Payment", emergencyServicesViewModel.erOnlineCheckInPaymentDetailsResponse.patientShareWithTax!,
|
|
|
|
|
ServiceTypeEnum.erOnlineCheckIn.getIdFromServiceEnum(), emergencyServicesViewModel.selectedHospital!.iD);
|
|
|
|
|
paytabsViewModel.startApplePayPayment(onSuccess: (PaytabsTransactionResponseModel transactionData) async {
|
|
|
|
|
LoaderBottomSheet.showLoader(loadingText: LocaleKeys.checkingPaymentStatusPleaseWait.tr(context: context));
|
|
|
|
|
|