|
|
|
|
@ -1,8 +1,6 @@
|
|
|
|
|
import 'dart:convert';
|
|
|
|
|
|
|
|
|
|
import 'package:diplomaticquarterapp/config/config.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
|
|
|
|
|
@ -13,14 +11,14 @@ class MyInAppBrowser extends InAppBrowser {
|
|
|
|
|
// 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 PREAUTH_SERVICE_URL =
|
|
|
|
|
// 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT
|
|
|
|
|
|
|
|
|
|
static String PREAUTH_SERVICE_URL =
|
|
|
|
|
'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
|
|
|
|
|
static String PREAUTH_SERVICE_URL =
|
|
|
|
|
'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
|
|
|
|
|
|
|
|
|
|
static List<String> successURLS = [
|
|
|
|
|
'success',
|
|
|
|
|
@ -42,6 +40,9 @@ class MyInAppBrowser extends InAppBrowser {
|
|
|
|
|
|
|
|
|
|
String deviceToken;
|
|
|
|
|
|
|
|
|
|
double lat = 0.0;
|
|
|
|
|
double long = 0.0;
|
|
|
|
|
|
|
|
|
|
static bool isPaymentDone = false;
|
|
|
|
|
|
|
|
|
|
MyInAppBrowser({this.onExitCallback, this.appo, this.onLoadStartCallback});
|
|
|
|
|
@ -98,6 +99,11 @@ class MyInAppBrowser extends InAppBrowser {
|
|
|
|
|
await this.sharedPref.getObject(USER_PROFILE));
|
|
|
|
|
authUser = data;
|
|
|
|
|
}
|
|
|
|
|
if (await this.sharedPref.getDouble(USER_LAT) != null &&
|
|
|
|
|
await this.sharedPref.getDouble(USER_LONG) != null) {
|
|
|
|
|
lat = await this.sharedPref.getDouble(USER_LAT);
|
|
|
|
|
long = await this.sharedPref.getDouble(USER_LONG);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
openPaymentBrowser(
|
|
|
|
|
@ -112,11 +118,22 @@ class MyInAppBrowser extends InAppBrowser {
|
|
|
|
|
dynamic patientID,
|
|
|
|
|
AuthenticatedUser authenticatedUser,
|
|
|
|
|
InAppBrowser browser) {
|
|
|
|
|
getDeviceToken();
|
|
|
|
|
this.browser = browser;
|
|
|
|
|
this.browser.openUrl(
|
|
|
|
|
url: generateURL(amount, orderDesc, transactionID, projId, emailId,
|
|
|
|
|
paymentMethod, patientType, patientName, patientID, authenticatedUser));
|
|
|
|
|
getPatientData();
|
|
|
|
|
generateURL(
|
|
|
|
|
amount,
|
|
|
|
|
orderDesc,
|
|
|
|
|
transactionID,
|
|
|
|
|
projId,
|
|
|
|
|
emailId,
|
|
|
|
|
paymentMethod,
|
|
|
|
|
patientType,
|
|
|
|
|
patientName,
|
|
|
|
|
patientID,
|
|
|
|
|
authenticatedUser)
|
|
|
|
|
.then((value) {
|
|
|
|
|
this.browser.openUrl(url: value);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
openBrowser(String url) {
|
|
|
|
|
@ -124,7 +141,7 @@ class MyInAppBrowser extends InAppBrowser {
|
|
|
|
|
this.browser.openUrl(url: url);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String generateURL(
|
|
|
|
|
Future<String> generateURL(
|
|
|
|
|
double amount,
|
|
|
|
|
String orderDesc,
|
|
|
|
|
String transactionID,
|
|
|
|
|
@ -137,15 +154,16 @@ class MyInAppBrowser extends InAppBrowser {
|
|
|
|
|
AuthenticatedUser authUser,
|
|
|
|
|
[var patientData,
|
|
|
|
|
var servID,
|
|
|
|
|
var LiveServID]) {
|
|
|
|
|
getPatientData();
|
|
|
|
|
var LiveServID]) async {
|
|
|
|
|
// getPatientData();
|
|
|
|
|
getDeviceToken();
|
|
|
|
|
String currentLanguageID = getLanguageID() == 'ar' ? 'AR' : 'EN';
|
|
|
|
|
String form = getForm();
|
|
|
|
|
|
|
|
|
|
// if (authUser != null) {
|
|
|
|
|
// form = form.replaceFirst("EMAIL_VALUE", authUser.emailAddress);
|
|
|
|
|
// } else {
|
|
|
|
|
form = form.replaceFirst("EMAIL_VALUE", emailId);
|
|
|
|
|
form = form.replaceFirst("EMAIL_VALUE", emailId);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
form = form.replaceFirst('AMOUNT_VALUE', amount.toString());
|
|
|
|
|
@ -157,12 +175,13 @@ class MyInAppBrowser extends InAppBrowser {
|
|
|
|
|
form = form.replaceFirst('LANG_VALUE', currentLanguageID);
|
|
|
|
|
form = form.replaceFirst('PATIENT_OUT_SA',
|
|
|
|
|
authUser.outSA == 0 ? false.toString() : true.toString());
|
|
|
|
|
form = form.replaceFirst('PATIENT_TYPE_ID',
|
|
|
|
|
patientData == null ? patientType.toString() : "1");
|
|
|
|
|
form = form.replaceFirst(
|
|
|
|
|
'PATIENT_TYPE_ID', patientData == null ? patientType.toString() : "1");
|
|
|
|
|
|
|
|
|
|
// form = form.replaceFirst('DEVICE_TOKEN', this.cs.sharedService.getSharedData(AuthenticationService.DEVICE_TOKEN, false) + "," + this.cs.sharedService.getSharedData(AuthenticationService.APNS_TOKEN, false));
|
|
|
|
|
// form = form.replaceFirst('LATITUDE_VALUE', this.cs.sharedService.getSharedData('userLat', false));
|
|
|
|
|
// form = form.replaceFirst('LONGITUDE_VALUE', this.cs.sharedService.getSharedData('userLong', false));
|
|
|
|
|
form = form.replaceFirst(
|
|
|
|
|
'DEVICE_TOKEN', await sharedPref.getString(PUSH_TOKEN));
|
|
|
|
|
form = form.replaceFirst('LATITUDE_VALUE', this.lat.toString());
|
|
|
|
|
form = form.replaceFirst('LONGITUDE_VALUE', this.long.toString());
|
|
|
|
|
|
|
|
|
|
if (servID == "4")
|
|
|
|
|
form = form.replaceFirst(
|
|
|
|
|
@ -179,16 +198,16 @@ class MyInAppBrowser extends InAppBrowser {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// if (patientData == null) {
|
|
|
|
|
form = form.replaceFirst('CUSTNAME_VALUE', patientName);
|
|
|
|
|
form = form.replaceFirst('CUSTID_VALUE', patientID.toString());
|
|
|
|
|
form = form.replaceFirst('CUSTNAME_VALUE', patientName);
|
|
|
|
|
form = form.replaceFirst('CUSTID_VALUE', patientID.toString());
|
|
|
|
|
// } else {
|
|
|
|
|
// form = form.replaceFirst('CUSTNAME_VALUE', patientData.depositorName);
|
|
|
|
|
// form = form.replaceFirst('CUSTID_VALUE', patientData.fileNumber);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
form = form.replaceFirst('LATITUDE_VALUE', "24.708488");
|
|
|
|
|
form = form.replaceFirst('LONGITUDE_VALUE', "46.665925");
|
|
|
|
|
form = form.replaceFirst('DEVICE_TOKEN', DEVICE_TOKEN);
|
|
|
|
|
// form = form.replaceFirst('LATITUDE_VALUE', "24.708488");
|
|
|
|
|
// form = form.replaceFirst('LONGITUDE_VALUE', "46.665925");
|
|
|
|
|
// form = form.replaceFirst('DEVICE_TOKEN', DEVICE_TOKEN);
|
|
|
|
|
|
|
|
|
|
var bytes = utf8.encode(form);
|
|
|
|
|
var base64Str = base64.encode(bytes);
|
|
|
|
|
|