|
|
|
|
@ -1145,8 +1145,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
if (res["status"].toString().toLowerCase() == "success") {
|
|
|
|
|
updateTamaraRequestStatus("success", "14", orderID, res["tamara_order_id"], num.parse(selectedInstallments), appo);
|
|
|
|
|
} else {
|
|
|
|
|
updateTamaraRequestStatus(
|
|
|
|
|
"Failed", "00", transID, tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallments), appo);
|
|
|
|
|
updateTamaraRequestStatus("Failed", "00", transID, tamaraOrderID != null ? tamaraOrderID : "", num.parse(selectedInstallments), appo);
|
|
|
|
|
}
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
@ -1280,10 +1279,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
addVIDARequestInsert(String advanceNumber, String paymentReference, AppoitmentAllHistoryResultList appo) {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
DoctorsListService service = new DoctorsListService();
|
|
|
|
|
service
|
|
|
|
|
.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate,
|
|
|
|
|
transID, projectViewModel.isArabic ? 1 : 2, context)
|
|
|
|
|
.then((res) {
|
|
|
|
|
service.insertVIDARequest(appo.appointmentNo, appo.clinicID, appo.projectID, appo.serviceID, appo.doctorID, appo.appointmentDate, transID, projectViewModel.isArabic ? 1 : 2, context).then((res) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
getPatientAppointmentHistory();
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
@ -1338,20 +1334,20 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
|
|
|
|
|
applePayInsertRequest.clientRequestID = transID;
|
|
|
|
|
applePayInsertRequest.clinicID = appo.clinicID;
|
|
|
|
|
applePayInsertRequest.currency = projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR";
|
|
|
|
|
applePayInsertRequest.currency = projectViewModel.user.outSA == 1 ? "AED" : "SAR";
|
|
|
|
|
// applePayInsertRequest.customerEmail = projectViewModel.authenticatedUserObject.user.emailAddress;
|
|
|
|
|
applePayInsertRequest.customerEmail = "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com";
|
|
|
|
|
applePayInsertRequest.customerID = projectViewModel.authenticatedUserObject.user.patientID;
|
|
|
|
|
applePayInsertRequest.customerName = projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName;
|
|
|
|
|
applePayInsertRequest.customerEmail = "CustID_${projectViewModel.user.patientID}@HMG.com";
|
|
|
|
|
applePayInsertRequest.customerID = projectViewModel.user.patientID;
|
|
|
|
|
applePayInsertRequest.customerName = projectViewModel.user.firstName + " " + projectViewModel.user.lastName;
|
|
|
|
|
applePayInsertRequest.deviceToken = await AppSharedPreferences().getString(PUSH_TOKEN);
|
|
|
|
|
applePayInsertRequest.voipToken = await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN);
|
|
|
|
|
applePayInsertRequest.doctorID = appo.doctorID;
|
|
|
|
|
applePayInsertRequest.projectID = appo.projectID.toString();
|
|
|
|
|
applePayInsertRequest.serviceID = ServiceTypeEnum.advancePayment.getIdFromServiceEnum().toString();
|
|
|
|
|
applePayInsertRequest.serviceID = ServiceTypeEnum.appointmentPayment.getIdFromServiceEnum().toString();
|
|
|
|
|
applePayInsertRequest.channelID = 3;
|
|
|
|
|
applePayInsertRequest.patientID = projectViewModel.authenticatedUserObject.user.patientID;
|
|
|
|
|
applePayInsertRequest.patientTypeID = projectViewModel.authenticatedUserObject.user.patientType;
|
|
|
|
|
applePayInsertRequest.patientOutSA = projectViewModel.authenticatedUserObject.user.outSA;
|
|
|
|
|
applePayInsertRequest.patientID = projectViewModel.user.patientID;
|
|
|
|
|
applePayInsertRequest.patientTypeID = projectViewModel.user.patientType;
|
|
|
|
|
applePayInsertRequest.patientOutSA = projectViewModel.user.outSA;
|
|
|
|
|
applePayInsertRequest.appointmentDate = appo.appointmentDate;
|
|
|
|
|
applePayInsertRequest.appointmentNo = appo.appointmentNo;
|
|
|
|
|
applePayInsertRequest.orderDescription = "Appointment Payment";
|
|
|
|
|
@ -1362,7 +1358,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
applePayInsertRequest.isSchedule = appo.isLiveCareAppointment ? "1" : "0";
|
|
|
|
|
applePayInsertRequest.language = projectViewModel.isArabic ? 'ar' : 'en';
|
|
|
|
|
applePayInsertRequest.languageID = projectViewModel.isArabic ? 1 : 2;
|
|
|
|
|
applePayInsertRequest.userName = projectViewModel.authenticatedUserObject.user.patientID;
|
|
|
|
|
applePayInsertRequest.userName = projectViewModel.user.patientID;
|
|
|
|
|
applePayInsertRequest.responseContinueURL = "http://hmg.com/Documents/success.html";
|
|
|
|
|
applePayInsertRequest.backClickUrl = "http://hmg.com/Documents/success.html";
|
|
|
|
|
applePayInsertRequest.paymentOption = "ApplePay";
|
|
|
|
|
@ -1379,21 +1375,21 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
|
|
|
|
|
service.applePayInsertRequest(applePayInsertRequest, context).then((res) async {
|
|
|
|
|
await context.read<PayfortViewModel>().initiateApplePayWithPayfort(
|
|
|
|
|
customerName: projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName,
|
|
|
|
|
customerName: projectViewModel.user.firstName + " " + projectViewModel.user.lastName,
|
|
|
|
|
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
|
|
|
|
|
customerEmail: "CustID_${projectViewModel.authenticatedUserObject.user.patientID}@HMG.com",
|
|
|
|
|
customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com",
|
|
|
|
|
orderDescription: "Appointment Payment",
|
|
|
|
|
orderAmount: double.parse(patientShareResponse.patientShareWithTax.toString()),
|
|
|
|
|
merchantReference: transID,
|
|
|
|
|
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
|
|
|
|
|
currency: projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR",
|
|
|
|
|
currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR",
|
|
|
|
|
onFailed: (failureResult) async {
|
|
|
|
|
log("failureResult: ${failureResult.toString()}");
|
|
|
|
|
AppToast.showErrorToast(message: failureResult.toString());
|
|
|
|
|
},
|
|
|
|
|
onSuccess: (successResult) async {
|
|
|
|
|
log("Payfort: ${successResult.responseMessage}");
|
|
|
|
|
await context.read<PayfortViewModel>().addPayfortApplePayResponse(result: successResult);
|
|
|
|
|
await context.read<PayfortViewModel>().addPayfortApplePayResponse(projectViewModel.user.patientID, result: successResult);
|
|
|
|
|
checkPaymentStatus(appo);
|
|
|
|
|
},
|
|
|
|
|
projectId: appo.projectID,
|
|
|
|
|
|