Apple Pay code merged into main branch

dev_3.3_AmbulanceRequestCR^2
haroon amjad 2 years ago
parent 48202ffd12
commit d3bdcfa975

@ -21,8 +21,8 @@ var PACKAGES_ORDERS = '/api/orders';
var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_ORDER_HISTORY = '/api/orders/items';
var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara';
// var BASE_URL = 'http://10.50.100.198:4422/'; // var BASE_URL = 'http://10.50.100.198:4422/';
var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://uat.hmgwebservices.com/';
// var BASE_URL = 'https://hmgwebservices.com/'; var BASE_URL = 'https://hmgwebservices.com/';
// var BASE_URL = 'http://10.20.200.111:1010/'; // var BASE_URL = 'http://10.20.200.111:1010/';
// var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://uat.hmgwebservices.com/';
// var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/';
@ -343,7 +343,7 @@ var UPDATE_COVID_QUESTIONNAIRE = 'Services/Doctors.svc/REST/COVID19_Questionnari
var CHANNEL = 3; var CHANNEL = 3;
var GENERAL_ID = 'Cs2020@2016\$2958'; var GENERAL_ID = 'Cs2020@2016\$2958';
var IP_ADDRESS = '10.20.10.20'; var IP_ADDRESS = '10.20.10.20';
var VERSION_ID = 11.9; var VERSION_ID = 12.0;
var SETUP_ID = '91877'; var SETUP_ID = '91877';
var LANGUAGE = 2; var LANGUAGE = 2;
// var PATIENT_OUT_SA = 0; // var PATIENT_OUT_SA = 0;
@ -630,9 +630,9 @@ var CONVERT_PATIENT_TO_CASH = 'Services/Doctors.svc/REST/deActivateInsuranceComp
var getPayFortProjectDetails = "Services/PayFort_Serv.svc/REST/GetPayFortProjectDetails"; var getPayFortProjectDetails = "Services/PayFort_Serv.svc/REST/GetPayFortProjectDetails";
var addPayFortApplePayResponse = "Services/PayFort_Serv.svc/REST/AddResponse"; var addPayFortApplePayResponse = "Services/PayFort_Serv.svc/REST/AddResponse";
var payFortEnvironment = FortEnvironment.production; var payFortEnvironment = FortEnvironment.production;
var applePayMerchantId = "merchant.com.hmgwebservices";
// var payFortEnvironment = FortEnvironment.test; // var payFortEnvironment = FortEnvironment.test;
// var applePayMerchantId = "merchant.com.hmgwebservices.uat"; // var applePayMerchantId = "merchant.com.hmgwebservices.uat";
var applePayMerchantId = "merchant.com.hmgwebservices";
class AppGlobal { class AppGlobal {

@ -15,6 +15,7 @@ import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_order_pro
import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_orders_proc_list.dart'; import 'package:diplomaticquarterapp/models/anicllary-orders/ancillary_orders_proc_list.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
import 'package:diplomaticquarterapp/services/payfort_services/payfort_project_details_resp_model.dart'; import 'package:diplomaticquarterapp/services/payfort_services/payfort_project_details_resp_model.dart';
@ -803,6 +804,7 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
okFunction: () { okFunction: () {
AlertDialogBox.closeAlertDialog(context); AlertDialogBox.closeAlertDialog(context);
Navigator.of(context).pop(); Navigator.of(context).pop();
Navigator.pushAndRemoveUntil(context, MaterialPageRoute(builder: (context) => LandingPage()), (Route<dynamic> r) => false);
}).showAlertDialog(context); }).showAlertDialog(context);
} }

@ -64,6 +64,7 @@ class _BookSuccessState extends State<BookSuccess> {
String selectedInstallments = ""; String selectedInstallments = "";
String tamaraPaymentStatus; String tamaraPaymentStatus;
String tamaraOrderID; String tamaraOrderID;
String transID;
@override @override
initState() { initState() {
@ -642,7 +643,7 @@ class _BookSuccessState extends State<BookSuccess> {
} }
void startApplePay(AppoitmentAllHistoryResultList appo, PatientShareResponse patientShareResponse) async { void startApplePay(AppoitmentAllHistoryResultList appo, PatientShareResponse patientShareResponse) async {
String transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo); transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo);
print("TransactionID: $transID"); print("TransactionID: $transID");
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
@ -726,10 +727,11 @@ class _BookSuccessState extends State<BookSuccess> {
widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context); widget.browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
selectedPaymentMethod = paymentMethod[0]; selectedPaymentMethod = paymentMethod[0];
selectedInstallments = paymentMethod[1]; selectedInstallments = paymentMethod[1];
transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo);
widget.browser.openPaymentBrowser( widget.browser.openPaymentBrowser(
amount, amount,
"Appointment check in", "Appointment check in",
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), transID,
appo.projectID.toString(), appo.projectID.toString(),
authenticatedUser.emailAddress, authenticatedUser.emailAddress,
paymentMethod[0], paymentMethod[0],
@ -884,7 +886,7 @@ class _BookSuccessState extends State<BookSuccess> {
final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed'; final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed';
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), false, context).then((res) { service.checkPaymentStatus(transID, false, context).then((res) {
String paymentInfo = res['Response_Message']; String paymentInfo = res['Response_Message'];
if (paymentInfo == 'Success') { if (paymentInfo == 'Success') {
txn_ref = res['Merchant_Reference']; txn_ref = res['Merchant_Reference'];

@ -92,6 +92,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
List<AppoitmentAllHistoryResultList> appoList = []; List<AppoitmentAllHistoryResultList> appoList = [];
List<AncillaryOrdersListModel> ancillaryLists = []; List<AncillaryOrdersListModel> ancillaryLists = [];
List<OBGyneProcedureListResponse> obGyneAppoList = []; List<OBGyneProcedureListResponse> obGyneAppoList = [];
String transID;
@override @override
void initState() { void initState() {
@ -1061,11 +1062,11 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
openPayment(List<String> paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) { openPayment(List<String> paymentMethod, AuthenticatedUser authenticatedUser, num amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) {
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context); browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo);
browser.openPaymentBrowser( browser.openPaymentBrowser(
amount, amount,
"Appointment check in", "Appointment check in",
Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), transID,
appo.projectID.toString(), appo.projectID.toString(),
authenticatedUser.emailAddress, authenticatedUser.emailAddress,
paymentMethod[0], paymentMethod[0],
@ -1214,7 +1215,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed'; final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed';
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.checkPaymentStatus(Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), false, context).then((res) { service.checkPaymentStatus(transID, false, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
String paymentInfo = res['Response_Message']; String paymentInfo = res['Response_Message'];
if (paymentInfo == 'Success') { if (paymentInfo == 'Success') {
@ -1319,7 +1320,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
} }
void startApplePay(AppoitmentAllHistoryResultList appo, PatientShareResponse patientShareResponse) async { void startApplePay(AppoitmentAllHistoryResultList appo, PatientShareResponse patientShareResponse) async {
String transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo); transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo);
print("TransactionID: $transID"); print("TransactionID: $transID");
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);

@ -89,6 +89,9 @@ class _clinic_listState extends State<ClinicList> {
String tamaraOrderID; String tamaraOrderID;
String selectedInstallmentPlan; String selectedInstallmentPlan;
String transID;
BuildContext localContext;
@override @override
void initState() { void initState() {
liveCareClinicsListResponse = new LiveCareClinicsListResponse(); liveCareClinicsListResponse = new LiveCareClinicsListResponse();
@ -114,6 +117,7 @@ class _clinic_listState extends State<ClinicList> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
localContext = context;
getLanguageID(); getLanguageID();
return Container( return Container(
child: currentSelectedLiveCareType == "immediate" ? getLiveCareImmediateClinicList() : getLiveCareScheduleClinicList(), child: currentSelectedLiveCareType == "immediate" ? getLiveCareImmediateClinicList() : getLiveCareScheduleClinicList(),
@ -325,134 +329,123 @@ class _clinic_listState extends State<ClinicList> {
patientShare: num.parse(getERAppointmentFeesList.total), patientShare: num.parse(getERAppointmentFeesList.total),
isFromAdvancePayment: widget.isPharmacyLiveCare, isFromAdvancePayment: widget.isPharmacyLiveCare,
))).then((value) { ))).then((value) {
selectedPaymentMethod = value[0];
print(value);
widget.isPharmacyLiveCare = isPharmacyLiveCare;
widget.pharmacyLiveCareQRCode = pharmaLiveCareQRCodeValue;
if (value != null) { if (value != null) {
if (selectedPaymentMethod == "ApplePay") { selectedPaymentMethod = value[0];
startApplePay(appo, getERAppointmentFeesList.total); print(value);
} else { widget.isPharmacyLiveCare = isPharmacyLiveCare;
openPayment(value, authUser, num.parse(getERAppointmentFeesList.total), appo); widget.pharmacyLiveCareQRCode = pharmaLiveCareQRCodeValue;
if (value != null) {
if (selectedPaymentMethod == "ApplePay") {
startApplePay(appo, getERAppointmentFeesList.total);
} else {
openPayment(value, authUser, num.parse(getERAppointmentFeesList.total), appo);
}
projectViewModel.analytics.liveCare.payment_method(appointment_type: 'livecare', clinic: selectedClinicName, payment_method: value[0], payment_type: 'appointment');
} }
projectViewModel.analytics.liveCare.payment_method(appointment_type: 'livecare', clinic: selectedClinicName, payment_method: value[0], payment_type: 'appointment');
} }
}); });
} }
void startApplePay(AppoitmentAllHistoryResultList appo, String amount) async { void startApplePay(AppoitmentAllHistoryResultList appo, String amount) async {
String transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo); try {
print("TransactionID: $transID"); transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo);
GifLoaderDialogUtils.showMyDialog(context); print("TransactionID: $transID");
GifLoaderDialogUtils.showMyDialog(localContext);
LiveCareService service = new LiveCareService();
ApplePayInsertRequest applePayInsertRequest = new ApplePayInsertRequest(); LiveCareService service = new LiveCareService();
ApplePayInsertRequest applePayInsertRequest = new ApplePayInsertRequest();
PayfortProjectDetailsRespModel payfortProjectDetailsRespModel;
await context PayfortProjectDetailsRespModel payfortProjectDetailsRespModel;
.read<PayfortViewModel>() await localContext
.getProjectDetailsForPayfort(projectId: appo.projectID, serviceId: ServiceTypeEnum.liveCareAppointment.getIdFromServiceEnum(), languageID: projectViewModel.isArabic ? 1 : 2) .read<PayfortViewModel>()
.then((value) { .getProjectDetailsForPayfort(projectId: appo.projectID, serviceId: ServiceTypeEnum.liveCareAppointment.getIdFromServiceEnum(), languageID: projectViewModel.isArabic ? 1 : 2)
payfortProjectDetailsRespModel = value; .then((value) {
}); payfortProjectDetailsRespModel = value;
});
applePayInsertRequest.clientRequestID = transID; applePayInsertRequest.clientRequestID = transID;
applePayInsertRequest.clinicID = appo.clinicID; applePayInsertRequest.clinicID = appo.clinicID;
applePayInsertRequest.currency = projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR"; applePayInsertRequest.currency = projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR";
applePayInsertRequest.customerEmail = projectViewModel.authenticatedUserObject.user.emailAddress; applePayInsertRequest.customerEmail = projectViewModel.authenticatedUserObject.user.emailAddress;
applePayInsertRequest.customerID = projectViewModel.authenticatedUserObject.user.patientID; applePayInsertRequest.customerID = projectViewModel.authenticatedUserObject.user.patientID;
applePayInsertRequest.customerName = projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName; applePayInsertRequest.customerName = projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName;
applePayInsertRequest.deviceToken = await AppSharedPreferences().getString(PUSH_TOKEN); applePayInsertRequest.deviceToken = await AppSharedPreferences().getString(PUSH_TOKEN);
applePayInsertRequest.voipToken = await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN); applePayInsertRequest.voipToken = await AppSharedPreferences().getString(ONESIGNAL_APNS_TOKEN);
applePayInsertRequest.doctorID = appo.doctorID; applePayInsertRequest.doctorID = appo.doctorID;
applePayInsertRequest.projectID = appo.projectID.toString(); applePayInsertRequest.projectID = appo.projectID.toString();
applePayInsertRequest.serviceID = ServiceTypeEnum.liveCareAppointment.getIdFromServiceEnum().toString(); applePayInsertRequest.serviceID = ServiceTypeEnum.liveCareAppointment.getIdFromServiceEnum().toString();
applePayInsertRequest.channelID = 3; applePayInsertRequest.channelID = 3;
applePayInsertRequest.patientID = projectViewModel.authenticatedUserObject.user.patientID; applePayInsertRequest.patientID = projectViewModel.authenticatedUserObject.user.patientID;
applePayInsertRequest.patientTypeID = projectViewModel.authenticatedUserObject.user.patientType; applePayInsertRequest.patientTypeID = projectViewModel.authenticatedUserObject.user.patientType;
applePayInsertRequest.patientOutSA = projectViewModel.authenticatedUserObject.user.outSA; applePayInsertRequest.patientOutSA = projectViewModel.authenticatedUserObject.user.outSA;
applePayInsertRequest.appointmentDate = appo.appointmentDate; applePayInsertRequest.appointmentDate = appo.appointmentDate;
applePayInsertRequest.appointmentNo = appo.appointmentNo; applePayInsertRequest.appointmentNo = appo.appointmentNo;
applePayInsertRequest.orderDescription = "LiveCare Payment"; applePayInsertRequest.orderDescription = "LiveCare Payment";
applePayInsertRequest.liveServiceID = "0"; applePayInsertRequest.liveServiceID = "0";
applePayInsertRequest.latitude = "0.0"; applePayInsertRequest.latitude = "0.0";
applePayInsertRequest.longitude = "0.0"; applePayInsertRequest.longitude = "0.0";
applePayInsertRequest.amount = amount; applePayInsertRequest.amount = amount;
applePayInsertRequest.isSchedule = appo.isLiveCareAppointment ? "1" : "0"; applePayInsertRequest.isSchedule = appo.isLiveCareAppointment ? "1" : "0";
applePayInsertRequest.language = projectViewModel.isArabic ? 'ar' : 'en'; applePayInsertRequest.language = projectViewModel.isArabic ? 'ar' : 'en';
applePayInsertRequest.languageID = projectViewModel.isArabic ? 1 : 2; applePayInsertRequest.languageID = projectViewModel.isArabic ? 1 : 2;
applePayInsertRequest.userName = projectViewModel.authenticatedUserObject.user.patientID; applePayInsertRequest.userName = projectViewModel.authenticatedUserObject.user.patientID;
applePayInsertRequest.responseContinueURL = "http://hmg.com/Documents/success.html"; applePayInsertRequest.responseContinueURL = "http://hmg.com/Documents/success.html";
applePayInsertRequest.backClickUrl = "http://hmg.com/Documents/success.html"; applePayInsertRequest.backClickUrl = "http://hmg.com/Documents/success.html";
applePayInsertRequest.paymentOption = "ApplePay"; applePayInsertRequest.paymentOption = "ApplePay";
applePayInsertRequest.isMobSDK = true; applePayInsertRequest.isMobSDK = true;
applePayInsertRequest.merchantReference = transID; applePayInsertRequest.merchantReference = transID;
applePayInsertRequest.merchantIdentifier = payfortProjectDetailsRespModel.merchantIdentifier; applePayInsertRequest.merchantIdentifier = payfortProjectDetailsRespModel.merchantIdentifier;
applePayInsertRequest.commandType = "PURCHASE"; applePayInsertRequest.commandType = "PURCHASE";
applePayInsertRequest.signature = payfortProjectDetailsRespModel.signature; applePayInsertRequest.signature = payfortProjectDetailsRespModel.signature;
applePayInsertRequest.accessCode = payfortProjectDetailsRespModel.accessCode; applePayInsertRequest.accessCode = payfortProjectDetailsRespModel.accessCode;
applePayInsertRequest.shaRequestPhrase = payfortProjectDetailsRespModel.shaRequest; applePayInsertRequest.shaRequestPhrase = payfortProjectDetailsRespModel.shaRequest;
applePayInsertRequest.shaResponsePhrase = payfortProjectDetailsRespModel.shaResponse; applePayInsertRequest.shaResponsePhrase = payfortProjectDetailsRespModel.shaResponse;
applePayInsertRequest.returnURL = ""; applePayInsertRequest.returnURL = "";
service.applePayInsertRequest(applePayInsertRequest, context).then((res) async { service.applePayInsertRequest(applePayInsertRequest, localContext).then((res) async {
await context.read<PayfortViewModel>().initiateApplePayWithPayfort( await localContext.read<PayfortViewModel>().initiateApplePayWithPayfort(
customerName: projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName, customerName: projectViewModel.authenticatedUserObject.user.firstName + " " + projectViewModel.authenticatedUserObject.user.lastName,
customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress, customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
orderDescription: "LiveCare Payment", orderDescription: "LiveCare Payment",
orderAmount: double.parse(amount), orderAmount: double.parse(amount),
merchantReference: transID, merchantReference: transID,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel, payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
currency: projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR", currency: projectViewModel.authenticatedUserObject.user.outSA == 1 ? "AED" : "SAR",
onFailed: (failureResult) async { onFailed: (failureResult) async {
log("failureResult: ${failureResult.toString()}"); log("failureResult: ${failureResult.toString()}");
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(localContext);
AppToast.showErrorToast(message: failureResult.toString()); AppToast.showErrorToast(message: failureResult.toString());
}, },
onSuccess: (successResult) async { onSuccess: (successResult) async {
log("Payfort: ${successResult.responseMessage}"); GifLoaderDialogUtils.hideDialog(localContext);
await context.read<PayfortViewModel>().addPayfortApplePayResponse(result: successResult); log("Payfort: ${successResult.responseMessage}");
checkPaymentStatus(appo); await localContext.read<PayfortViewModel>().addPayfortApplePayResponse(result: successResult);
}, checkPaymentStatus(appo);
projectId: appo.projectID, },
serviceTypeEnum: ServiceTypeEnum.appointmentPayment, projectId: appo.projectID,
); serviceTypeEnum: ServiceTypeEnum.appointmentPayment,
}).catchError((err) { );
print(err); }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); print(err);
AppToast.showErrorToast(message: err); GifLoaderDialogUtils.hideDialog(localContext);
}); AppToast.showErrorToast(message: err);
});
} catch (ex) {
print(ex.toString());
GifLoaderDialogUtils.hideDialog(localContext);
}
} }
openPayment(List<String> paymentMethod, AuthenticatedUser authenticatedUser, num amount, AppoitmentAllHistoryResultList appo) { openPayment(List<String> paymentMethod, AuthenticatedUser authenticatedUser, num amount, AppoitmentAllHistoryResultList appo) {
browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context); browser = new MyInAppBrowser(onExitCallback: onBrowserExit, appo: appo, onLoadStartCallback: onBrowserLoadStart, context: context);
transID = Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo);
selectedPaymentMethod = paymentMethod[0]; selectedPaymentMethod = paymentMethod[0];
selectedInstallmentPlan = paymentMethod[1]; selectedInstallmentPlan = paymentMethod[1];
this.amount = amount.toString(); this.amount = amount.toString();
browser.openPaymentBrowser( browser.openPaymentBrowser(amount, "LiveCare Payment", widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode : transID, "12", authenticatedUser.emailAddress, paymentMethod[0],
amount, authenticatedUser.patientType, authenticatedUser.firstName, authenticatedUser.patientID, authenticatedUser, browser, false, "4", selectedClinicID, context, "", "", "", "", paymentMethod[1]);
"LiveCare Payment",
widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode : Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo),
"12",
authenticatedUser.emailAddress,
paymentMethod[0],
authenticatedUser.patientType,
authenticatedUser.firstName,
authenticatedUser.patientID,
authenticatedUser,
browser,
false,
"4",
selectedClinicID,
context,
"",
"",
"",
"",
paymentMethod[1]);
} }
onBrowserLoadStart(String url) { onBrowserLoadStart(String url) {
@ -560,10 +553,7 @@ class _clinic_listState extends State<ClinicList> {
final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed'; final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed';
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service service.checkPaymentStatus(widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode : transID, widget.isPharmacyLiveCare, context).then((res) {
.checkPaymentStatus(
widget.isPharmacyLiveCare ? widget.pharmacyLiveCareQRCode : Utils.getAppointmentTransID(appo.projectID, appo.clinicID, appo.appointmentNo), widget.isPharmacyLiveCare, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
String paymentInfo = res['Response_Message']; String paymentInfo = res['Response_Message'];
amount = res['Amount'].toString(); amount = res['Amount'].toString();
@ -611,7 +601,7 @@ class _clinic_listState extends State<ClinicList> {
isDataLoaded = false; isDataLoaded = false;
LiveCareService service = new LiveCareService(); LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getLivecareClinics(languageID == 'ar' ? 1: 2, context).then((res) { service.getLivecareClinics(languageID == 'ar' ? 1 : 2, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(res['PatientER_GetClinicsList'].length); print(res['PatientER_GetClinicsList'].length);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {

@ -49,12 +49,8 @@ class PayfortService extends BaseService {
"ECI": result.eci, "ECI": result.eci,
"Response_Message": result.responseMessage, "Response_Message": result.responseMessage,
"Card_Number": result.cardNumber, "Card_Number": result.cardNumber,
// "Card_Bin": result.ca,
"Status": result.status, "Status": result.status,
"Merchant_Ref": result.merchantReference, "Merchant_Ref": result.merchantReference,
// Installments_Number
// plan_code
// issuer_code
"Pat_Token": result.tokenName, "Pat_Token": result.tokenName,
"IsRefund": false, "IsRefund": false,
"RemmeberMe": false, "RemmeberMe": false,
@ -62,7 +58,6 @@ class PayfortService extends BaseService {
"LanguageID": 1, "LanguageID": 1,
}; };
// PayfortProjectDetailsRespModel payfortProjectDetailsRespModel = PayfortProjectDetailsRespModel();
await baseAppClient.post( await baseAppClient.post(
addPayFortApplePayResponse, addPayFortApplePayResponse,
onSuccess: (response, statusCode) async { onSuccess: (response, statusCode) async {

Loading…
Cancel
Save