25-2/24/1

This commit is contained in:
Hamza-Ayed
2025-02-24 23:38:01 +03:00
parent 5f53461b34
commit d41314cfed
64 changed files with 1180 additions and 494 deletions

View File

@@ -183,7 +183,7 @@ class MapDriverController extends GetxController {
await CRUD().post(
link: "${AppLink.seferCairoServer}/ride/rides/update.php",
payload: {
"id": encryptionHelper
"id": EncryptionHelper.instance
.encryptData(rideId)
.toString(), // Convert to String
"status": 'CancelFromDriverAfterApply'
@@ -193,24 +193,26 @@ class MapDriverController extends GetxController {
payload: {
'driver_id': box.read(BoxName.driverID).toString(),
// box.read(BoxName.driverID).toString(),
'order_id': encryptionHelper.encryptData(rideId).toString(),
'order_id':
EncryptionHelper.instance.encryptData(rideId).toString(),
'status': 'CancelFromDriverAfterApply'
});
await CRUD().post(
link:
"${AppLink.seferCairoServer}/ride/cancelRide/addCancelTripFromDriverAfterApplied.php",
payload: {
"order_id": encryptionHelper.encryptData(rideId).toString(),
"order_id":
EncryptionHelper.instance.encryptData(rideId).toString(),
"driver_id": box.read(BoxName.driverID).toString(),
"status": 'reject After Applied',
"notes": encryptionHelper
"notes": EncryptionHelper.instance
.encryptData(cancelTripCotroller.text)
.toString()
});
if (AppLink.endPoint != AppLink.seferCairoServer) {
CRUD()
.post(link: "${AppLink.endPoint}/ride/rides/update.php", payload: {
"id": encryptionHelper
"id": EncryptionHelper.instance
.encryptData(rideId)
.toString(), // Convert to String
"status": 'CancelFromDriverAfterApply'
@@ -220,24 +222,26 @@ class MapDriverController extends GetxController {
payload: {
'driver_id': box.read(BoxName.driverID).toString(),
// box.read(BoxName.driverID).toString(),
'order_id': encryptionHelper.encryptData(rideId).toString(),
'order_id':
EncryptionHelper.instance.encryptData(rideId).toString(),
'status': 'CancelFromDriverAfterApply'
});
CRUD().post(
link:
"${AppLink.endPoint}/ride/cancelRide/addCancelTripFromDriverAfterApplied.php",
payload: {
"order_id": encryptionHelper.encryptData(rideId).toString(),
"order_id":
EncryptionHelper.instance.encryptData(rideId).toString(),
"driver_id": box.read(BoxName.driverID).toString(),
"status": 'reject After Applied',
"notes": encryptionHelper
"notes": EncryptionHelper.instance
.encryptData(cancelTripCotroller.text)
.toString()
});
}
sql.insertData({
'order_id': encryptionHelper.encryptData(rideId),
'order_id': EncryptionHelper.instance.encryptData(rideId),
'created_at': DateTime.now().toString(),
'driver_id': box.read(BoxName.driverID).toString(),
}, TableName.driverOrdersRefuse);
@@ -308,13 +312,13 @@ class MapDriverController extends GetxController {
await CRUD().post(
link: "${AppLink.seferCairoServer}/ride/rides/update.php",
payload: {
'id': encryptionHelper.encryptData(rideId),
'id': EncryptionHelper.instance.encryptData(rideId),
'driverGoToPassengerTime': DateTime.now().toString(),
'status': 'Applied'
});
if (AppLink.endPoint != AppLink.seferCairoServer) {
CRUD().post(link: "${AppLink.endPoint}/ride/rides/update.php", payload: {
'id': encryptionHelper.encryptData(rideId),
'id': EncryptionHelper.instance.encryptData(rideId),
'driverGoToPassengerTime': DateTime.now().toString(),
'status': 'Applied'
});
@@ -529,35 +533,35 @@ class MapDriverController extends GetxController {
: (distanceBetweenDriverAndPassengerWhenConfirm * .06) +
(5 * .06); //for Eygpt other like jordan .06 per minute
await CRUD().post(link: AppLink.updateRides, payload: {
'id': encryptionHelper.encryptData(rideId),
'id': EncryptionHelper.instance.encryptData(rideId),
'rideTimeStart': DateTime.now().toString(),
'status': 'CancelAfterWait',
});
CRUD().post(link: AppLink.addDriverOrder, payload: {
'driver_id': box.read(BoxName.driverID).toString(),
'order_id': encryptionHelper.encryptData(rideId).toString(),
'order_id': EncryptionHelper.instance.encryptData(rideId).toString(),
'status': 'CancelAfterWait'
});
if (AppLink.endPoint != AppLink.seferCairoServer) {
CRUD().post(link: "${AppLink.endPoint}/rides/update.php", payload: {
'id': encryptionHelper.encryptData(rideId),
'id': EncryptionHelper.instance.encryptData(rideId),
'rideTimeStart': DateTime.now().toString(),
'status': 'CancelAfterWait',
});
CRUD().post(link: "${AppLink.endPoint}/rides/update.php", payload: {
'driver_id': box.read(BoxName.driverID).toString(),
'order_id': encryptionHelper.encryptData(rideId).toString(),
'order_id': EncryptionHelper.instance.encryptData(rideId).toString(),
'status': 'CancelAfterWait'
});
}
var paymentTokenWait =
await generateTokenDriver(costOfWaiting5Minute.toString());
var res = await CRUD().post(link: AppLink.addDrivePayment, payload: {
'rideId': encryptionHelper.encryptData(rideId),
'rideId': EncryptionHelper.instance.encryptData(rideId),
'amount': (costOfWaiting5Minute.toString()),
'payment_method': 'wait-cancel',
'passengerID': encryptionHelper.encryptData(passengerId),
'passengerID': EncryptionHelper.instance.encryptData(passengerId),
'token': paymentTokenWait,
'driverID': box.read(BoxName.driverID).toString(),
});
@@ -565,7 +569,7 @@ class MapDriverController extends GetxController {
await generateTokenDriver(costOfWaiting5Minute.toString());
var res1 =
await CRUD().post(link: AppLink.addDriversWalletPoints, payload: {
'paymentID': 'rideId${encryptionHelper.encryptData(rideId)}',
'paymentID': 'rideId${EncryptionHelper.instance.encryptData(rideId)}',
'amount': (costOfWaiting5Minute).toStringAsFixed(0),
'paymentMethod': 'wait',
'token': paymentTokenWait1,
@@ -581,7 +585,7 @@ class MapDriverController extends GetxController {
var paymentTokenWaitPassenger1 =
await generateTokenPassenger((costOfWaiting5Minute * -1).toString());
await CRUD().post(link: AppLink.addPassengersWallet, payload: {
'passenger_id': encryptionHelper.encryptData(passengerId),
'passenger_id': EncryptionHelper.instance.encryptData(passengerId),
'balance': (costOfWaiting5Minute * -1).toString(),
'token': paymentTokenWaitPassenger1,
});
@@ -667,13 +671,13 @@ class MapDriverController extends GetxController {
// Prepare data for API calls
final nowString = DateTime.now().toString();
final basePayload = {
'id': encryptionHelper.encryptData(rideId),
'id': EncryptionHelper.instance.encryptData(rideId),
'rideTimeFinish': nowString,
'status': 'Finished',
'price': totalCost,
};
final driverOrderPayload = {
'order_id': encryptionHelper.encryptData(rideId.toString()),
'order_id': EncryptionHelper.instance.encryptData(rideId.toString()),
'status': 'Finished'
};
@@ -706,7 +710,7 @@ class MapDriverController extends GetxController {
paymentToken = await generateTokenPassenger(
((-1) * double.parse(paymentAmount)).toString());
futures.add(CRUD().post(link: AppLink.addPassengersWallet, payload: {
'passenger_id': encryptionHelper.encryptData(passengerId),
'passenger_id': EncryptionHelper.instance.encryptData(passengerId),
'balance': ((-1) * double.parse(paymentAmount)).toString(),
'token': paymentToken,
}));
@@ -714,11 +718,11 @@ class MapDriverController extends GetxController {
paymentToken = await generateTokenDriver(paymentAmount.toString());
futures.add(CRUD().post(link: AppLink.addDrivePayment, payload: {
'rideId': encryptionHelper.encryptData(rideId),
'rideId': EncryptionHelper.instance.encryptData(rideId),
'amount': paymentAmount,
'payment_method':
walletChecked == 'true' ? "${paymentMethod}Ride" : paymentMethod,
'passengerID': encryptionHelper.encryptData(passengerId),
'passengerID': EncryptionHelper.instance.encryptData(passengerId),
'token': paymentToken,
'driverID': box.read(BoxName.driverID).toString(),
}));
@@ -727,7 +731,7 @@ class MapDriverController extends GetxController {
final paymentToken1 = await generateTokenPassenger(
((-1) * double.parse(passengerWalletBurc)).toString());
futures.add(CRUD().post(link: AppLink.addPassengersWallet, payload: {
'passenger_id': encryptionHelper.encryptData(passengerId),
'passenger_id': EncryptionHelper.instance.encryptData(passengerId),
'token': paymentToken1,
'balance': ((-1) * double.parse(passengerWalletBurc)).toString()
}));
@@ -737,7 +741,7 @@ class MapDriverController extends GetxController {
final paymentToken2 =
await generateTokenDriver((pointsSubtraction).toStringAsFixed(0));
futures.add(CRUD().post(link: AppLink.addDriversWalletPoints, payload: {
'paymentID': 'rideId${encryptionHelper.encryptData(rideId)}',
'paymentID': 'rideId${EncryptionHelper.instance.encryptData(rideId)}',
'amount': (pointsSubtraction).toStringAsFixed(0),
'paymentMethod': paymentMethod,
'token': paymentToken2,
@@ -894,7 +898,7 @@ class MapDriverController extends GetxController {
var res = await CRUD().get(
link: "${AppLink.endPoint}/ride/driver_order/getOrderCancelStatus.php",
payload: {
'order_id': encryptionHelper.encryptData(rideId),
'order_id': EncryptionHelper.instance.encryptData(rideId),
}); //.then((value) {
var response = jsonDecode(res);
canelString = response['data']['status'];