7/20/1
This commit is contained in:
2
.env
2
.env
@@ -35,8 +35,6 @@ smsPasswordEgypt="J)Vh=qb/@MXrXlBl"
|
|||||||
chatGPTkeySeferNew4=zg-vlie-2l1ZlpxiLJ6wQOvbb4TnC9XrxgUEyVQIu6TID4qP4FUUqoS5XrXlBl
|
chatGPTkeySeferNew4=zg-vlie-2l1ZlpxiLJ6wQOvbb4TnC9XrxgUEyVQIu6TID4qP4FUUqoS5XrXlBl
|
||||||
anthropicAIkeySeferNew=zg-qbc-qvo39-n4VdMQ5nuJeIYhMN4PDYr7qox3-t2i1Lh7aNTDfYF-Gf8whUJZCs47EeelKn8_UcmUMmiSLaf0UJg0DvUlQrDt-76CRrkQQXrXlBl
|
anthropicAIkeySeferNew=zg-qbc-qvo39-n4VdMQ5nuJeIYhMN4PDYr7qox3-t2i1Lh7aNTDfYF-Gf8whUJZCs47EeelKn8_UcmUMmiSLaf0UJg0DvUlQrDt-76CRrkQQXrXlBl
|
||||||
llama3Key=kzg_uTXy3e9DBbCQ1FnMGxYwTKysx9US1burxJj4fFwOje4LZBUFKJS1XrXlBl
|
llama3Key=kzg_uTXy3e9DBbCQ1FnMGxYwTKysx9US1burxJj4fFwOje4LZBUFKJS1XrXlBl
|
||||||
payMobOutClientSecrret='xyjjRlahJM0Xc38WjApCOh8bvgL9slFpNdM9YeCu9AhLqboKMPtmSvc2N9O4tXxFLV2JAV6stBSTAGFGCVubGe6MNpc7MzJnZ3SiT6GpavBoCLWkUvVbdSDaM0zHvuBOXrXlBl'
|
|
||||||
payMobOutClient_id='Z05ut48dVkS2gI2zenFFcKsfDKfHAU0WELqKyJ0LXrXlBl'
|
|
||||||
payMobOutPassword='D2zJFxkE#LN3vz38z2dYxpNfWXrXlBl'
|
payMobOutPassword='D2zJFxkE#LN3vz38z2dYxpNfWXrXlBl'
|
||||||
payMobOutUserName='zjujl_qvo_fwjfgjlXrXlBl'
|
payMobOutUserName='zjujl_qvo_fwjfgjlXrXlBl'
|
||||||
keyOfApp=nqryjp@1737wqnmqqsjyzjujljksvceiXrXlBl
|
keyOfApp=nqryjp@1737wqnmqqsjyzjujljksvceiXrXlBl
|
||||||
|
|||||||
@@ -55,8 +55,8 @@ android {
|
|||||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion 34
|
targetSdkVersion 34
|
||||||
versionCode 60
|
versionCode 61
|
||||||
versionName '1.5.60'
|
versionName '1.5.61'
|
||||||
// manifestPlaceholders = [mapsApiKey: 'android/app/src/main/AndroidManifest.xml']
|
// manifestPlaceholders = [mapsApiKey: 'android/app/src/main/AndroidManifest.xml']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,10 @@ import '../env/env.dart';
|
|||||||
import 'char_map.dart';
|
import 'char_map.dart';
|
||||||
|
|
||||||
class AK {
|
class AK {
|
||||||
static final String publishableKey =
|
static final String publishableKeyStripe =
|
||||||
X.r(X.r(X.r(Env.stripePublishableKe, cn), cC), cs);
|
X.r(X.r(X.r(Env.stripePublishableKe, cn), cC), cs);
|
||||||
static final String secretKey = X.r(X.r(X.r(Env.secretKey, cn), cC), cs);
|
static final String secretKeyStripe =
|
||||||
|
X.r(X.r(X.r(Env.secretKey, cn), cC), cs);
|
||||||
static final String basicAuthCredentials =
|
static final String basicAuthCredentials =
|
||||||
X.r(X.r(X.r(Env.basicAuthCredentials, cn), cC), cs);
|
X.r(X.r(X.r(Env.basicAuthCredentials, cn), cC), cs);
|
||||||
static final String basicCompareFaces =
|
static final String basicCompareFaces =
|
||||||
@@ -61,10 +62,7 @@ class AK {
|
|||||||
static final String anthropicAIkeySeferNew =
|
static final String anthropicAIkeySeferNew =
|
||||||
X.r(X.r(X.r(Env.anthropicAIkeySeferNew, cn), cC), cs);
|
X.r(X.r(X.r(Env.anthropicAIkeySeferNew, cn), cC), cs);
|
||||||
static final String llama3Key = X.r(X.r(X.r(Env.llama3Key, cn), cC), cs);
|
static final String llama3Key = X.r(X.r(X.r(Env.llama3Key, cn), cC), cs);
|
||||||
static final String payMobOutClientSecrret =
|
|
||||||
X.r(X.r(X.r(Env.payMobOutClientSecrret, cn), cC), cs);
|
|
||||||
static final String payMobOutClient_id =
|
|
||||||
X.r(X.r(X.r(Env.payMobOutClient_id, cn), cC), cs);
|
|
||||||
static final String payMobOutPassword =
|
static final String payMobOutPassword =
|
||||||
X.r(X.r(X.r(Env.payMobOutPassword, cn), cC), cs);
|
X.r(X.r(X.r(Env.payMobOutPassword, cn), cC), cs);
|
||||||
static final String payMobOutUserName =
|
static final String payMobOutUserName =
|
||||||
@@ -73,3 +71,8 @@ class AK {
|
|||||||
///////////
|
///////////
|
||||||
static final String keyOfApp = X.r(X.r(X.r(Env.keyOfApp, cn), cC), cs);
|
static final String keyOfApp = X.r(X.r(X.r(Env.keyOfApp, cn), cC), cs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class KN {
|
||||||
|
static const String pmobsec = 'PAYMOBOUTCLIENTSECRET';
|
||||||
|
static const String pmobid = 'PAYMOBOUTCLIENT_ID';
|
||||||
|
}
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ class AppLink {
|
|||||||
static String getRides = "$ride/rides/get.php";
|
static String getRides = "$ride/rides/get.php";
|
||||||
static String getRideOrderID = "$ride/rides/getRideOrderID.php";
|
static String getRideOrderID = "$ride/rides/getRideOrderID.php";
|
||||||
static String getRideStatus = "$ride/rides/getRideStatus.php";
|
static String getRideStatus = "$ride/rides/getRideStatus.php";
|
||||||
|
static String getapiKey = "$ride/apiKey/get.php";
|
||||||
static String getRideStatusBegin = "$ride/rides/getRideStatusBegin.php";
|
static String getRideStatusBegin = "$ride/rides/getRideStatusBegin.php";
|
||||||
static String getRideStatusFromStartApp =
|
static String getRideStatusFromStartApp =
|
||||||
"$ride/rides/getRideStatusFromStartApp.php";
|
"$ride/rides/getRideStatusFromStartApp.php";
|
||||||
|
|||||||
@@ -27,8 +27,6 @@ class CRUD {
|
|||||||
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials.toString()))}',
|
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials.toString()))}',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
print(response.request);
|
|
||||||
print(response.body);
|
|
||||||
// if (response.statusCode == 200) {
|
// if (response.statusCode == 200) {
|
||||||
var jsonData = jsonDecode(response.body);
|
var jsonData = jsonDecode(response.body);
|
||||||
if (jsonData['status'] == 'success') {
|
if (jsonData['status'] == 'success') {
|
||||||
@@ -194,7 +192,7 @@ class CRUD {
|
|||||||
body: payload,
|
body: payload,
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/x-www-form-urlencoded",
|
"Content-Type": "application/x-www-form-urlencoded",
|
||||||
'Authorization': 'Bearer ${AK.secretKey}',
|
'Authorization': 'Bearer ${AK.secretKeyStripe}',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
@@ -220,9 +218,6 @@ class CRUD {
|
|||||||
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials))}',
|
'Basic ${base64Encode(utf8.encode(AK.basicAuthCredentials))}',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
// print(response.request);
|
|
||||||
// print(response.body);
|
|
||||||
// print(payload);
|
|
||||||
var jsonData = jsonDecode(response.body);
|
var jsonData = jsonDecode(response.body);
|
||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
if (jsonData['status'] == 'success') {
|
if (jsonData['status'] == 'success') {
|
||||||
|
|||||||
@@ -16,9 +16,12 @@ import 'package:image_picker/image_picker.dart';
|
|||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
import 'package:image/image.dart' as img;
|
import 'package:image/image.dart' as img;
|
||||||
import 'package:path_provider/path_provider.dart';
|
import 'package:path_provider/path_provider.dart';
|
||||||
|
import 'package:secure_string_operations/secure_string_operations.dart';
|
||||||
|
|
||||||
import '../../constant/api_key.dart';
|
import '../../constant/api_key.dart';
|
||||||
|
import '../../constant/char_map.dart';
|
||||||
import '../../constant/colors.dart';
|
import '../../constant/colors.dart';
|
||||||
|
import '../../print.dart';
|
||||||
import 'tts.dart';
|
import 'tts.dart';
|
||||||
import 'upload_image.dart';
|
import 'upload_image.dart';
|
||||||
|
|
||||||
@@ -157,44 +160,45 @@ class AI extends GetxController {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
} else if (responseIdEgyptDriverLicense['national_number'] !=
|
|
||||||
responseIdEgyptBack['nationalID']) {
|
|
||||||
Get.defaultDialog(
|
|
||||||
barrierDismissible: false,
|
|
||||||
title: 'ID Mismatch',
|
|
||||||
content: Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
children: [
|
|
||||||
const Icon(Icons.warning, size: 48, color: Colors.red),
|
|
||||||
const SizedBox(height: 16),
|
|
||||||
Text(
|
|
||||||
"The national number on your driver’s license does not match the one on your ID document. Please verify and provide the correct documents."
|
|
||||||
.tr,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 16),
|
|
||||||
IconButton(
|
|
||||||
onPressed: () async {
|
|
||||||
await Get.find<TextToSpeechController>().speakText(
|
|
||||||
"The national number on your driver’s license does not match the one on your ID document. Please verify and provide the correct documents."
|
|
||||||
.tr,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
icon: const Icon(Icons.volume_up),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
actions: [
|
|
||||||
TextButton(
|
|
||||||
onPressed: () {
|
|
||||||
Get.back();
|
|
||||||
},
|
|
||||||
child: const Text('OK'),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
// else if (responseIdEgyptDriverLicense['national_number'] !=
|
||||||
|
// responseIdEgyptBack['nationalID']) {
|
||||||
|
// Get.defaultDialog(
|
||||||
|
// barrierDismissible: false,
|
||||||
|
// title: 'ID Mismatch'.tr,
|
||||||
|
// content: Column(
|
||||||
|
// mainAxisSize: MainAxisSize.min,
|
||||||
|
// children: [
|
||||||
|
// const Icon(Icons.warning, size: 48, color: Colors.red),
|
||||||
|
// const SizedBox(height: 16),
|
||||||
|
// Text(
|
||||||
|
// "The national number on your driver’s license does not match the one on your ID document. Please verify and provide the correct documents."
|
||||||
|
// .tr,
|
||||||
|
// textAlign: TextAlign.center,
|
||||||
|
// style: AppStyle.title,
|
||||||
|
// ),
|
||||||
|
// const SizedBox(height: 16),
|
||||||
|
// IconButton(
|
||||||
|
// onPressed: () async {
|
||||||
|
// await Get.find<TextToSpeechController>().speakText(
|
||||||
|
// "The national number on your driver’s license does not match the one on your ID document. Please verify and provide the correct documents."
|
||||||
|
// .tr,
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// icon: const Icon(Icons.volume_up),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// actions: [
|
||||||
|
// TextButton(
|
||||||
|
// onPressed: () {
|
||||||
|
// Get.back();
|
||||||
|
// },
|
||||||
|
// child: const Text('OK'),
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// );
|
||||||
|
// }
|
||||||
// else if (responseCriminalRecordEgypt['FullName'] !=
|
// else if (responseCriminalRecordEgypt['FullName'] !=
|
||||||
// responseIdEgyptDriverLicense['name_arabic']) {
|
// responseIdEgyptDriverLicense['name_arabic']) {
|
||||||
// Get.defaultDialog(
|
// Get.defaultDialog(
|
||||||
@@ -304,7 +308,6 @@ class AI extends GetxController {
|
|||||||
var status1 = jsonDecode(res);
|
var status1 = jsonDecode(res);
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
update();
|
update();
|
||||||
print(res);
|
|
||||||
// Handle response
|
// Handle response
|
||||||
if (status1['status'] == 'success') {
|
if (status1['status'] == 'success') {
|
||||||
isDriverSaved = true;
|
isDriverSaved = true;
|
||||||
@@ -471,13 +474,13 @@ class AI extends GetxController {
|
|||||||
// if (imagePath == 'driver_license') {
|
// if (imagePath == 'driver_license') {
|
||||||
// await ImageController().choosFaceFromDriverLicense(linkPHP, 'face');
|
// await ImageController().choosFaceFromDriverLicense(linkPHP, 'face');
|
||||||
// }
|
// }
|
||||||
|
|
||||||
await Future.delayed(const Duration(seconds: 2));
|
await Future.delayed(const Duration(seconds: 2));
|
||||||
|
|
||||||
var extractedString =
|
var extractedString =
|
||||||
await CRUD().arabicTextExtractByVisionAndAI(imagePath: imagePath);
|
await CRUD().arabicTextExtractByVisionAndAI(imagePath: imagePath);
|
||||||
var json = jsonDecode(extractedString);
|
var json = jsonDecode(extractedString);
|
||||||
var textValues = CRUD().extractTextFromLines(json);
|
var textValues = CRUD().extractTextFromLines(json);
|
||||||
print('textValues: ${textValues}');
|
|
||||||
|
|
||||||
DocumentType detectedType = checkDocumentType(textValues);
|
DocumentType detectedType = checkDocumentType(textValues);
|
||||||
String expectedDocument = getExpectedDocument(imagePath);
|
String expectedDocument = getExpectedDocument(imagePath);
|
||||||
@@ -496,7 +499,6 @@ class AI extends GetxController {
|
|||||||
await Get.put(AI()).anthropicAI(textValues, prompt, imagePath);
|
await Get.put(AI()).anthropicAI(textValues, prompt, imagePath);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Error in allMethodForAI: $e');
|
|
||||||
MyDialog().getDialog('error'.tr, 'error_processing_document'.tr, () {
|
MyDialog().getDialog('error'.tr, 'error_processing_document'.tr, () {
|
||||||
Get.back();
|
Get.back();
|
||||||
});
|
});
|
||||||
@@ -681,7 +683,6 @@ class AI extends GetxController {
|
|||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
var responseData = jsonDecode(utf8.decode(response.bodyBytes));
|
var responseData = jsonDecode(utf8.decode(response.bodyBytes));
|
||||||
// Process the responseData as needed
|
// Process the responseData as needed
|
||||||
print(responseData);
|
|
||||||
|
|
||||||
responseForComplaint = jsonDecode(responseData['content'][0]['text']);
|
responseForComplaint = jsonDecode(responseData['content'][0]['text']);
|
||||||
}
|
}
|
||||||
@@ -697,7 +698,7 @@ class AI extends GetxController {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
var k = X.r(X.r(X.r(await getAIKey('CLAUDAISEFER'), cn), cC), cs);
|
||||||
var requestBody = jsonEncode({
|
var requestBody = jsonEncode({
|
||||||
"model": "claude-3-haiku-20240307",
|
"model": "claude-3-haiku-20240307",
|
||||||
"max_tokens": 1024,
|
"max_tokens": 1024,
|
||||||
@@ -709,7 +710,7 @@ class AI extends GetxController {
|
|||||||
final response = await http.post(
|
final response = await http.post(
|
||||||
Uri.parse('https://api.anthropic.com/v1/messages'),
|
Uri.parse('https://api.anthropic.com/v1/messages'),
|
||||||
headers: {
|
headers: {
|
||||||
'x-api-key': AK.anthropicAIkeySeferNew,
|
'x-api-key': k,
|
||||||
'anthropic-version': '2023-06-01',
|
'anthropic-version': '2023-06-01',
|
||||||
'content-type': 'application/json'
|
'content-type': 'application/json'
|
||||||
},
|
},
|
||||||
@@ -719,7 +720,6 @@ class AI extends GetxController {
|
|||||||
if (response.statusCode == 200) {
|
if (response.statusCode == 200) {
|
||||||
var responseData = jsonDecode(utf8.decode(response.bodyBytes));
|
var responseData = jsonDecode(utf8.decode(response.bodyBytes));
|
||||||
// Process the responseData as needed
|
// Process the responseData as needed
|
||||||
print(responseData);
|
|
||||||
if (idType == 'car_back') {
|
if (idType == 'car_back') {
|
||||||
responseIdCardDriverEgyptBack =
|
responseIdCardDriverEgyptBack =
|
||||||
jsonDecode(responseData['content'][0]['text']);
|
jsonDecode(responseData['content'][0]['text']);
|
||||||
@@ -1417,10 +1417,16 @@ Output the extracted information in the following JSON formate and make date for
|
|||||||
if (res != 'failure') {
|
if (res != 'failure') {
|
||||||
var d = jsonDecode(res)['message'];
|
var d = jsonDecode(res)['message'];
|
||||||
prompts = d;
|
prompts = d;
|
||||||
// print('prompts: ${prompts}');
|
} else {}
|
||||||
} else {
|
}
|
||||||
print(res);
|
|
||||||
}
|
getAIKey(String key) async {
|
||||||
|
var res =
|
||||||
|
await CRUD().get(link: AppLink.getapiKey, payload: {"keyName": key});
|
||||||
|
if (res != 'failure') {
|
||||||
|
var d = jsonDecode(res)['message'];
|
||||||
|
return d[key].toString();
|
||||||
|
} else {}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ class CaptainWalletController extends GetxController {
|
|||||||
link: AppLink.getAllPaymentFromRide,
|
link: AppLink.getAllPaymentFromRide,
|
||||||
payload: {'driverID': box.read(BoxName.driverID)},
|
payload: {'driverID': box.read(BoxName.driverID)},
|
||||||
);
|
);
|
||||||
isLoading = false;
|
// isLoading = false;
|
||||||
if (res != 'failure') {
|
if (res != 'failure') {
|
||||||
walletDate = jsonDecode(res);
|
walletDate = jsonDecode(res);
|
||||||
totalAmount = walletDate['message'][0]['total_amount'] ?? '0';
|
totalAmount = walletDate['message'][0]['total_amount'] ?? '0';
|
||||||
@@ -120,11 +120,14 @@ class CaptainWalletController extends GetxController {
|
|||||||
totalAmountVisa = walletDateVisa['message'][0]['diff'] ?? '0';
|
totalAmountVisa = walletDateVisa['message'][0]['diff'] ?? '0';
|
||||||
|
|
||||||
update();
|
update();
|
||||||
|
} else {
|
||||||
|
totalAmount = "0";
|
||||||
|
totalAmountVisa = "0";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future getCaptainWalletFromBuyPoints() async {
|
Future getCaptainWalletFromBuyPoints() async {
|
||||||
isLoading = true;
|
// isLoading = true;
|
||||||
update();
|
update();
|
||||||
|
|
||||||
var res = await CRUD().get(
|
var res = await CRUD().get(
|
||||||
@@ -134,8 +137,7 @@ class CaptainWalletController extends GetxController {
|
|||||||
isLoading = false;
|
isLoading = false;
|
||||||
// update();
|
// update();
|
||||||
walletDriverPointsDate = jsonDecode(res);
|
walletDriverPointsDate = jsonDecode(res);
|
||||||
if (walletDriverPointsDate['message'][0]['driverID'].toString() ==
|
if (res != 'failure') {
|
||||||
box.read(BoxName.driverID).toString()) {
|
|
||||||
double totalPointsDouble = double.parse(
|
double totalPointsDouble = double.parse(
|
||||||
walletDriverPointsDate['message'][0]['total_amount'].toString());
|
walletDriverPointsDate['message'][0]['total_amount'].toString());
|
||||||
totalPoints = totalPointsDouble.toStringAsFixed(0);
|
totalPoints = totalPointsDouble.toStringAsFixed(0);
|
||||||
|
|||||||
@@ -4,9 +4,12 @@ import 'package:SEFER/constant/api_key.dart';
|
|||||||
import 'package:SEFER/constant/box_name.dart';
|
import 'package:SEFER/constant/box_name.dart';
|
||||||
import 'package:SEFER/constant/colors.dart';
|
import 'package:SEFER/constant/colors.dart';
|
||||||
import 'package:SEFER/main.dart';
|
import 'package:SEFER/main.dart';
|
||||||
|
import 'package:SEFER/print.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:http/http.dart' as http;
|
import 'package:http/http.dart' as http;
|
||||||
|
import 'package:secure_string_operations/secure_string_operations.dart';
|
||||||
|
|
||||||
|
import '../../../constant/char_map.dart';
|
||||||
import '../../../constant/links.dart';
|
import '../../../constant/links.dart';
|
||||||
import '../../functions/crud.dart';
|
import '../../functions/crud.dart';
|
||||||
import 'captain_wallet_controller.dart';
|
import 'captain_wallet_controller.dart';
|
||||||
@@ -21,12 +24,16 @@ class PaymobPayout extends GetxController {
|
|||||||
// 'Cookie':
|
// 'Cookie':
|
||||||
// 'csrftoken=74iZJ8XYyuTm5WRq2W4tpWX5eqoJLZVK5QhuDrChWpDtzpgGA269bbCWuEcW85t4'
|
// 'csrftoken=74iZJ8XYyuTm5WRq2W4tpWX5eqoJLZVK5QhuDrChWpDtzpgGA269bbCWuEcW85t4'
|
||||||
};
|
};
|
||||||
|
var payMobOutClientSecrret =
|
||||||
|
X.r(X.r(X.r(await getAIKey(KN.pmobsec), cn), cC), cs);
|
||||||
|
var payMobOutClientId =
|
||||||
|
X.r(X.r(X.r(await getAIKey(KN.pmobid), cn), cC), cs);
|
||||||
var body = {
|
var body = {
|
||||||
'grant_type': 'password',
|
'grant_type': 'password',
|
||||||
'username': AK.payMobOutUserName,
|
'username': AK.payMobOutUserName,
|
||||||
'password': AK.payMobOutPassword,
|
'password': AK.payMobOutPassword,
|
||||||
'client_id': AK.payMobOutClient_id,
|
'client_id': payMobOutClientId,
|
||||||
'client_secret': AK.payMobOutClientSecrret
|
'client_secret': payMobOutClientSecrret
|
||||||
};
|
};
|
||||||
var res = await http.post(
|
var res = await http.post(
|
||||||
Uri.parse('https://payouts.paymobsolutions.com/api/secure/o/token/'),
|
Uri.parse('https://payouts.paymobsolutions.com/api/secure/o/token/'),
|
||||||
@@ -61,11 +68,12 @@ class PaymobPayout extends GetxController {
|
|||||||
var dec = jsonDecode(res.body);
|
var dec = jsonDecode(res.body);
|
||||||
if (dec['disbursement_status'] == 'successful') {
|
if (dec['disbursement_status'] == 'successful') {
|
||||||
var paymentToken = await Get.find<CaptainWalletController>()
|
var paymentToken = await Get.find<CaptainWalletController>()
|
||||||
.generateToken(((-1) * (double.parse(dec['amount'])) - payOutFee)
|
.generateToken(
|
||||||
.toStringAsFixed(0));
|
((-1) * (double.parse(dec['amount'].toString())) - payOutFee)
|
||||||
|
.toStringAsFixed(0));
|
||||||
await CRUD().post(link: AppLink.addDrivePayment, payload: {
|
await CRUD().post(link: AppLink.addDrivePayment, payload: {
|
||||||
'rideId': DateTime.now().toIso8601String(),
|
'rideId': DateTime.now().toIso8601String(),
|
||||||
'amount': ((-1) * (double.parse(dec['amount'])) - payOutFee)
|
'amount': ((-1) * (double.parse(dec['amount'].toString())) - payOutFee)
|
||||||
.toStringAsFixed(0),
|
.toStringAsFixed(0),
|
||||||
'payment_method': 'payout',
|
'payment_method': 'payout',
|
||||||
'passengerID': 'myself',
|
'passengerID': 'myself',
|
||||||
@@ -87,7 +95,7 @@ class PaymobPayout extends GetxController {
|
|||||||
'${'Transaction successful'.tr} ${dec['amount']}',
|
'${'Transaction successful'.tr} ${dec['amount']}',
|
||||||
backgroundColor: AppColor.greenColor);
|
backgroundColor: AppColor.greenColor);
|
||||||
|
|
||||||
Get.find<CaptainWalletController>().getCaptainWalletFromRide();
|
Get.find<CaptainWalletController>().refreshCaptainWallet();
|
||||||
} else if (dec['disbursement_status'] == 'failed') {
|
} else if (dec['disbursement_status'] == 'failed') {
|
||||||
Get.snackbar('Transaction failed'.tr, 'Transaction failed'.tr,
|
Get.snackbar('Transaction failed'.tr, 'Transaction failed'.tr,
|
||||||
backgroundColor: AppColor.redColor);
|
backgroundColor: AppColor.redColor);
|
||||||
@@ -112,6 +120,15 @@ class PaymobPayout extends GetxController {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getAIKey(String key) async {
|
||||||
|
var res =
|
||||||
|
await CRUD().get(link: AppLink.getapiKey, payload: {"keyName": key});
|
||||||
|
if (res != 'failure') {
|
||||||
|
var d = jsonDecode(res)['message'];
|
||||||
|
return d[key].toString();
|
||||||
|
} else {}
|
||||||
|
}
|
||||||
|
|
||||||
payToDriverBankAccount(String token, String amount, String bankCardNumber,
|
payToDriverBankAccount(String token, String amount, String bankCardNumber,
|
||||||
String bankCode) async {
|
String bankCode) async {
|
||||||
var headers = {
|
var headers = {
|
||||||
@@ -127,13 +144,46 @@ class PaymobPayout extends GetxController {
|
|||||||
"bank_code": bankCode, //"CIB",
|
"bank_code": bankCode, //"CIB",
|
||||||
"bank_transaction_type": "cash_transfer"
|
"bank_transaction_type": "cash_transfer"
|
||||||
};
|
};
|
||||||
var res = await http
|
var res = await http.post(
|
||||||
.post(
|
Uri.parse('https://payouts.paymobsolutions.com/api/secure/disburse/'),
|
||||||
Uri.parse('https://payouts.paymobsolutions.com/api/secure/disburse/'),
|
headers: headers,
|
||||||
headers: headers,
|
body: body,
|
||||||
body: body,
|
);
|
||||||
)
|
var dec = jsonDecode(res.body);
|
||||||
.then((value) {});
|
if (dec['disbursement_status'] == 'successful') {
|
||||||
|
var paymentToken = await Get.find<CaptainWalletController>()
|
||||||
|
.generateToken(
|
||||||
|
((-1) * (double.parse(dec['amount'].toString())) - payOutFee)
|
||||||
|
.toStringAsFixed(0));
|
||||||
|
await CRUD().post(link: AppLink.addDrivePayment, payload: {
|
||||||
|
'rideId': DateTime.now().toIso8601String(),
|
||||||
|
'amount': ((-1) * (double.parse(dec['amount'].toString())) - payOutFee)
|
||||||
|
.toStringAsFixed(0),
|
||||||
|
'payment_method': 'payout',
|
||||||
|
'passengerID': 'myself',
|
||||||
|
'token': paymentToken,
|
||||||
|
'driverID': box.read(BoxName.driverID).toString(),
|
||||||
|
});
|
||||||
|
await Get.find<CaptainWalletController>()
|
||||||
|
.addSeferWallet('payout fee myself', payOutFee.toString());
|
||||||
|
await updatePaymentToPaid(box.read(BoxName.driverID).toString());
|
||||||
|
await sendEmail(
|
||||||
|
box.read(BoxName.driverID).toString(),
|
||||||
|
amount,
|
||||||
|
box.read(BoxName.phoneDriver).toString(),
|
||||||
|
box.read(BoxName.nameDriver).toString(),
|
||||||
|
'Wallet',
|
||||||
|
box.read(BoxName.emailDriver).toString());
|
||||||
|
|
||||||
|
Get.snackbar('Transaction successful'.tr,
|
||||||
|
'${'Transaction successful'.tr} ${dec['amount']}',
|
||||||
|
backgroundColor: AppColor.greenColor);
|
||||||
|
|
||||||
|
Get.find<CaptainWalletController>().refreshCaptainWallet();
|
||||||
|
} else if (dec['disbursement_status'] == 'failed') {
|
||||||
|
Get.snackbar('Transaction failed'.tr, 'Transaction failed'.tr,
|
||||||
|
backgroundColor: AppColor.redColor);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future payToWalletDriverAll(
|
Future payToWalletDriverAll(
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ class MyTranslation extends Translations {
|
|||||||
@override
|
@override
|
||||||
Map<String, Map<String, String>> get keys => {
|
Map<String, Map<String, String>> get keys => {
|
||||||
"ar": {
|
"ar": {
|
||||||
|
'ID Mismatch': "عدم تطابق الرقم التعريفي",
|
||||||
"face detect": "كشف الوجه",
|
"face detect": "كشف الوجه",
|
||||||
"Face Detection Result": "نتيجة كشف الوجه",
|
"Face Detection Result": "نتيجة كشف الوجه",
|
||||||
"false": "خطأ",
|
"false": "خطأ",
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ void main() async {
|
|||||||
|
|
||||||
await AC().gAK();
|
await AC().gAK();
|
||||||
|
|
||||||
Stripe.publishableKey = AK.publishableKey;
|
Stripe.publishableKey = AK.publishableKeyStripe;
|
||||||
|
|
||||||
if (Platform.isAndroid || Platform.isIOS) {
|
if (Platform.isAndroid || Platform.isIOS) {
|
||||||
await Firebase.initializeApp(
|
await Firebase.initializeApp(
|
||||||
|
|||||||
13
lib/print.dart
Normal file
13
lib/print.dart
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import 'dart:developer' as developer;
|
||||||
|
|
||||||
|
class Log {
|
||||||
|
Log._();
|
||||||
|
|
||||||
|
static void print(String value, {StackTrace? stackTrace}) {
|
||||||
|
developer.log(value, name: 'LOG', stackTrace: stackTrace);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Object? inspect(Object? object) {
|
||||||
|
return developer.inspect(object);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,12 +5,15 @@ import 'package:SEFER/views/widgets/my_circular_indicator_timer.dart';
|
|||||||
import 'package:SEFER/views/widgets/my_textField.dart';
|
import 'package:SEFER/views/widgets/my_textField.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:secure_string_operations/secure_string_operations.dart';
|
||||||
import 'package:url_launcher/url_launcher.dart';
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
import '../../../../constant/char_map.dart';
|
||||||
import '../../../../constant/colors.dart';
|
import '../../../../constant/colors.dart';
|
||||||
import '../../../../constant/links.dart';
|
import '../../../../constant/links.dart';
|
||||||
import '../../../../constant/style.dart';
|
import '../../../../constant/style.dart';
|
||||||
import '../../../../controller/functions/package_info.dart';
|
import '../../../../controller/functions/package_info.dart';
|
||||||
import '../../../../controller/functions/upload_image.dart';
|
import '../../../../controller/functions/upload_image.dart';
|
||||||
|
import '../../../../print.dart';
|
||||||
import '../../../widgets/my_scafold.dart';
|
import '../../../widgets/my_scafold.dart';
|
||||||
|
|
||||||
class EgyptCardAI extends StatelessWidget {
|
class EgyptCardAI extends StatelessWidget {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import 'package:SEFER/constant/box_name.dart';
|
import 'package:SEFER/constant/box_name.dart';
|
||||||
import 'package:SEFER/main.dart';
|
import 'package:SEFER/main.dart';
|
||||||
import 'package:SEFER/views/auth/captin/cards/egypt_card_a_i.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -27,30 +26,18 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
|||||||
// borderRadius: BorderRadius.circular(15)),
|
// borderRadius: BorderRadius.circular(15)),
|
||||||
// child: IconButton(
|
// child: IconButton(
|
||||||
// onPressed: () {
|
// onPressed: () {
|
||||||
// AC credentials = AC();
|
|
||||||
|
|
||||||
// // String apikey = AK.passwordPayMob;
|
|
||||||
// // String convertedStringN = credentials.c(
|
|
||||||
// // credentials.c(credentials.c(apikey, cs), cC), cn);
|
|
||||||
// // String retrievedStringS = credentials.r(
|
|
||||||
// // credentials.r(credentials.r(convertedStringN, cn), cC),
|
|
||||||
// // cs);
|
|
||||||
// // //
|
|
||||||
// // if (retrievedStringS ==
|
|
||||||
// // 'apikey') {
|
|
||||||
// // }
|
|
||||||
|
|
||||||
// // key.forEach((key, apiKey) {
|
// // key.forEach((key, apiKey) {
|
||||||
// // Get.to(() => SmsSignupEgypt());
|
// // Get.to(() => SmsSignupEgypt());
|
||||||
// // keys.forEach((key, apiKey) {
|
// // keys.forEach((key, apiKey) {
|
||||||
// // String apikey = Env.basicAuthCredentials;
|
// String apikey = AK.secretKeyStripe;
|
||||||
// // String retrievedStringS = credentials.r(
|
// Log.print('apikey: ${apikey}');
|
||||||
// // credentials.r(credentials.r(apikey, cn), cC), cs);
|
|
||||||
// // String encryptedApiKey =
|
|
||||||
// // X.c(X.c(X.c(retrievedStringS, cs), cC), cn);
|
|
||||||
|
|
||||||
// // String decryptedApiKey =
|
// String encryptedApiKey = X.c(X.c(X.c(apikey, cs), cC), cn);
|
||||||
// // X.r(X.r(X.r(encryptedApiKey, cn), cC), cs);
|
// Log.print('encryptedApiKey: ${encryptedApiKey}');
|
||||||
|
|
||||||
|
// String decryptedApiKey =
|
||||||
|
// X.r(X.r(X.r(encryptedApiKey, cn), cC), cs);
|
||||||
|
// Log.print('decryptedApiKey: ${decryptedApiKey}');
|
||||||
|
|
||||||
// // if (decryptedApiKey == retrievedStringS) {
|
// // if (decryptedApiKey == retrievedStringS) {
|
||||||
// // } else {
|
// // } else {
|
||||||
@@ -65,9 +52,9 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
|||||||
// )),
|
// )),
|
||||||
// ),
|
// ),
|
||||||
|
|
||||||
const SizedBox(
|
// const SizedBox(
|
||||||
height: 5,
|
// height: 5,
|
||||||
),
|
// ),
|
||||||
AnimatedContainer(
|
AnimatedContainer(
|
||||||
duration: const Duration(microseconds: 200),
|
duration: const Duration(microseconds: 200),
|
||||||
width: controller.widthMapTypeAndTraffic,
|
width: controller.widthMapTypeAndTraffic,
|
||||||
@@ -173,24 +160,24 @@ GetBuilder<HomeCaptainController> leftMainMenuCaptainIcons() {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
AnimatedContainer(
|
// AnimatedContainer(
|
||||||
duration: const Duration(microseconds: 200),
|
// duration: const Duration(microseconds: 200),
|
||||||
width: controller.widthMapTypeAndTraffic,
|
// width: controller.widthMapTypeAndTraffic,
|
||||||
decoration: BoxDecoration(
|
// decoration: BoxDecoration(
|
||||||
color: AppColor.secondaryColor,
|
// color: AppColor.secondaryColor,
|
||||||
border: Border.all(color: AppColor.blueColor),
|
// border: Border.all(color: AppColor.blueColor),
|
||||||
borderRadius: BorderRadius.circular(15)),
|
// borderRadius: BorderRadius.circular(15)),
|
||||||
child: IconButton(
|
// child: IconButton(
|
||||||
onPressed: () async {
|
// onPressed: () async {
|
||||||
Get.to(() => EgyptCardAI());
|
// Get.to(() => EgyptCardAI());
|
||||||
},
|
// },
|
||||||
icon: const Icon(
|
// icon: const Icon(
|
||||||
FontAwesome5.grin_tears,
|
// FontAwesome5.grin_tears,
|
||||||
size: 29,
|
// size: 29,
|
||||||
color: AppColor.blueColor,
|
// color: AppColor.blueColor,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:SEFER/print.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
@@ -37,7 +38,7 @@ class CardSeferWalletDriver extends StatelessWidget {
|
|||||||
// BoxName.lastTimeCaptainWalletCashOut, lastRequestTime);
|
// BoxName.lastTimeCaptainWalletCashOut, lastRequestTime);
|
||||||
// box.write(BoxName.cvvCode, 1111);
|
// box.write(BoxName.cvvCode, 1111);
|
||||||
if (double.parse(
|
if (double.parse(
|
||||||
Get.find<CaptainWalletController>().totalAmountVisa) >
|
Get.find<CaptainWalletController>().totalAmountVisa) >=
|
||||||
20) {
|
20) {
|
||||||
Get.defaultDialog(
|
Get.defaultDialog(
|
||||||
barrierDismissible: false,
|
barrierDismissible: false,
|
||||||
@@ -95,7 +96,7 @@ class CardSeferWalletDriver extends StatelessWidget {
|
|||||||
if (captainWalletController.formKey.currentState!
|
if (captainWalletController.formKey.currentState!
|
||||||
.validate()) {
|
.validate()) {
|
||||||
if (double.parse(Get.find<CaptainWalletController>()
|
if (double.parse(Get.find<CaptainWalletController>()
|
||||||
.totalAmountVisa) >
|
.totalAmountVisa) >=
|
||||||
20) {
|
20) {
|
||||||
Get.back();
|
Get.back();
|
||||||
String amountAfter5LE = (double.parse(
|
String amountAfter5LE = (double.parse(
|
||||||
|
|||||||
Reference in New Issue
Block a user