CR implementation contd.

dev_3.16.3_Lab_CheckIn_6718
haroon amjad 1 year ago
parent b677be9e3c
commit c0af7070b1

@ -660,27 +660,27 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
service.applePayInsertRequest(applePayInsertRequest, context).then((res) async {
if (res["MessageStatus"] == 1) {
await context.read<PayfortViewModel>().initiateApplePayWithPayfort(
customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com",
orderDescription: "Ancillary Order Payment",
orderAmount: double.parse(getTotalValue()),
merchantReference: transID,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR",
onFailed: (failureResult) async {
GifLoaderDialogUtils.hideDialog(context);
log("failureResult: ${failureResult.toString()}");
AppToast.showErrorToast(message: failureResult.toString());
},
onSuccess: (successResult) async {
log("Payfort: ${successResult.responseMessage}");
await context.read<PayfortViewModel>().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult);
checkPaymentStatus(AppoitmentAllHistoryResultList());
},
projectId: widget.projectID,
serviceTypeEnum: ServiceTypeEnum.ancillaryOrder,
);
customerName: projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!,
// customerEmail: projectViewModel.authenticatedUserObject.user.emailAddress,
customerEmail: "CustID_${projectViewModel.user.patientID}@HMG.com",
orderDescription: "Ancillary Order Payment",
orderAmount: double.parse(getTotalValue()),
merchantReference: transID,
payfortProjectDetailsRespModel: payfortProjectDetailsRespModel,
currency: projectViewModel.user.outSA == 1 ? "AED" : "SAR",
onFailed: (failureResult) async {
GifLoaderDialogUtils.hideDialog(context);
log("failureResult: ${failureResult.toString()}");
AppToast.showErrorToast(message: failureResult.toString());
},
onSuccess: (successResult) async {
log("Payfort: ${successResult.responseMessage}");
await context.read<PayfortViewModel>().addPayfortApplePayResponse(projectViewModel.user.patientID!, result: successResult);
checkPaymentStatus(AppoitmentAllHistoryResultList());
},
projectId: widget.projectID,
serviceTypeEnum: ServiceTypeEnum.ancillaryOrder,
);
} else {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showErrorToast(message: "An error occurred while processing your request");
@ -819,10 +819,20 @@ class _AnicllaryOrdersState extends State<AnicllaryOrdersDetails> with SingleTic
createAdvancePayment(res, AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService();
List<dynamic> selectedProcListAPI = [];
selectedProcList.forEach((element) {
selectedProcListAPI.add({
"ApprovalLineItemNo": element.approvalLineItemNo,
"OrderLineItemNo": element.orderLineItemNo,
"ProcedureID": element.procedureID,
});
});
String paymentReference = res['Fort_id'].toString();
service.HIS_createAdvancePayment(appo, widget.projectID.toString(), res['Amount'], res['Fort_id'], res['PaymentMethod'], projectViewModel.user.patientType,
projectViewModel.user.firstName! + " " + projectViewModel.user.lastName!, projectViewModel.user.patientID, localContext,
isAncillaryOrder: true)
isAncillaryOrder: true, orderNo: widget.orderNo, appointmentID: widget.appoNo, selectedProcListAPI: selectedProcListAPI)
.then((res) {
addAdvancedNumberRequest(
Utils.isVidaPlusProject(projectViewModel, widget.projectID)

@ -1476,7 +1476,7 @@ class DoctorsListService extends BaseService {
Future<Map> HIS_createAdvancePayment(AppoitmentAllHistoryResultList appo, String projectID, double payedAmount, String paymentReference, String paymentMethodName, dynamic patientType,
String patientName, dynamic patientID, BuildContext context,
{bool isAncillaryOrder = false, int clinicID = 0}) async {
{bool isAncillaryOrder = false, int clinicID = 0, dynamic orderNo, dynamic appointmentID, List<dynamic> selectedProcListAPI = const []}) async {
Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
@ -1510,7 +1510,12 @@ class DoctorsListService extends BaseService {
"PatientTypeID": patientType,
"IsAncillaryOrder": isAncillaryOrder,
// "AncillaryProcedureList": ancillaryOrdersProcedureList,
"PatientType": patientType
"PatientType": patientType,
"RequestAncillaryOrderInvoice": isAncillaryOrder
? [
{"MemberID": 102, "ProjectID": projectID, "AppointmentNo": appointmentID, "OrderNo": orderNo, "AncillaryOrderInvoiceProcList": selectedProcListAPI}
]
: [],
};
dynamic localRes;
await baseAppClient.post(HIS_CREATE_ADVANCE_PAYMENT, onSuccess: (response, statusCode) async {
@ -1881,7 +1886,8 @@ class DoctorsListService extends BaseService {
return Future.value(localRes);
}
Future<Map> autoGenerateInvoiceERClinic(int? projectID, int? paymentMethod, String? paymentReferenceNo, num? amount, String? cardType, String? cardNumber, String? orderID, String? rrn, bool isAdvanceAvailable) async {
Future<Map> autoGenerateInvoiceERClinic(
int? projectID, int? paymentMethod, String? paymentReferenceNo, num? amount, String? cardType, String? cardNumber, String? orderID, String? rrn, bool isAdvanceAvailable) async {
Map<String, dynamic> request;
request = {
"ProjectID": projectID,

@ -38,9 +38,9 @@ class MyInAppBrowser extends InAppBrowser {
static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL LIVE
// static String APPLE_PAY_PAYFORT_URL = 'https://hmgwebservices.com/PayFortWebLive/PayFortApi/MakeApplePayRequest'; // Payfort Payment Gateway URL UAT
// static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
// static String SERVICE_URL = 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
// static String SERVICE_URL = 'https://uat.hmgwebservices.com/payfortforvidaplus/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL UAT VIDA PLUS

Loading…
Cancel
Save