|
|
|
@ -73,6 +73,9 @@ class _clinic_listState extends State<ClinicList> {
|
|
|
|
|
|
|
|
|
|
ProjectViewModel projectViewModel;
|
|
|
|
|
|
|
|
|
|
String selectedPaymentMethod = "";
|
|
|
|
|
String amount = "";
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
liveCareClinicsListResponse = new LiveCareClinicsListResponse();
|
|
|
|
@ -299,6 +302,9 @@ class _clinic_listState extends State<ClinicList> {
|
|
|
|
|
openPayment(List<String> paymentMethod, AuthenticatedUser authenticatedUser, double amount, AppoitmentAllHistoryResultList appo) {
|
|
|
|
|
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
|
|
|
|
|
|
|
|
|
|
selectedPaymentMethod = paymentMethod[0];
|
|
|
|
|
this.amount = amount.toString();
|
|
|
|
|
|
|
|
|
|
browser.openPaymentBrowser(amount, "LiveCare Payment", Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), "12", authenticatedUser.emailAddress, paymentMethod[0],
|
|
|
|
|
authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "4", selectedClinicID, "", "", "", "", paymentMethod[1]);
|
|
|
|
|
}
|
|
|
|
@ -330,15 +336,22 @@ class _clinic_listState extends State<ClinicList> {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
checkPaymentStatus(AppoitmentAllHistoryResultList appo) {
|
|
|
|
|
String amount;
|
|
|
|
|
String payment_method;
|
|
|
|
|
final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed';
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), context).then((res) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
String paymentInfo = res['Response_Message'];
|
|
|
|
|
amount = res['Amount'].toString();
|
|
|
|
|
payment_method = res['PaymentMethod'];
|
|
|
|
|
if (paymentInfo == 'Success') {
|
|
|
|
|
addNewCallForPatientER(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo));
|
|
|
|
|
} else {
|
|
|
|
|
AppToast.showErrorToast(message: res['Response_Message']);
|
|
|
|
|
projectViewModel.analytics.liveCare.livecare_immediate_consultation_payment_failed(
|
|
|
|
|
appointment_type: 'livecare', payment_type: 'appointment', payment_method: selectedPaymentMethod, txn_amount: this.amount, txn_currency: currency, error_message: res['Response_Message']);
|
|
|
|
|
}
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|