|
|
|
|
@ -895,15 +895,32 @@ class _ToDoState extends State<ToDo> 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);
|
|
|
|
|
|