Update: 2026-06-11 18:22:57
This commit is contained in:
107
backend/ride/invitor/claim.php
Normal file
107
backend/ride/invitor/claim.php
Normal file
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
// --- backend/ride/invitor/claim.php ---
|
||||
include "../../connect.php";
|
||||
include "../../functions.php"; // Assuming a functions file exists for helper methods
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
try {
|
||||
$inviteId = filterRequest("invite_id");
|
||||
$driverId = filterRequest("driver_id");
|
||||
$passengerId = filterRequest("passenger_id");
|
||||
$countryCode = filterRequest("country_code"); // Expected: Jordan, Syria, Egypt
|
||||
|
||||
if (empty($inviteId)) {
|
||||
echo json_encode(["status" => "failure", "message" => "Invite ID required."]);
|
||||
exit;
|
||||
}
|
||||
|
||||
$walletServer = "https://walletintaleq.intaleq.xyz"; // Default
|
||||
if (strtolower($countryCode) == 'jordan') {
|
||||
$rewardAmount = 5;
|
||||
$currency = "JOD";
|
||||
$walletServer = $_ENV['WALLET_SERVER_JORDAN'] ?? "https://walletintaleq.intaleq.xyz";
|
||||
} elseif (strtolower($countryCode) == 'egypt') {
|
||||
$rewardAmount = 500;
|
||||
$currency = "EGP";
|
||||
$walletServer = $_ENV['WALLET_SERVER_EGYPT'] ?? "https://walletintaleq.intaleq.xyz";
|
||||
} else {
|
||||
$rewardAmount = 500; // Default Syria
|
||||
$currency = "SYP";
|
||||
$walletServer = $_ENV['WALLET_SERVER_SYRIA'] ?? "https://walletintaleq.intaleq.xyz";
|
||||
}
|
||||
|
||||
$walletUrl = "$walletServer/v2/main/ride/payment/add.php";
|
||||
|
||||
$con->beginTransaction();
|
||||
|
||||
if (!empty($driverId)) {
|
||||
// Driver Invitation Reward Logic
|
||||
$stmt = $con->prepare("SELECT * FROM invit_driver WHERE id = :invite_id AND driverId = :driver_id AND isGiftToken = 0 FOR UPDATE");
|
||||
$stmt->execute([':invite_id' => $inviteId, ':driver_id' => $driverId]);
|
||||
$invitation = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($invitation) {
|
||||
$upd = $con->prepare("UPDATE invit_driver SET isGiftToken = 1 WHERE id = :invite_id");
|
||||
$upd->execute([':invite_id' => $inviteId]);
|
||||
|
||||
// Reward for current driver
|
||||
addWalletBalance($walletUrl, $driverId, "driver", $rewardAmount);
|
||||
// Reward for inviter
|
||||
addWalletBalance($walletUrl, $invitation['driverInviterId'], "driver", $rewardAmount);
|
||||
|
||||
$con->commit();
|
||||
echo json_encode(["status" => "success", "message" => "Reward of $rewardAmount $currency claimed successfully."]);
|
||||
} else {
|
||||
$con->rollBack();
|
||||
echo json_encode(["status" => "failure", "message" => "Invitation not valid or already claimed."]);
|
||||
}
|
||||
|
||||
} elseif (!empty($passengerId)) {
|
||||
// Passenger Invitation Reward Logic
|
||||
$stmt = $con->prepare("SELECT * FROM invit_passenger WHERE id = :invite_id AND passengerInviterId = :passenger_id AND isGiftToken = 0 FOR UPDATE");
|
||||
$stmt->execute([':invite_id' => $inviteId, ':passenger_id' => $passengerId]);
|
||||
$invitation = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($invitation) {
|
||||
$upd = $con->prepare("UPDATE invit_passenger SET isGiftToken = 1 WHERE id = :invite_id");
|
||||
$upd->execute([':invite_id' => $inviteId]);
|
||||
|
||||
// Call Wallet Server
|
||||
addWalletBalance($walletUrl, $passengerId, "passenger", $rewardAmount);
|
||||
|
||||
$con->commit();
|
||||
echo json_encode(["status" => "success", "message" => "Reward of $rewardAmount $currency claimed successfully."]);
|
||||
} else {
|
||||
$con->rollBack();
|
||||
echo json_encode(["status" => "failure", "message" => "Invitation not valid or already claimed."]);
|
||||
}
|
||||
|
||||
} else {
|
||||
echo json_encode(["status" => "failure", "message" => "User ID required."]);
|
||||
}
|
||||
|
||||
} catch (Exception $e) {
|
||||
if ($con && $con->inTransaction()) { $con->rollBack(); }
|
||||
error_log("Error in claim.php: " . $e->getMessage());
|
||||
echo json_encode(["status" => "error", "message" => "Server error."]);
|
||||
}
|
||||
|
||||
function addWalletBalance($url, $userId, $userType, $amount) {
|
||||
$data = [
|
||||
"user_id" => $userId,
|
||||
"user_type" => $userType,
|
||||
"amount" => $amount,
|
||||
"action" => "add",
|
||||
"reason" => "Invitation Reward"
|
||||
];
|
||||
|
||||
$ch = curl_init($url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
|
||||
$response = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
return $response;
|
||||
}
|
||||
?>
|
||||
269
backend/ride/pricing/get.php
Normal file
269
backend/ride/pricing/get.php
Normal file
@@ -0,0 +1,269 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../../connect.php';
|
||||
|
||||
$distance = (float) filterRequest("distance");
|
||||
$duration = (float) filterRequest("durationToRide");
|
||||
$promo_code = filterRequest("promo_code");
|
||||
$passenger_id = filterRequest("passenger_id");
|
||||
$promo_code_id = filterRequest("promo_code_id") ? filterRequest("promo_code_id") : 0;
|
||||
$country = filterRequest("country");
|
||||
|
||||
$startNameAddress = filterRequest("startNameAddress");
|
||||
$endNameAddress = filterRequest("endNameAddress");
|
||||
$destLat = (float) filterRequest("destLat");
|
||||
$destLng = (float) filterRequest("destLng");
|
||||
$passengerLat = (float) filterRequest("passengerLat");
|
||||
$passengerLng = (float) filterRequest("passengerLng");
|
||||
$activeMenuWaypointCount = (int) filterRequest("activeMenuWaypointCount");
|
||||
|
||||
if (!$country) {
|
||||
echo json_encode(["status" => "failure", "message" => "Country parameter is required"]);
|
||||
exit;
|
||||
}
|
||||
|
||||
$price = 0.0;
|
||||
$price_for_driver = 0.0;
|
||||
$withCommission = 0.0;
|
||||
$kazan = 0.0;
|
||||
$isNightFare = false;
|
||||
|
||||
// Common variables
|
||||
date_default_timezone_set('Asia/Damascus');
|
||||
$currentTime = new DateTime();
|
||||
$hour = (int)$currentTime->format('H');
|
||||
|
||||
switch ($country) {
|
||||
case 'Syria':
|
||||
$minFare = 150.0;
|
||||
break;
|
||||
case 'Egypt':
|
||||
$minFare = 20.0;
|
||||
break;
|
||||
case 'Jordan':
|
||||
$minFare = 1.0;
|
||||
break;
|
||||
default:
|
||||
$minFare = 0.0;
|
||||
break;
|
||||
}
|
||||
|
||||
// Fetch kazan from DB for the specified country
|
||||
$sql = "SELECT * FROM `kazan` WHERE country = :country LIMIT 1";
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->execute([':country' => $country]);
|
||||
$kazanRow = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if (!$kazanRow) {
|
||||
echo json_encode(["status" => "failure", "message" => "No pricing available for this country"]);
|
||||
exit;
|
||||
}
|
||||
|
||||
$result = calculateDynamicPrice($country, $minFare, $distance, $duration, $kazanRow, $startNameAddress, $endNameAddress, $destLat, $destLng, $passengerLat, $passengerLng);
|
||||
$price = $result['price'];
|
||||
$price_for_driver = $result['price_for_driver'];
|
||||
$withCommission = $result['withCommission'];
|
||||
$kazan = $result['kazan'];
|
||||
$isNightFare = $result['isNightFare'];
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Helper Functions for Countries
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
function calculateDynamicPrice($country, $minFare, $distance, $duration, $kazanRow, $startNameAddress, $endNameAddress, $destLat, $destLng, $passengerLat, $passengerLng) {
|
||||
$comfortPrice = (float) $kazanRow['comfortPrice'];
|
||||
$speedPrice = (float) $kazanRow['speedPrice'];
|
||||
$familyPrice = (float) $kazanRow['familyPrice'];
|
||||
$deliveryPrice = (float) $kazanRow['deliveryPrice'];
|
||||
$naturePrice = (float) $kazanRow['naturePrice'];
|
||||
$heavyPrice = (float) $kazanRow['heavyPrice'];
|
||||
$latePrice = (float) $kazanRow['latePrice'];
|
||||
$kazanPercent = (float) $kazanRow['kazan'];
|
||||
|
||||
// === General Settings ===
|
||||
$minBillableKm = 0.2;
|
||||
$airportAddon = 0.0;
|
||||
$damascusAirportBoundAddon = 0.0;
|
||||
|
||||
switch ($country) {
|
||||
case 'Egypt':
|
||||
$airportAddon = 35.0;
|
||||
break;
|
||||
case 'Jordan':
|
||||
$airportAddon = 5.0;
|
||||
break;
|
||||
default: // Syria
|
||||
$airportAddon = 200.0;
|
||||
$damascusAirportBoundAddon = 1400.0;
|
||||
break;
|
||||
}
|
||||
|
||||
$longSpeedThresholdKm = 40.0;
|
||||
$longSpeedPerKm = 26.0;
|
||||
|
||||
$mediumDistThresholdKm = 25.0;
|
||||
$longDistThresholdKm = 35.0;
|
||||
$longTripPerMin = 6.0;
|
||||
$minuteCapMedium = 60;
|
||||
$minuteCapLong = 80;
|
||||
$freeMinutesLong = 10;
|
||||
|
||||
$extraReduction100 = 0.07;
|
||||
$maxReductionCap = 0.35;
|
||||
|
||||
$totalMinutes = floor($duration / 60);
|
||||
|
||||
$airportCtx = (stripos($startNameAddress, 'airport') !== false || stripos($startNameAddress, 'مطار') !== false || stripos($endNameAddress, 'airport') !== false || stripos($endNameAddress, 'مطار') !== false);
|
||||
$clubCtx = (stripos($startNameAddress, 'club') !== false || stripos($startNameAddress, 'ديسكو') !== false || stripos($endNameAddress, 'club') !== false || stripos($endNameAddress, 'ديسكو') !== false);
|
||||
|
||||
$northLat = 33.415313;
|
||||
$southLat = 33.400265;
|
||||
$eastLng = 36.531505;
|
||||
$westLng = 36.499687;
|
||||
$damascusAirportBoundCtx = ($destLat <= $northLat && $destLat >= $southLat && $destLng <= $eastLng && $destLng >= $westLng);
|
||||
$isInDamascusAirportBoundCtx = ($passengerLat <= $northLat && $passengerLat >= $southLat && $passengerLng <= $eastLng && $passengerLng >= $westLng);
|
||||
|
||||
$billableDistance = ($distance < $minBillableKm) ? $minBillableKm : $distance;
|
||||
$isLongSpeed = $billableDistance > $longSpeedThresholdKm;
|
||||
$perKmSpeedBaseFromServer = $speedPrice;
|
||||
$perKmSpeed = $isLongSpeed ? $longSpeedPerKm : $perKmSpeedBaseFromServer;
|
||||
|
||||
$reductionPct40 = 0.0;
|
||||
if ($perKmSpeedBaseFromServer > 0) {
|
||||
$r = 1.0 - ($longSpeedPerKm / $perKmSpeedBaseFromServer);
|
||||
$reductionPct40 = max(0.0, min($maxReductionCap, $r));
|
||||
}
|
||||
$reductionPct100 = max(0.0, min($maxReductionCap, $reductionPct40 + $extraReduction100));
|
||||
|
||||
$distanceReduction = 0.0;
|
||||
if ($billableDistance > 100.0) {
|
||||
$distanceReduction = $reductionPct100;
|
||||
} else if ($billableDistance > 40.0) {
|
||||
$distanceReduction = $reductionPct40;
|
||||
}
|
||||
|
||||
date_default_timezone_set('Asia/Damascus');
|
||||
$hour = (int)date('H');
|
||||
$effectivePerMin = $naturePrice;
|
||||
if ($hour >= 21 || $hour < 1) {
|
||||
$effectivePerMin = $latePrice;
|
||||
} else if ($hour >= 1 && $hour < 5) {
|
||||
$effectivePerMin = $clubCtx ? ($latePrice * 2) : $latePrice;
|
||||
} else if ($hour >= 14 && $hour <= 17) {
|
||||
$effectivePerMin = $heavyPrice;
|
||||
}
|
||||
|
||||
$billableMinutes = $totalMinutes;
|
||||
if ($billableDistance > $longDistThresholdKm) {
|
||||
$effectivePerMin = $longTripPerMin;
|
||||
$capped = ($billableMinutes > $minuteCapLong) ? $minuteCapLong : $billableMinutes;
|
||||
$billableMinutes = max(0, $capped - $freeMinutesLong);
|
||||
} else if ($billableDistance > $mediumDistThresholdKm) {
|
||||
$effectivePerMin = $longTripPerMin;
|
||||
$billableMinutes = ($billableMinutes > $minuteCapMedium) ? $minuteCapMedium : $billableMinutes;
|
||||
}
|
||||
|
||||
$fare = $billableDistance * $perKmSpeed;
|
||||
$fare += $billableMinutes * $effectivePerMin;
|
||||
if ($airportCtx) $fare += $airportAddon;
|
||||
if ($damascusAirportBoundCtx || $isInDamascusAirportBoundCtx) {
|
||||
$fare += $damascusAirportBoundAddon;
|
||||
}
|
||||
|
||||
$price = max($fare, $minFare);
|
||||
|
||||
// Apply kazan (e.g. 11%)
|
||||
$withCommission = ceil($price * (1 + $kazanPercent / 100));
|
||||
$kazan = $withCommission - $price;
|
||||
$price_for_driver = $price;
|
||||
|
||||
return [
|
||||
'price' => $price,
|
||||
'price_for_driver' => $price_for_driver,
|
||||
'withCommission' => $withCommission,
|
||||
'kazan' => $kazan,
|
||||
'isNightFare' => false
|
||||
];
|
||||
}
|
||||
|
||||
// 2. Validate Promo Code
|
||||
$discount = 0;
|
||||
if (!empty($promo_code)) {
|
||||
$sqlPromo = "SELECT amount FROM `promos`
|
||||
WHERE promo_code = :promo_code
|
||||
AND (passengerID = :passenger_id OR passengerID LIKE '%all%')
|
||||
AND validity_start_date <= CURDATE()
|
||||
AND validity_end_date >= CURDATE()";
|
||||
$stmtPromo = $con->prepare($sqlPromo);
|
||||
$stmtPromo->execute([
|
||||
':promo_code' => $promo_code,
|
||||
':passenger_id' => $passenger_id
|
||||
]);
|
||||
if ($stmtPromo->rowCount() > 0) {
|
||||
$promoData = $stmtPromo->fetch(PDO::FETCH_ASSOC);
|
||||
$discount = (float) $promoData['amount'];
|
||||
}
|
||||
}
|
||||
|
||||
// 3. Fetch Passenger Wallet (Negative Balance / Debt)
|
||||
// Using Redis for ultra-fast reads, with a fallback to the Payment Server API.
|
||||
$negativeBalance = 0;
|
||||
if (!empty($passenger_id)) {
|
||||
try {
|
||||
$redis = new Redis();
|
||||
$redis->connect('127.0.0.1', 6379);
|
||||
$redisKey = "passenger_debt_" . $passenger_id;
|
||||
|
||||
$redisDebt = $redis->get($redisKey);
|
||||
|
||||
if ($redisDebt !== false) {
|
||||
$negativeBalance = (float) $redisDebt;
|
||||
} else {
|
||||
// Fallback: If not in Redis, call the Payment Server Endpoint
|
||||
// TODO: Replace with the actual Payment Server Endpoint URL and API Key
|
||||
/*
|
||||
$paymentApiUrl = "https://payment.siroapp.com/api/get_debt?passenger_id=" . urlencode($passenger_id);
|
||||
$options = [
|
||||
"http" => [
|
||||
"header" => "Authorization: Bearer YOUR_API_KEY\r\n"
|
||||
]
|
||||
];
|
||||
$context = stream_context_create($options);
|
||||
$response = file_get_contents($paymentApiUrl, false, $context);
|
||||
if ($response !== false) {
|
||||
$data = json_decode($response, true);
|
||||
if (isset($data['debt'])) {
|
||||
$negativeBalance = (float) $data['debt'];
|
||||
// Cache the result in Redis for future pricing calls (e.g. 1 hour)
|
||||
$redis->setex($redisKey, 3600, $negativeBalance);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
// If Redis fails, gracefully default to 0 or fallback API
|
||||
$negativeBalance = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$prices = ['total' => $withCommission];
|
||||
|
||||
// 4. Apply Discount and Negative Balance
|
||||
foreach ($prices as $key => $price) {
|
||||
// Apply discount (Assuming percentage discount if amount <= 100, else fixed amount)
|
||||
if ($discount > 0 && $discount <= 100) {
|
||||
$prices[$key] = max(0, $price - ($price * ($discount / 100)));
|
||||
} else {
|
||||
$prices[$key] = max(0, $price - $discount);
|
||||
}
|
||||
|
||||
// Add negative balance
|
||||
$prices[$key] += $negativeBalance;
|
||||
}
|
||||
|
||||
echo json_encode([
|
||||
'status' => 'success',
|
||||
'data' => $prices,
|
||||
'applied_discount' => $discount,
|
||||
'added_negative_balance' => $negativeBalance
|
||||
]);
|
||||
?>
|
||||
@@ -12,6 +12,7 @@ $rideId = filterRequest("ride_id");
|
||||
$driverId = filterRequest("driver_id");
|
||||
$reason = filterRequest("reason");
|
||||
$passengerToken = filterRequest("passenger_token");
|
||||
$penaltyFee = (float) filterRequest("penalty_fee");
|
||||
|
||||
// تثبيت الحالة
|
||||
$statusText = "CancelFromDriverAfterApply";
|
||||
@@ -92,6 +93,27 @@ try {
|
||||
if (function_exists('notifyPassengerOnRideServer')) {
|
||||
notifyPassengerOnRideServer($passenger_id, $socketPayload);
|
||||
}
|
||||
|
||||
// 4.1. إضافة غرامة الإلغاء على الراكب (الدين) إذا كانت موجودة
|
||||
if ($penaltyFee > 0) {
|
||||
// إضافة القيمة كدين سالب في المحفظة
|
||||
$negativeDebt = -$penaltyFee;
|
||||
$stmtWallet = $con->prepare("INSERT INTO `passengerWallet` (passenger_id, balance) VALUES (?, ?)");
|
||||
$stmtWallet->execute([$passenger_id, $negativeDebt]);
|
||||
|
||||
// تخزين الدين في الـ Redis لمدة 6 شهور (15552000 ثانية)
|
||||
try {
|
||||
$redis = new Redis();
|
||||
$redis->connect('127.0.0.1', 6379);
|
||||
$redisKey = "passenger_debt_" . $passenger_id;
|
||||
// إضافة الدين الجديد إلى الدين السابق إن وجد
|
||||
$currentDebt = (float) $redis->get($redisKey);
|
||||
$newDebt = $currentDebt + $negativeDebt;
|
||||
$redis->setex($redisKey, 15552000, $newDebt);
|
||||
} catch (Exception $e) {
|
||||
error_log("Redis Error: " . $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ب) FCM (Internal)
|
||||
|
||||
@@ -58,6 +58,30 @@ try {
|
||||
$stmtPas->execute([$ride_id]);
|
||||
$passenger_id = $stmtPas->fetchColumn();
|
||||
|
||||
// 2.5 تصفير الدين من Redis عند بدء الرحلة (كما طلبت)
|
||||
if ($passenger_id) {
|
||||
try {
|
||||
$redis = new Redis();
|
||||
$redis->connect('127.0.0.1', 6379);
|
||||
$redisKey = "passenger_debt_" . $passenger_id;
|
||||
|
||||
// قراءة الدين الحالي من Redis قبل الحذف (إن لزم الأمر للتسجيل مستقبلاً)
|
||||
$currentDebt = (float) $redis->get($redisKey);
|
||||
|
||||
// تصفير / حذف الدين
|
||||
$redis->del($redisKey);
|
||||
|
||||
// يمكنك هنا أيضاً إدراج حركة معاكسة في جدول passengerWallet إذا أردت تسوية قاعدة البيانات
|
||||
if ($currentDebt < 0) {
|
||||
$positiveOffset = abs($currentDebt);
|
||||
$stmtWallet = $con->prepare("INSERT INTO `passengerWallet` (passenger_id, balance) VALUES (?, ?)");
|
||||
$stmtWallet->execute([$passenger_id, $positiveOffset]);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
error_log("Redis Error (zeroing debt): " . $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
if ($passenger_id) {
|
||||
|
||||
// أ) إرسال السوكيت (Socket)
|
||||
|
||||
@@ -6,27 +6,91 @@ $passengerID = filterRequest("passengerID");
|
||||
$driverID = filterRequest("driverID");
|
||||
$rideID = filterRequest("rideID");
|
||||
$tipAmount = filterRequest("tipAmount");
|
||||
$countryCode = filterRequest("country_code"); // sent from flutter
|
||||
|
||||
// تحقق من صحة قيمة البقشيش
|
||||
if (!is_numeric($tipAmount) || $tipAmount < 0 || $tipAmount > 99999999.99) {
|
||||
jsonError("Invalid tip amount.");
|
||||
if (!is_numeric($tipAmount) || $tipAmount <= 0 || $tipAmount > 99999999.99) {
|
||||
echo json_encode(["status" => "failure", "message" => "Invalid tip amount."]);
|
||||
exit();
|
||||
}
|
||||
|
||||
// إدراج بيانات البقشيش
|
||||
$sql = "INSERT INTO `tips` (`driverID`, `passengerID`, `rideID`, `tipAmount`)
|
||||
VALUES (:driverID, :passengerID, :rideID, :tipAmount)";
|
||||
$con->beginTransaction();
|
||||
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindParam(':driverID', $driverID);
|
||||
$stmt->bindParam(':passengerID', $passengerID);
|
||||
$stmt->bindParam(':rideID', $rideID);
|
||||
$stmt->bindParam(':tipAmount', $tipAmount);
|
||||
try {
|
||||
// إدراج بيانات البقشيش
|
||||
$sql = "INSERT INTO `tips` (`driverID`, `passengerID`, `rideID`, `tipAmount`)
|
||||
VALUES (:driverID, :passengerID, :rideID, :tipAmount)";
|
||||
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->execute([
|
||||
':driverID' => $driverID,
|
||||
':passengerID' => $passengerID,
|
||||
':rideID' => $rideID,
|
||||
':tipAmount' => $tipAmount
|
||||
]);
|
||||
|
||||
if ($stmt->rowCount() > 0) {
|
||||
$walletServer = "https://walletintaleq.intaleq.xyz"; // Default
|
||||
if (strtolower($countryCode) == 'jordan') {
|
||||
$walletServer = $_ENV['WALLET_SERVER_JORDAN'] ?? "https://walletintaleq.intaleq.xyz";
|
||||
} elseif (strtolower($countryCode) == 'egypt') {
|
||||
$walletServer = $_ENV['WALLET_SERVER_EGYPT'] ?? "https://walletintaleq.intaleq.xyz";
|
||||
} else {
|
||||
$walletServer = $_ENV['WALLET_SERVER_SYRIA'] ?? "https://walletintaleq.intaleq.xyz";
|
||||
}
|
||||
|
||||
// تنفيذ العملية
|
||||
if ($stmt->execute() && $stmt->rowCount() > 0) {
|
||||
jsonSuccess(null, "Tip inserted successfully");
|
||||
} else {
|
||||
jsonError("Failed to save tip information");
|
||||
// Amount logic depending on country (as done previously in flutter)
|
||||
$driverTipAmount = $tipAmount;
|
||||
if (strtolower($countryCode) == 'egypt') {
|
||||
$driverTipAmount = round($tipAmount, 0); // Egypt
|
||||
} else {
|
||||
$driverTipAmount = $tipAmount * 100; // Syria and Jordan use * 100
|
||||
}
|
||||
|
||||
// 1. Deduct from passenger
|
||||
$urlPassenger = "$walletServer/v2/main/ride/payment/add.php";
|
||||
$dataPassenger = [
|
||||
"user_id" => $passengerID,
|
||||
"user_type" => "passenger",
|
||||
"amount" => -1 * $tipAmount, // negative
|
||||
"action" => "subtract",
|
||||
"reason" => "Tip Deduction"
|
||||
];
|
||||
|
||||
$ch1 = curl_init($urlPassenger);
|
||||
curl_setopt($ch1, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch1, CURLOPT_POST, true);
|
||||
curl_setopt($ch1, CURLOPT_POSTFIELDS, http_build_query($dataPassenger));
|
||||
$resPassenger = curl_exec($ch1);
|
||||
curl_close($ch1);
|
||||
|
||||
// 2. Add to Driver
|
||||
$urlDriver = "$walletServer/v2/main/ride/payment/add.php";
|
||||
$dataDriver = [
|
||||
"user_id" => $driverID,
|
||||
"user_type" => "driver",
|
||||
"amount" => $driverTipAmount,
|
||||
"action" => "add",
|
||||
"paymentID" => $rideID . "tip",
|
||||
"paymentMethod" => "visa-tip"
|
||||
];
|
||||
|
||||
$ch2 = curl_init($urlDriver);
|
||||
curl_setopt($ch2, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch2, CURLOPT_POST, true);
|
||||
curl_setopt($ch2, CURLOPT_POSTFIELDS, http_build_query($dataDriver));
|
||||
$resDriver = curl_exec($ch2);
|
||||
curl_close($ch2);
|
||||
|
||||
$con->commit();
|
||||
echo json_encode(["status" => "success", "message" => "Tip inserted and wallet updated"]);
|
||||
} else {
|
||||
$con->rollBack();
|
||||
echo json_encode(["status" => "failure", "message" => "Failed to save tip information"]);
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
$con->rollBack();
|
||||
error_log("Error in addTips: " . $e->getMessage());
|
||||
echo json_encode(["status" => "failure", "message" => "Server error"]);
|
||||
}
|
||||
?>
|
||||
572
bottomsheet.diff
Normal file
572
bottomsheet.diff
Normal file
@@ -0,0 +1,572 @@
|
||||
commit d8901e1a879f696e512e13d389d666baae33dc84
|
||||
Author: Hamza-Ayed <hamzaayedflutter@gmail.com>
|
||||
Date: Tue Jun 9 08:40:31 2026 +0300
|
||||
|
||||
first commit
|
||||
|
||||
diff --git a/siro_rider/lib/views/home/map_widget.dart/buttom_sheet_map_show.dart b/siro_rider/lib/views/home/map_widget.dart/buttom_sheet_map_show.dart
|
||||
new file mode 100644
|
||||
index 0000000..c3dee90
|
||||
--- /dev/null
|
||||
+++ b/siro_rider/lib/views/home/map_widget.dart/buttom_sheet_map_show.dart
|
||||
@@ -0,0 +1,560 @@
|
||||
+import 'package:flutter/material.dart';
|
||||
+import 'package:get/get.dart';
|
||||
+import 'package:siro_rider/controller/payment/payment_controller.dart';
|
||||
+
|
||||
+import '../../../constant/style.dart';
|
||||
+import '../../../controller/home/map/ride_lifecycle_controller.dart';
|
||||
+
|
||||
+GetBuilder<RideLifecycleController> buttomSheetMapPage() {
|
||||
+ Get.put(PaymentController());
|
||||
+ return GetBuilder<RideLifecycleController>(
|
||||
+ builder: (controller) =>
|
||||
+ controller.isBottomSheetShown && controller.rideConfirm == false
|
||||
+ ? const Positioned(
|
||||
+ left: 5,
|
||||
+ bottom: 0,
|
||||
+ right: 5,
|
||||
+ child: Column(
|
||||
+ // children: [
|
||||
+ // Row(
|
||||
+ // mainAxisAlignment: MainAxisAlignment.end,
|
||||
+ // children: [
|
||||
+ // double.parse(box.read(BoxName.passengerWalletTotal)) <
|
||||
+ // 0 &&
|
||||
+ // controller.data.isNotEmpty
|
||||
+ // ? Container(
|
||||
+ // decoration: AppStyle.boxDecoration
|
||||
+ // .copyWith(color: AppColor.redColor),
|
||||
+ // height: 50,
|
||||
+ // width: Get.width * .94,
|
||||
+ // child: Padding(
|
||||
+ // padding:
|
||||
+ // const EdgeInsets.symmetric(horizontal: 8),
|
||||
+ // child: Text(
|
||||
+ // 'Your trip cost is'.tr +
|
||||
+ // ' ${controller.totalCostPassenger.toStringAsFixed(2)} '
|
||||
+ // 'But you have a negative salary of'
|
||||
+ // .tr +
|
||||
+ // '${double.parse(box.read(BoxName.passengerWalletTotal)).toStringAsFixed(2)}'
|
||||
+ // ' in your'
|
||||
+ // .tr +
|
||||
+ // ' ${AppInformation.appName}'
|
||||
+ // ' wallet due to a previous trip.'
|
||||
+ // .tr,
|
||||
+ // style: AppStyle.subtitle,
|
||||
+ // ),
|
||||
+ // ))
|
||||
+ // : const SizedBox(),
|
||||
+ // ],
|
||||
+ // ),
|
||||
+ // const SizedBox(
|
||||
+ // height: 5,
|
||||
+ // ),
|
||||
+ // AnimatedContainer(
|
||||
+ // // clipBehavior: Clip.antiAliasWithSaveLayer,
|
||||
+ // curve: Curves.easeInCirc,
|
||||
+ // onEnd: () {
|
||||
+ // controller.height = 250;
|
||||
+ // },
|
||||
+ // height: controller.heightBottomSheetShown,
|
||||
+ // duration: const Duration(seconds: 2),
|
||||
+ // child: Column(
|
||||
+ // children: [
|
||||
+ // controller.data.isEmpty
|
||||
+ // ? const SizedBox()
|
||||
+ // : Container(
|
||||
+ // // width: Get.width * .9,
|
||||
+ // height: 100,
|
||||
+ // decoration: BoxDecoration(
|
||||
+ // color: AppColor.secondaryColor,
|
||||
+ // boxShadow: [
|
||||
+ // const BoxShadow(
|
||||
+ // color: AppColor.accentColor,
|
||||
+ // offset: Offset(2, 2)),
|
||||
+ // BoxShadow(
|
||||
+ // color: AppColor.accentColor
|
||||
+ // .withOpacity(.4),
|
||||
+ // offset: const Offset(-2, -2))
|
||||
+ // ],
|
||||
+ // borderRadius: const BorderRadius.all(
|
||||
+ // Radius.circular(15))),
|
||||
+ // child: ListView.builder(
|
||||
+ // scrollDirection: Axis.horizontal,
|
||||
+ // itemCount: controller
|
||||
+ // .dataCarsLocationByPassenger.length -
|
||||
+ // 1,
|
||||
+ // itemBuilder:
|
||||
+ // (BuildContext context, int index) {
|
||||
+ // return Container(
|
||||
+ // color: controller.gender == 'Female'
|
||||
+ // ? const Color.fromARGB(
|
||||
+ // 255, 246, 52, 181)
|
||||
+ // : AppColor.secondaryColor,
|
||||
+ // width: Get.width,
|
||||
+ // child: Row(
|
||||
+ // mainAxisAlignment:
|
||||
+ // MainAxisAlignment.spaceBetween,
|
||||
+ // children: [
|
||||
+ // SizedBox(
|
||||
+ // width: Get.width * .15,
|
||||
+ // child: Padding(
|
||||
+ // padding:
|
||||
+ // const EdgeInsets.all(8.0),
|
||||
+ // child: Image.asset(
|
||||
+ // 'assets/images/jeep.png',
|
||||
+ // width: 50,
|
||||
+ // fit: BoxFit.fill,
|
||||
+ // repeat: ImageRepeat.repeatX,
|
||||
+ // ),
|
||||
+ // ),
|
||||
+ // ),
|
||||
+ // SizedBox(
|
||||
+ // width: Get.width * .55,
|
||||
+ // child: Column(
|
||||
+ // crossAxisAlignment:
|
||||
+ // CrossAxisAlignment.start,
|
||||
+ // mainAxisAlignment:
|
||||
+ // MainAxisAlignment.spaceEvenly,
|
||||
+ // children: [
|
||||
+ // Text(
|
||||
+ // controller.hours > 0
|
||||
+ // ? '${'Your Ride Duration is '.tr}${controller.hours} ${'H and'.tr} ${controller.minutes} ${'m'.tr}'
|
||||
+ // : '${'Your Ride Duration is '.tr} ${controller.minutes} m',
|
||||
+ // style: AppStyle.subtitle,
|
||||
+ // ),
|
||||
+ // // Text(
|
||||
+ // // '${'You will be thier in'.tr} ${DateFormat('h:mm a').format(controller.newTime)}',
|
||||
+ // // style: AppStyle.subtitle,
|
||||
+ // // ),
|
||||
+ // Text(
|
||||
+ // '${'Your trip distance is'.tr} ${controller.distance.toStringAsFixed(2)} ${'KM'.tr}',
|
||||
+ // style: AppStyle.subtitle,
|
||||
+ // )
|
||||
+ // ],
|
||||
+ // ),
|
||||
+ // ),
|
||||
+ // SizedBox(
|
||||
+ // width: Get.width * .2,
|
||||
+ // child: Padding(
|
||||
+ // padding: const EdgeInsets.only(
|
||||
+ // right: 5, left: 5),
|
||||
+ // child: Column(
|
||||
+ // crossAxisAlignment:
|
||||
+ // CrossAxisAlignment.center,
|
||||
+ // children: [
|
||||
+ // Container(
|
||||
+ // width: Get.width * .14,
|
||||
+ // height: Get.height * .06,
|
||||
+ // decoration: BoxDecoration(
|
||||
+ // color: AppColor
|
||||
+ // .secondaryColor,
|
||||
+ // shape:
|
||||
+ // BoxShape.rectangle,
|
||||
+ // border: Border.all(
|
||||
+ // width: 2,
|
||||
+ // color: AppColor
|
||||
+ // .greenColor)),
|
||||
+ // child: Center(
|
||||
+ // child: Text(
|
||||
+ // '${'Fee is'.tr} \n${controller.totalPassenger.toStringAsFixed(2)}',
|
||||
+ // style:
|
||||
+ // AppStyle.subtitle,
|
||||
+ // ),
|
||||
+ // ),
|
||||
+ // ),
|
||||
+ // controller.promoTaken
|
||||
+ // ? const Icon(
|
||||
+ // Icons
|
||||
+ // .filter_vintage_rounded,
|
||||
+ // color:
|
||||
+ // AppColor.redColor,
|
||||
+ // )
|
||||
+ // : const SizedBox(
|
||||
+ // height: 0,
|
||||
+ // )
|
||||
+ // ],
|
||||
+ // ),
|
||||
+ // ),
|
||||
+ // ),
|
||||
+ // ],
|
||||
+ // ),
|
||||
+ // );
|
||||
+ // },
|
||||
+ // ),
|
||||
+ // ),
|
||||
+ // const SizedBox(
|
||||
+ // height: 5,
|
||||
+ // ),
|
||||
+ // Container(
|
||||
+ // // height: 130,
|
||||
+ // decoration: BoxDecoration(
|
||||
+ // color: AppColor.secondaryColor,
|
||||
+ // boxShadow: [
|
||||
+ // const BoxShadow(
|
||||
+ // color: AppColor.accentColor,
|
||||
+ // offset: Offset(2, 2)),
|
||||
+ // BoxShadow(
|
||||
+ // color: AppColor.accentColor.withOpacity(.4),
|
||||
+ // offset: const Offset(-2, -2))
|
||||
+ // ],
|
||||
+ // borderRadius:
|
||||
+ // const BorderRadius.all(Radius.circular(15))),
|
||||
+ // child: controller.data.isEmpty
|
||||
+ // ? const SizedBox()
|
||||
+ // : Center(
|
||||
+ // child: Padding(
|
||||
+ // padding: const EdgeInsets.symmetric(
|
||||
+ // horizontal: 5),
|
||||
+ // child: Column(
|
||||
+ // children: [
|
||||
+ // Row(
|
||||
+ // children: [
|
||||
+ // const Icon(
|
||||
+ // Icons.location_on,
|
||||
+ // color: AppColor.redColor,
|
||||
+ // ),
|
||||
+ // const SizedBox(
|
||||
+ // width: 10,
|
||||
+ // ),
|
||||
+ // Text(
|
||||
+ // 'From : '.tr,
|
||||
+ // style: AppStyle.subtitle,
|
||||
+ // ),
|
||||
+ // Text(
|
||||
+ // controller.data[0]
|
||||
+ // ['start_address']
|
||||
+ // .toString(),
|
||||
+ // style: AppStyle.subtitle,
|
||||
+ // )
|
||||
+ // ],
|
||||
+ // ),
|
||||
+ // Row(
|
||||
+ // children: [
|
||||
+ // const Icon(Icons
|
||||
+ // .location_searching_rounded),
|
||||
+ // const SizedBox(
|
||||
+ // width: 10,
|
||||
+ // ),
|
||||
+ // Text(
|
||||
+ // 'To : '.tr,
|
||||
+ // style: AppStyle.subtitle,
|
||||
+ // ),
|
||||
+ // Text(
|
||||
+ // controller.data[0]['end_address'],
|
||||
+ // style: AppStyle.subtitle,
|
||||
+ // ),
|
||||
+ // ],
|
||||
+ // ),
|
||||
+ // const Divider(
|
||||
+ // color: AppColor.accentColor,
|
||||
+ // thickness: 1,
|
||||
+ // height: 2,
|
||||
+ // indent: 1,
|
||||
+ // ),
|
||||
+ // SizedBox(
|
||||
+ // height: 40,
|
||||
+ // child: Row(
|
||||
+ // mainAxisAlignment:
|
||||
+ // MainAxisAlignment.center,
|
||||
+ // children: [
|
||||
+ // Container(
|
||||
+ // decoration: BoxDecoration(
|
||||
+ // color:
|
||||
+ // AppColor.secondaryColor,
|
||||
+ // borderRadius:
|
||||
+ // BorderRadius.circular(12),
|
||||
+ // // border: Border.all(),
|
||||
+ // ),
|
||||
+ // child: Row(
|
||||
+ // children: [
|
||||
+ // Icon(
|
||||
+ // Icons.monetization_on,
|
||||
+ // color: Colors.green[400],
|
||||
+ // ),
|
||||
+ // InkWell(
|
||||
+ // onTap: () async {
|
||||
+ // controller
|
||||
+ // .changeCashConfirmPageShown();
|
||||
+ // Get.find<
|
||||
+ // PaymentController>()
|
||||
+ // .getPassengerWallet();
|
||||
+ // },
|
||||
+ // child: GetBuilder<
|
||||
+ // PaymentController>(
|
||||
+ // builder: (paymentController) =>
|
||||
+ // paymentController
|
||||
+ // .isCashChecked
|
||||
+ // ? Text(
|
||||
+ // 'CASH',
|
||||
+ // style: AppStyle
|
||||
+ // .title,
|
||||
+ // )
|
||||
+ // : Text(
|
||||
+ // '${AppInformation.appName} Wallet',
|
||||
+ // style: AppStyle
|
||||
+ // .title,
|
||||
+ // ),
|
||||
+ // ),
|
||||
+ // ),
|
||||
+ // ],
|
||||
+ // ),
|
||||
+ // ),
|
||||
+ // const SizedBox(
|
||||
+ // width: 40,
|
||||
+ // ),
|
||||
+ // GetBuilder<PaymentController>(
|
||||
+ // builder:
|
||||
+ // (paymentController) =>
|
||||
+ // Container(
|
||||
+ // decoration:
|
||||
+ // BoxDecoration(
|
||||
+ // color: AppColor
|
||||
+ // .secondaryColor,
|
||||
+ // borderRadius:
|
||||
+ // BorderRadius
|
||||
+ // .circular(
|
||||
+ // 12),
|
||||
+ // ),
|
||||
+ // child: Row(
|
||||
+ // children: [
|
||||
+ // Icon(
|
||||
+ // Icons
|
||||
+ // .qr_code_2_rounded,
|
||||
+ // color: Colors
|
||||
+ // .green[
|
||||
+ // 400],
|
||||
+ // ),
|
||||
+ // InkWell(
|
||||
+ // onTap: () {
|
||||
+ // if (controller
|
||||
+ // .promoTaken ==
|
||||
+ // false) {
|
||||
+ // Get.defaultDialog(
|
||||
+ // title: 'Add Promo'.tr,
|
||||
+ // titleStyle: AppStyle.title,
|
||||
+ // content: Column(
|
||||
+ // children: [
|
||||
+ // SizedBox(
|
||||
+ // width: Get.width * .7,
|
||||
+ // child: TextFormField(
|
||||
+ // controller: controller.promo,
|
||||
+ // decoration: InputDecoration(
|
||||
+ // labelText: 'Promo Code'.tr,
|
||||
+ // hintText: 'Enter promo code'.tr,
|
||||
+ // labelStyle: AppStyle.subtitle,
|
||||
+ // hintStyle: AppStyle.subtitle,
|
||||
+ // border: OutlineInputBorder(
|
||||
+ // borderRadius: BorderRadius.circular(10),
|
||||
+ // ),
|
||||
+ // filled: true,
|
||||
+ // fillColor: Colors.grey[200],
|
||||
+ // focusedBorder: OutlineInputBorder(
|
||||
+ // borderSide: const BorderSide(
|
||||
+ // color: AppColor.primaryColor,
|
||||
+ // width: 2.0,
|
||||
+ // ),
|
||||
+ // borderRadius: BorderRadius.circular(10),
|
||||
+ // ),
|
||||
+ // errorBorder: OutlineInputBorder(
|
||||
+ // borderSide: const BorderSide(
|
||||
+ // color: Colors.red,
|
||||
+ // width: 2.0,
|
||||
+ // ),
|
||||
+ // borderRadius: BorderRadius.circular(10),
|
||||
+ // ),
|
||||
+ // enabledBorder: OutlineInputBorder(
|
||||
+ // borderSide: const BorderSide(
|
||||
+ // color: Colors.grey,
|
||||
+ // width: 1.0,
|
||||
+ // ),
|
||||
+ // borderRadius: BorderRadius.circular(10),
|
||||
+ // ),
|
||||
+ // ),
|
||||
+ // ),
|
||||
+ // ),
|
||||
+ // MyElevatedButton(
|
||||
+ // title: 'Add Promo'.tr,
|
||||
+ // onPressed: () async {
|
||||
+ // controller.applyPromoCodeToPassenger();
|
||||
+ // },
|
||||
+ // )
|
||||
+ // ],
|
||||
+ // ));
|
||||
+ // } else {
|
||||
+ // Get.snackbar(
|
||||
+ // 'You have promo!'
|
||||
+ // .tr,
|
||||
+ // '',
|
||||
+ // backgroundColor:
|
||||
+ // AppColor.redColor);
|
||||
+ // }
|
||||
+ // },
|
||||
+ // child: Text(
|
||||
+ // 'Add Promo'
|
||||
+ // .tr,
|
||||
+ // style: AppStyle
|
||||
+ // .title,
|
||||
+ // ),
|
||||
+ // ),
|
||||
+ // ],
|
||||
+ // ),
|
||||
+ // )),
|
||||
+ // ],
|
||||
+ // ),
|
||||
+ // ),
|
||||
+ // SizedBox(
|
||||
+ // width: Get.width * .95,
|
||||
+ // child: Row(
|
||||
+ // mainAxisAlignment:
|
||||
+ // MainAxisAlignment.center,
|
||||
+ // children: [
|
||||
+ // controller.isCashSelectedBeforeConfirmRide ==
|
||||
+ // false
|
||||
+ // ? MyElevatedButton(
|
||||
+ // title: 'Next'.tr,
|
||||
+ // onPressed: () {
|
||||
+ // controller
|
||||
+ // .changeCashConfirmPageShown();
|
||||
+ // },
|
||||
+ // )
|
||||
+ // :
|
||||
+ // // controller.isPassengerChosen ==
|
||||
+ // // false
|
||||
+ // // ? MyElevatedButton(
|
||||
+ // // title: 'Next'.tr,
|
||||
+ // // onPressed: () {
|
||||
+ // // controller
|
||||
+ // // .onChangedPassengersChoose();
|
||||
+ // // Get.defaultDialog(
|
||||
+ // // barrierDismissible:
|
||||
+ // // false,
|
||||
+ // // title:
|
||||
+ // // 'How Many Passengers?'
|
||||
+ // // .tr,
|
||||
+ // // titleStyle:
|
||||
+ // // AppStyle
|
||||
+ // // .title,
|
||||
+ // // content:
|
||||
+ // // Column(
|
||||
+ // // children: [
|
||||
+ // // Text(
|
||||
+ // // 'Allowed up to 4 Passengers.'
|
||||
+ // // .tr,
|
||||
+ // // style: AppStyle
|
||||
+ // // .title,
|
||||
+ // // ),
|
||||
+ // // SizedBox(
|
||||
+ // // height:
|
||||
+ // // 200, // Set the desired height here
|
||||
+ // // child:
|
||||
+ // // CupertinoPicker(
|
||||
+ // // itemExtent:
|
||||
+ // // 32,
|
||||
+ // // onSelectedItemChanged:
|
||||
+ // // (index) {
|
||||
+ // // controller.onChangedPassengerCount(index +
|
||||
+ // // 1);
|
||||
+ // // },
|
||||
+ // // children: [
|
||||
+ // // Text('1 Passenger'.tr),
|
||||
+ // // Text('2 Passengers'.tr),
|
||||
+ // // Text('3 Passengers'.tr),
|
||||
+ // // Text('4 Passengers'.tr),
|
||||
+ // // ],
|
||||
+ // // ),
|
||||
+ // // ),
|
||||
+ // // MyElevatedButton(
|
||||
+ // // title:
|
||||
+ // // 'Back',
|
||||
+ // // onPressed:
|
||||
+ // // () =>
|
||||
+ // // Get.back(),
|
||||
+ // // )
|
||||
+ // // ],
|
||||
+ // // ),
|
||||
+ // // );
|
||||
+ // // },
|
||||
+ // // )
|
||||
+ // // :
|
||||
+ // MyElevatedButton(
|
||||
+ // title: 'Confirm Selection'
|
||||
+ // .tr,
|
||||
+ // onPressed: () {
|
||||
+ // controller
|
||||
+ // .confirmRideForFirstDriver();
|
||||
+ // },
|
||||
+ // ),
|
||||
+ // ],
|
||||
+ // ),
|
||||
+ // )
|
||||
+ // ],
|
||||
+ // ),
|
||||
+ // ),
|
||||
+ // ),
|
||||
+ // ),
|
||||
+ // ],
|
||||
+ // ),
|
||||
+ // ),
|
||||
+ // ],
|
||||
+ ),
|
||||
+ )
|
||||
+ : const SizedBox());
|
||||
+}
|
||||
+
|
||||
+class Details extends StatelessWidget {
|
||||
+ const Details({
|
||||
+ super.key,
|
||||
+ });
|
||||
+
|
||||
+ @override
|
||||
+ Widget build(BuildContext context) {
|
||||
+ return GetBuilder<RideLifecycleController>(
|
||||
+ builder: (controller) => Column(
|
||||
+ children: [
|
||||
+ Row(
|
||||
+ mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
+ children: [
|
||||
+ Text(
|
||||
+ '${'Distance is'.tr} ${controller.distance.toStringAsFixed(2)} KM',
|
||||
+ style: AppStyle.title,
|
||||
+ ),
|
||||
+ Text(
|
||||
+ '${'Duration is'.tr} ${controller.data[0]['duration']['text']}',
|
||||
+ style: AppStyle.title,
|
||||
+ ),
|
||||
+ ],
|
||||
+ ),
|
||||
+ Row(
|
||||
+ mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
+ children: [
|
||||
+ Text(
|
||||
+ 'Cost for .21/km ${controller.costDistance.toStringAsFixed(2)} ',
|
||||
+ style: AppStyle.title,
|
||||
+ ),
|
||||
+ Text(
|
||||
+ '${'Cost Duration'.tr} ${controller.averageDuration.toStringAsFixed(2)} is ${controller.costDuration.toStringAsFixed(2)} ',
|
||||
+ style: AppStyle.title,
|
||||
+ ),
|
||||
+ ],
|
||||
+ ),
|
||||
+ Row(
|
||||
+ mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
+ children: [
|
||||
+ Text(
|
||||
+ 'Total Driver ${controller.totalDriver.toStringAsFixed(2)}',
|
||||
+ style: AppStyle.title,
|
||||
+ ),
|
||||
+ Text(
|
||||
+ 'totaME ${controller.totalME.toStringAsFixed(2)} ',
|
||||
+ style: AppStyle.title,
|
||||
+ ),
|
||||
+ ],
|
||||
+ ),
|
||||
+ Text(
|
||||
+ 'Cost for passenger ${controller.totalPassenger.toStringAsFixed(2)} ',
|
||||
+ style: AppStyle.title,
|
||||
+ ),
|
||||
+ ],
|
||||
+ ));
|
||||
+ }
|
||||
+}
|
||||
26
cleanup_kazan.py
Normal file
26
cleanup_kazan.py
Normal file
@@ -0,0 +1,26 @@
|
||||
import sys
|
||||
import re
|
||||
|
||||
def cleanup(filepath):
|
||||
with open(filepath, 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
# Remove double kazan = 8;
|
||||
content = re.sub(r'\s*double kazan = 8;', '', content)
|
||||
|
||||
# Remove unawaited(getKazanPercent());
|
||||
content = re.sub(r'\s*unawaited\(getKazanPercent\(\)\);', '', content)
|
||||
|
||||
# Remove await getKazanPercent();
|
||||
content = re.sub(r'\s*await getKazanPercent\(\);', '', content)
|
||||
|
||||
# Remove getKazanPercent method
|
||||
kazan_method_pattern = re.compile(r'Future<void> getKazanPercent\(\) async \{.*?\} catch \(e\) \{.*?\}\s*\}', re.DOTALL)
|
||||
content = kazan_method_pattern.sub('', content)
|
||||
|
||||
with open(filepath, 'w') as f:
|
||||
f.write(content)
|
||||
print(f"Cleaned up {filepath}")
|
||||
|
||||
if __name__ == '__main__':
|
||||
cleanup(sys.argv[1])
|
||||
62
fix_translations.py
Normal file
62
fix_translations.py
Normal file
@@ -0,0 +1,62 @@
|
||||
import sys
|
||||
import re
|
||||
|
||||
def fix_translations(filepath):
|
||||
with open(filepath, 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
# Pattern to match "SYP": "..." and inject "EGP" and "JOD" right after it.
|
||||
def replace_syp(match):
|
||||
syp_line = match.group(0) # e.g. "SYP": "ل.س",
|
||||
syp_val = match.group(1) # e.g. ل.س
|
||||
|
||||
# Decide what EGP and JOD should be based on the SYP translation
|
||||
if 'ل.س' in syp_val:
|
||||
egp_val = syp_val.replace('ل.س', 'ج.م')
|
||||
jod_val = syp_val.replace('ل.س', 'د.أ')
|
||||
elif 'SYP' in syp_val:
|
||||
egp_val = syp_val.replace('SYP', 'EGP')
|
||||
jod_val = syp_val.replace('SYP', 'JOD')
|
||||
else:
|
||||
# Fallback
|
||||
egp_val = 'EGP'
|
||||
jod_val = 'JOD'
|
||||
|
||||
egp_line = syp_line.replace('SYP', 'EGP').replace(syp_val, egp_val)
|
||||
jod_line = syp_line.replace('SYP', 'JOD').replace(syp_val, jod_val)
|
||||
|
||||
return f'{syp_line}\n {egp_line}\n {jod_line}'
|
||||
|
||||
# "SYP": "ل.س",
|
||||
content = re.sub(r'"SYP"\s*:\s*"([^"]+)",', replace_syp, content)
|
||||
|
||||
# "You have gift 300 SYP": "عندك هدية 300 ل.س",
|
||||
content = re.sub(r'"You have gift 300 SYP"\s*:\s*"([^"]+)",', replace_syp, content)
|
||||
|
||||
# "You have gift 30000 SYP": "عندك هدية 30000 ل.س",
|
||||
content = re.sub(r'"You have gift 30000 SYP"\s*:\s*"([^"]+)",', replace_syp, content)
|
||||
|
||||
with open(filepath, 'w') as f:
|
||||
f.write(content)
|
||||
print(f"Fixed {filepath}")
|
||||
|
||||
def fix_json(filepath):
|
||||
with open(filepath, 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
def replace_syp_json(match):
|
||||
syp_line = match.group(0)
|
||||
egp_line = syp_line.replace('SYP', 'EGP')
|
||||
jod_line = syp_line.replace('SYP', 'JOD')
|
||||
return f'{syp_line}\n {egp_line}\n {jod_line}'
|
||||
|
||||
content = re.sub(r'"Points"\s*:\s*"SYP",', replace_syp_json, content)
|
||||
|
||||
with open(filepath, 'w') as f:
|
||||
f.write(content)
|
||||
print(f"Fixed {filepath}")
|
||||
|
||||
if __name__ == '__main__':
|
||||
fix_translations('siro_rider/lib/controller/local/translations.dart')
|
||||
fix_translations('siro_driver/lib/controller/local/translations.dart')
|
||||
fix_json('siro_driver/lib/translations_en.json')
|
||||
4570
git_cost.diff
Normal file
4570
git_cost.diff
Normal file
File diff suppressed because it is too large
Load Diff
133
refactor_controller.py
Normal file
133
refactor_controller.py
Normal file
@@ -0,0 +1,133 @@
|
||||
import sys
|
||||
import re
|
||||
|
||||
def refactor_controller(filepath):
|
||||
with open(filepath, 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
# 1. Change double to String for pricing variables
|
||||
content = re.sub(r'double totalPassengerSpeed = 0;', "String totalPassengerSpeed = '0';", content)
|
||||
content = re.sub(r'double totalPassengerBalash = 0;', "String totalPassengerBalash = '0';", content)
|
||||
content = re.sub(r'double totalPassengerComfort = 0;', "String totalPassengerComfort = '0';", content)
|
||||
content = re.sub(r'double totalPassengerElectric = 0;', "String totalPassengerElectric = '0';", content)
|
||||
content = re.sub(r'double totalPassengerLady = 0;', "String totalPassengerLady = '0';", content)
|
||||
content = re.sub(r'double totalPassengerScooter = 0;', "String totalPassengerScooter = '0';", content)
|
||||
content = re.sub(r'double totalPassengerVan = 0;', "String totalPassengerVan = '0';", content)
|
||||
content = re.sub(r'double totalPassengerRayehGai = 0;', "String totalPassengerRayehGai = '0';", content)
|
||||
content = re.sub(r'double totalPassengerRayehGaiComfort = 0;', "String totalPassengerRayehGaiComfort = '0';", content)
|
||||
content = re.sub(r'double totalPassengerRayehGaiBalash = 0;', "String totalPassengerRayehGaiBalash = '0';", content)
|
||||
|
||||
content = re.sub(r'double totalPassenger = 0;', "String totalPassenger = '0';", content)
|
||||
content = re.sub(r'double totalCostPassenger = 0;', "String totalCostPassenger = '0';", content)
|
||||
|
||||
# 2. Replace bottomSheet method
|
||||
bottom_sheet_pattern = re.compile(r'Future bottomSheet\(\) async \{.*?(?=update\(\);\n\s*mapEngine\.changeBottomSheetShown\(forceValue: true\);\n\s*\})', re.DOTALL)
|
||||
|
||||
new_bottom_sheet = '''Future bottomSheet() async {
|
||||
durationToAdd = Duration(seconds: durationToRide);
|
||||
hours = durationToAdd.inHours;
|
||||
minutes = (durationToAdd.inMinutes % 60).round();
|
||||
final DateTime currentTime = DateTime.now();
|
||||
newTime = currentTime.add(durationToAdd);
|
||||
|
||||
try {
|
||||
final res = await CRUD().post(link: AppLink.getPrices, payload: {
|
||||
'distance': distance.toString(),
|
||||
'durationToRide': durationToRide.toString(),
|
||||
'startNameAddress': startNameAddress,
|
||||
'endNameAddress': endNameAddress,
|
||||
'destLat': myDestination.latitude.toString(),
|
||||
'destLng': myDestination.longitude.toString(),
|
||||
'passengerLat': newMyLocation.latitude.toString(),
|
||||
'passengerLng': newMyLocation.longitude.toString(),
|
||||
'walletVal': box.read(BoxName.passengerWalletTotal)?.toString() ?? '0',
|
||||
'activeMenuWaypointCount': activeMenuWaypointCount.toString(),
|
||||
});
|
||||
|
||||
if (res != 'failure') {
|
||||
var response = jsonDecode(res);
|
||||
if (response['status'] == 'success') {
|
||||
var data = response['data'];
|
||||
totalPassengerSpeed = data['totalPassengerSpeed']?.toString() ?? '0';
|
||||
totalPassengerBalash = data['totalPassengerBalash']?.toString() ?? '0';
|
||||
totalPassengerComfort = data['totalPassengerComfort']?.toString() ?? '0';
|
||||
totalPassengerElectric = data['totalPassengerElectric']?.toString() ?? '0';
|
||||
totalPassengerLady = data['totalPassengerLady']?.toString() ?? '0';
|
||||
totalPassengerScooter = data['totalPassengerScooter']?.toString() ?? '0';
|
||||
totalPassengerVan = data['totalPassengerVan']?.toString() ?? '0';
|
||||
totalPassengerRayehGai = data['totalPassengerRayehGai']?.toString() ?? '0';
|
||||
totalPassengerRayehGaiComfort = data['totalPassengerRayehGaiComfort']?.toString() ?? '0';
|
||||
totalPassengerRayehGaiBalash = data['totalPassengerRayehGaiBalash']?.toString() ?? '0';
|
||||
|
||||
totalPassenger = totalPassengerSpeed;
|
||||
totalCostPassenger = totalPassenger;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
Log.print("Error fetching prices: $e");
|
||||
}
|
||||
|
||||
'''
|
||||
content = bottom_sheet_pattern.sub(new_bottom_sheet, content)
|
||||
|
||||
# 3. Replace applyPromoCodeToPassenger
|
||||
promo_pattern = re.compile(r'void applyPromoCodeToPassenger\(BuildContext context\) async \{.*?(?=Get\.back\(\);\n\s*await Future\.delayed\(const Duration\(milliseconds: 120\)\);\n\s*\} catch \(e\) \{)', re.DOTALL)
|
||||
|
||||
new_promo = '''void applyPromoCodeToPassenger(BuildContext context) async {
|
||||
if (promoTaken == true) {
|
||||
MyDialog().getDialog('Promo Already Used'.tr, 'You have already used this promo code.'.tr, () => Get.back());
|
||||
return;
|
||||
}
|
||||
if (!promoFormKey.currentState!.validate()) return;
|
||||
|
||||
try {
|
||||
final res = await CRUD().post(link: AppLink.getPrices, payload: {
|
||||
'distance': distance.toString(),
|
||||
'durationToRide': durationToRide.toString(),
|
||||
'startNameAddress': startNameAddress,
|
||||
'endNameAddress': endNameAddress,
|
||||
'destLat': myDestination.latitude.toString(),
|
||||
'destLng': myDestination.longitude.toString(),
|
||||
'passengerLat': newMyLocation.latitude.toString(),
|
||||
'passengerLng': newMyLocation.longitude.toString(),
|
||||
'walletVal': box.read(BoxName.passengerWalletTotal)?.toString() ?? '0',
|
||||
'activeMenuWaypointCount': activeMenuWaypointCount.toString(),
|
||||
'promo_code': promo.text,
|
||||
});
|
||||
|
||||
if (res != 'failure') {
|
||||
var response = jsonDecode(res);
|
||||
if (response['status'] == 'success') {
|
||||
var data = response['data'];
|
||||
totalPassengerSpeed = data['totalPassengerSpeed']?.toString() ?? '0';
|
||||
totalPassengerBalash = data['totalPassengerBalash']?.toString() ?? '0';
|
||||
totalPassengerComfort = data['totalPassengerComfort']?.toString() ?? '0';
|
||||
totalPassengerElectric = data['totalPassengerElectric']?.toString() ?? '0';
|
||||
totalPassengerLady = data['totalPassengerLady']?.toString() ?? '0';
|
||||
totalPassengerScooter = data['totalPassengerScooter']?.toString() ?? '0';
|
||||
totalPassengerVan = data['totalPassengerVan']?.toString() ?? '0';
|
||||
totalPassengerRayehGai = data['totalPassengerRayehGai']?.toString() ?? '0';
|
||||
totalPassengerRayehGaiComfort = data['totalPassengerRayehGaiComfort']?.toString() ?? '0';
|
||||
totalPassengerRayehGaiBalash = data['totalPassengerRayehGaiBalash']?.toString() ?? '0';
|
||||
|
||||
promoTaken = true;
|
||||
update();
|
||||
|
||||
Confetti.launch(
|
||||
context,
|
||||
options: const ConfettiOptions(particleCount: 100, spread: 70, y: 0.6),
|
||||
);
|
||||
} else {
|
||||
MyDialog().getDialog('Promo Error'.tr, response['message']?.toString() ?? 'Invalid Promo'.tr, () => Get.back());
|
||||
return;
|
||||
}
|
||||
}
|
||||
'''
|
||||
content = promo_pattern.sub(new_promo, content)
|
||||
|
||||
with open(filepath, 'w') as f:
|
||||
f.write(content)
|
||||
print(f"Refactored {filepath}")
|
||||
|
||||
if __name__ == '__main__':
|
||||
refactor_controller(sys.argv[1])
|
||||
80
refactor_widget.py
Normal file
80
refactor_widget.py
Normal file
@@ -0,0 +1,80 @@
|
||||
import sys
|
||||
import re
|
||||
|
||||
def refactor_widget(filepath):
|
||||
with open(filepath, 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
# Refactor _getPassengerPriceText
|
||||
price_text_pattern = re.compile(r'String _getPassengerPriceText\(\s*CarType carType, RideLifecycleController mapPassengerController\) \{.*?return formatter\.format\(roundedPrice\);\s*\}', re.DOTALL)
|
||||
|
||||
new_price_text = '''String _getPassengerPriceText(
|
||||
CarType carType, RideLifecycleController mapPassengerController) {
|
||||
String rawPrice;
|
||||
switch (carType.carType) {
|
||||
case 'Comfort':
|
||||
rawPrice = mapPassengerController.totalPassengerComfort;
|
||||
break;
|
||||
case 'Fixed Price':
|
||||
rawPrice = mapPassengerController.totalPassengerSpeed;
|
||||
break;
|
||||
case 'Electric':
|
||||
rawPrice = mapPassengerController.totalPassengerElectric;
|
||||
break;
|
||||
case 'Awfar Car':
|
||||
rawPrice = mapPassengerController.totalPassengerBalash;
|
||||
break;
|
||||
case 'Scooter':
|
||||
case 'Pink Bike':
|
||||
rawPrice = mapPassengerController.totalPassengerScooter;
|
||||
break;
|
||||
case 'Van':
|
||||
rawPrice = mapPassengerController.totalPassengerVan;
|
||||
break;
|
||||
case 'Lady':
|
||||
rawPrice = mapPassengerController.totalPassengerLady;
|
||||
break;
|
||||
case 'Rayeh Gai':
|
||||
rawPrice = mapPassengerController.totalPassengerRayehGai;
|
||||
break;
|
||||
default:
|
||||
return '...';
|
||||
}
|
||||
return rawPrice;
|
||||
}'''
|
||||
content = price_text_pattern.sub(new_price_text, content)
|
||||
|
||||
# Refactor _getOriginalPrice
|
||||
original_price_pattern = re.compile(r'double _getOriginalPrice\(\s*CarType carType, RideLifecycleController mapPassengerController\) \{.*?return 0\.0;\s*\}\s*\}', re.DOTALL)
|
||||
|
||||
new_original_price = '''String _getOriginalPrice(
|
||||
CarType carType, RideLifecycleController mapPassengerController) {
|
||||
switch (carType.carType) {
|
||||
case 'Comfort':
|
||||
return mapPassengerController.totalPassengerComfort;
|
||||
case 'Fixed Price':
|
||||
return mapPassengerController.totalPassengerSpeed;
|
||||
case 'Electric':
|
||||
return mapPassengerController.totalPassengerElectric;
|
||||
case 'Awfar Car':
|
||||
return mapPassengerController.totalPassengerBalash;
|
||||
case 'Van':
|
||||
return mapPassengerController.totalPassengerVan;
|
||||
case 'Lady':
|
||||
return mapPassengerController.totalPassengerLady;
|
||||
default:
|
||||
return '0';
|
||||
}
|
||||
}'''
|
||||
content = original_price_pattern.sub(new_original_price, content)
|
||||
|
||||
# Refactor _buildRayehGaiOption
|
||||
rayeh_gai_pattern = re.compile(r'Widget _buildRayehGaiOption\(\s*BuildContext context,\s*RideLifecycleController mapPassengerController,\s*String carTypeName,\s*double price\)')
|
||||
content = rayeh_gai_pattern.sub(r'Widget _buildRayehGaiOption(BuildContext context, RideLifecycleController mapPassengerController, String carTypeName, String price)', content)
|
||||
|
||||
with open(filepath, 'w') as f:
|
||||
f.write(content)
|
||||
print(f"Refactored {filepath}")
|
||||
|
||||
if __name__ == '__main__':
|
||||
refactor_widget(sys.argv[1])
|
||||
60
replace_currency.py
Normal file
60
replace_currency.py
Normal file
@@ -0,0 +1,60 @@
|
||||
import os
|
||||
import re
|
||||
|
||||
def process_file(filepath, app_name):
|
||||
# Skip translations and currency.dart
|
||||
if 'translations.dart' in filepath or 'currency.dart' in filepath or 'translations_en.json' in filepath:
|
||||
return
|
||||
|
||||
with open(filepath, 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
original_content = content
|
||||
|
||||
# We only want to replace instances that represent the currency string.
|
||||
# Be careful not to replace it inside other words or imports.
|
||||
# We'll use regex word boundaries or quotes.
|
||||
|
||||
# Pattern to match 'SYP'.tr or "SYP".tr
|
||||
content = re.sub(r"(['\"]SYP['\"])\.tr", "CurrencyHelper.currency", content)
|
||||
|
||||
# Pattern to match 'SYP' or "SYP" (standalone, not followed by .tr since we did that)
|
||||
content = re.sub(r"['\"]SYP['\"]", "CurrencyHelper.currency", content)
|
||||
|
||||
# Sometimes it's inside string interpolation: '100 SYP' -> '100 ${CurrencyHelper.currency}'
|
||||
# But this is tricky. Let's look for " SYP" or " SYP " or "SYP " inside strings.
|
||||
# A safer way is to find exactly ' SYP' or 'SYP ' inside dart strings and replace with ${CurrencyHelper.currency}
|
||||
# For simplicity, let's just do a pass on common patterns:
|
||||
content = re.sub(r" SYP['\"]", " ${CurrencyHelper.currency}'", content)
|
||||
content = re.sub(r" SYP ", " ${CurrencyHelper.currency} ", content)
|
||||
content = re.sub(r"SYP ", "${CurrencyHelper.currency} ", content)
|
||||
|
||||
# Fix double curly braces if it was already interpolated like '100 SYP' inside something
|
||||
# Actually just simple regex
|
||||
content = content.replace(" ${CurrencyHelper.currency}'", " ${CurrencyHelper.currency}'")
|
||||
content = content.replace(' ${CurrencyHelper.currency}"', ' ${CurrencyHelper.currency}"')
|
||||
|
||||
if content != original_content:
|
||||
# Need to add import
|
||||
import_stmt = f"import 'package:{app_name}/constant/currency.dart';\n"
|
||||
if import_stmt not in content:
|
||||
# find first import
|
||||
import_idx = content.find('import ')
|
||||
if import_idx != -1:
|
||||
content = content[:import_idx] + import_stmt + content[import_idx:]
|
||||
else:
|
||||
content = import_stmt + content
|
||||
|
||||
with open(filepath, 'w') as f:
|
||||
f.write(content)
|
||||
print(f"Updated {filepath}")
|
||||
|
||||
def process_dir(directory, app_name):
|
||||
for root, dirs, files in os.walk(directory):
|
||||
for file in files:
|
||||
if file.endswith('.dart'):
|
||||
process_file(os.path.join(root, file), app_name)
|
||||
|
||||
if __name__ == '__main__':
|
||||
process_dir('siro_rider/lib', 'siro_rider')
|
||||
process_dir('siro_driver/lib', 'siro_driver')
|
||||
4937
ride_controller.diff
Normal file
4937
ride_controller.diff
Normal file
File diff suppressed because it is too large
Load Diff
118
siro_admin/.env
118
siro_admin/.env
@@ -1,118 +0,0 @@
|
||||
basicAuthCredentials=wqnmqqsjyvwjv:nqrYJP@1737XrXlBl
|
||||
basicCompareFaces=zjujluqfpj:nqrYjp@1737XrXlBl
|
||||
basicCompareFacesURL='https://face-detect-f6924392c4c7.herokuapp.com/compare_faces'
|
||||
accountSIDTwillo=QFx0qy456juj383n9xuy2194q629q1fj0y7XrXlBl
|
||||
serverAPI=QQQQobSrrFi:QVQ87xU7zwCvmZzZdaxuS2f23Y4mz7MzyOzr8od2br6KYyeFaTVLG3K3hx5ZaUyx7eYvAYpAVdKk-286NTRi3zs9iSOnXtXRIxswg3KecBmsl3VxJ9wO-vIpwu4Pv7dkHkXniuxMSDgWXrXlBl
|
||||
mapAPIKEY=AIzaSyCFsWBqvkXzk1Gb-bCGxwqTwJQKIeHjH64
|
||||
email=@intaleqapp.com
|
||||
mapAPIKEYIOS=AIzaSyDzGO9a-1IDMLD2FxhmOO9ONL1gMssFa9g
|
||||
twilloRecoveryCode=CAU79DHPH1BjE9PUH4ETXTSXZXrXlBl
|
||||
apiKeyHere=g_WNUb5L-tripz7-F8omHpUmgIzH7ETeH9xZ8RwGG9_G8zX9A
|
||||
authTokenTwillo=70u98ju0214oxx4q0u74028u021u4qu65XrXlBl
|
||||
chatGPTkey=zg-4C26q4SYgBKQeHZDqkWowC9XrxgUEfUy9JRw2rm6Q2adb3kjwXrXlBl
|
||||
transactionCloude=Qhcwuilomqcoib:QVO_JNYED2XWA26YXKC2TP:YK1DVH6SJB31N3PE1UXrXlBl
|
||||
visionApi=3pALsqSSYTvzp69Q5FMIgbzjG6Z1zktJXrXlBl
|
||||
chatGPTkeySefer=zg-IiR3i4ooza3Yvhvb9rZk1C9XrxgUE0l8jRRZrHj3Qe5QXPlqVXrXlBl
|
||||
chatGPTkeySeferNew=zg-Z4oAJcAROgNXjgrEIU8fKC9XrxgUE4Qtrrlq1yiux0jL3dITSXrXlBl
|
||||
secretKey=zg_ropj_57Iiv6pMFCBFq3C2n6IXlmjykpxDmW93SW3vvXh68UA9T5FORTWgWsT37StKsOPdwDdsy8qR9srMUluahs3nPHvgBa33tGk90vV5XrXlBl
|
||||
stripe_publishableKe=vg_propj_57Iiv6MFCBFq3C2n6kNJnZByV6nuDtXe9IjEPOfhmpDtWmt3MLR0gQpiHcQmAFMUPrZc3QiCDjxBZLbxDC3efxWxz33bWH1ZgrsXrXlBl
|
||||
llamaKey=RR-EuyoFDUvfRDBoj46fZKAtKJ3voM8Mt768cPeJV7GNdAkPTKdY8Odm9n4ggGqI5GyoXrXlBl
|
||||
serverPHP=https://api.sefer.live/sefer
|
||||
seferAlexandriaServer=https://seferalexandria.site/sefer
|
||||
seferPaymentServer=https://seferpw.shop/sefer
|
||||
# seferCairoServer=https://sefer.click/sefer
|
||||
seferCairoServer=https://server.sefer.live/sefer.click/sefer
|
||||
seferGizaServer=https://gizasefer.online/sefer
|
||||
whatappID=3699397362811879
|
||||
whatsapp=EAAOtbZBSUK74BOzW9yb74EgApQYtI88nYtE9jQi9QnLGpw3FQpc5dxIlDgVJzcMywEBqNYf3s8pkk6cZB5Q0tkKuSOZBsOvMZA3Tcth0IlBHSaMVtcRZCsaTKNSUpfLRGRb0rhLezNFllpYBgmnfbhUazSZBYXdr40nmN4QEgweK2eqYQnTTNuryTOyBkKZB1MXMw6U7QnTRQDxHbUVlqgIRTrhaooZD
|
||||
cohere=Aulwd8y5SPWos0hJhlG0toUf8gOhUUrpf5Q2TPmVGXrXlBl
|
||||
claudeAiAPI=zg-qbc-qvo39l-xWOxIGwWTOzCFBnIYSKKhfyz_KVAvrH-6_4ZEJL68G_QBH26oeTOMMoQug9KuOjjKSP_A4S3SUDlbxR9duVzoQ-MkX_UQQQXrXlBl
|
||||
payPalClientId=QALymlfNI5Tzt4s-ysoz6vD4_nqX0SUtkC_qYV-Ugk5gaM_8Z-kg4L53k8Uux_4jEWXDkNpXGSWPpIzDFXrXlBl
|
||||
payPalClientIdLive=QZFkjAoZfGtngNserll6r3cC56Xl1sVLQkn5dMbyebhzJY59EQ3hz7YxaEqEDYPTUFcQWqvePaQ5UJJVRXrXlBl
|
||||
payPalSecret=JBAAvqJQGUsKD0Zjh4KjeczxfBFx-38SdlbIS56VRM8NDfe6mjMeZJhNLJek5XgQCqKCHtRf6MjRy-f8XrXlBl
|
||||
payPalSecretLive=JQDATqkknDfiFpEAN60KB4pGpDaJjyqBAd9jxMBPpzWU1P1k3H1jZhQjn73EHsKQna74P8p98hgOnMaWPWXrXlBl
|
||||
geminiApi=QOmqZsQYm08vlOqjI7klVJfvP4WBFEoemjgy396iXrXlBl
|
||||
geminiApiMasa=QOmqZsQIpdM4BRsKmaDJOP7dZp5-c6NWfch7PAlQXrXlBl
|
||||
agoraAppId=71880f2j636o509j24y5294480y30u848XrXlBl
|
||||
agoraAppCertificate=j17q944u49390jhq758u1649448q2y6xfuXrXlBl
|
||||
usernamePayMob=37319104052XrXlBl
|
||||
passwordPayMob='g@nkD2#99k!hD_.wXrXlBl'
|
||||
integrationIdPayMob=0237630XrXlBl
|
||||
payMobApikey='MDrGqKEWS1rVqhjggHvEPDvPjJ7vZDBExrO7S3BEBgrlfUwTA3i5RnP5ZnvoL3M2S9rEBgrlNTdexH5pTPf7NJrvy1reZJv1Tn7zf7vTIDywjHg1C7Ley38HTDyNA3v7TPfdxJrax1rwPmPtMJyzqKEYZeghq3MuLUrFH3A1AgHcH15CZ9UaZTLOxnw0BTdzHHrBArisZerUMUUzZ1BnBeEijHvNjYLnS1BUICMhSmPhA15ifHyVqKEMHWyKLbyuIPvcH9UeL3vZyDf=cvcXrXlBlbbbbb'
|
||||
integrationIdPayMobWallet=0277739XrXlBl
|
||||
ocpApimSubscriptionKey=0f5dacccdbce4131b1a5f952996302e3
|
||||
smsPasswordEgypt="J)Vh=qb/@MXrXlBl"
|
||||
chatGPTkeySeferNew4=zg-vlie-2l1ZlpximLJ6wQOvbb4TnC9XrxgUEyVQIu6TID4qP4FUUqoS5XrXlBl
|
||||
anthropicAIkeySeferNew=zg-qbc-qvo39-mn4VdMQ5nuJeIYhMN4PDYr7qox3-t2i1Lh7aNTDfYF-Gf8whUJZCs47EeelKn8_UcmUMmiSLaf0UJg0DvUlQrDt-76CRrkQQXrXlBl
|
||||
llama3Key=kzg_uTXy3e9DBbCQ1FnMGmxYwTKysx9US1burxJj4fFwOje4LZBUFKJS1XrXlBl
|
||||
payMobOutClientSecrret='xyjjRlkahJM0Xc38WjApCOh8bvgL9slFpNdM9YeCu9AhLqboKMPtmSvc2N9O4tXxFLV2JAV6stBSTAGFGCVubGe6MNpc7MzJnZ3SiT6GpavBoCLWkUvVbdSDaM0zHvuBOXrXlBl'
|
||||
payMobOutClient_id='Z05ut48dVkkS2gI2zenFFcKsfDKfHAU0WELqKyJ0LXrXlBl'
|
||||
payMobOutPassword='D2zJFxkE#LNk3vz38z2dYxpNfWXrXlBl'
|
||||
payMobOutUserName='zjujl_qvo_fwkjfgjlXrXlBl'
|
||||
keyOfApp=balsev@7696tabnaazesmeheregzpfjoXrXrBr
|
||||
initializationVector=qxfyjukwoegrnbivXrXrBr
|
||||
privateKeyFCM=WZSHwLUNI/wlyLUyIZHYf/pgOo6JZplTQqKK2HJmuSJ+r4Iygz/W+03uFPFS4iLv4AIuZ5+wFBDU9gf240fgjhjJgq1bwiW4TrlTh4YhEtHjiPTBCielwIcYFrhrlD4xLTHQC8feSZuZ4t3wZISRfqjuIyu58yhG5H64RifbD5efjzE6KJCivhIpXcK5k1t32lMnlLKzPkSqW2znCXYhRNOQEL+sAllmQNpHVy7LAgr829Jl5AoEuHmYeeCLOIzV5oMdHpQGDDAaG+bo9Yda4n3S1NXNAwU3h8uWsXaAHS1mkgb49+gTJQLfhrxdj2jOHB2HaUA7IyypVXTDuEZzYrYs/+yK2HvmFld/Fqt7ndWqenfl4Qu6+r/JUEHhaGMFNkiChvtVHjLHDOBw7Zrtm5kDzwrvybCVZSrZAwJvudT7eZjRlYrdm2s+v5Q4wVayBslBW02KT/VrXJsuPJKtI7l2jHzIV6M0vmMXU8rlah2gSVl9ZX8mLxcQm7iWbLyWX0S4hixngw3N+j7wltAxYodfkCdJj0BdeH0ZCCKlbANs+lQf5hIzjkC7RcSc2xRnMn1mcyqUlK0BiniSgBSixD3JdpG8UTEYU5nfTVdgsx+fcvje5Dloo6zblKbIVje8vh5MSFjM2yr4nOpbQu95vOW/jSYUjm2WGppCmpBVyWYglp4AlnwDNFL01p3jq+1YixPTZjnp4Bm4XGiGIUnmjBeC18CQ53rg+aWvE7UlOMsoirgU1Y+tAxzbx74xtYfgNjavyD+GtUWkOZPtKSTeR+0uBrfTehFK24QypP5OT3dRbAwRVneySDJOpcQA9xReYpJgoW29GzNLNNoEW+65HIqYQ7WkVj0Z16YOma/WhR4MSHWpOmqxVAYOsGpZw9QnSrY/CFN8uKhYPC4RGONHmk5CP0rTNA0syrBS0XPFsJ8vhgJmB2wjUs46IDX5tFreS7q4axsOSxZMWSQlRHcxSdwFVAepBIfoGWHSUmE0sxpsz+ewCdYtZrWYE0jwEqiTiKR1M4hpn9P1mI0CHri6uRUY2Im86kuEGA5GE9U287rOubVCfC+IxU4vOnNi05fN4lJutdXjweHN7L1ZJ4H0AsFfs8Q3HSHKbn5MTJUlF2rlhNomMlLJnRrDzYiSJ6wIbBXzT8h23WXPMNrTkbh8WkPugEPrp0LTyJI2wurEhhPIlqJwFcpjVVsDmFKmTqMegJsj9C8kHixQ/kyT0AtQ3qTVxgHP/9nxyuglVzdezqlB09yOjVnq/xU+nnTx2RX90Lpf192D23rSvtvfG4LAs2vloKljKG0yIGntFJbikCsv1bQfXwa4cXb6niks4v7irCjLzEtyIDzjYaaSJc0gs69tyumG0bc7AjJa4AvrDtFchN2m9PXGFoOHC0eDMqfANc2VztcYlFEMH0Fp/VsIuiTOSI9Tsb8wjRlrew13EqWUXN48srVHaFfyXUCbSpeelnqCe21EwGOpfgqgUcu/5WdtYH+e7F0Z3xtV6lZNqV7mWYuyyf9C9PviFh0ZECKXivg6vrP4pqDSvuu79ZkR0aTf43NPvGRIIR6Hbjt+Msi3CKsRlLrN8sslxFfB4ZYpQcGmDxTd0vvnarfu0ezz5GU4AXA3Eb4rYdaoB3MRxvbRF/2NMdqb+M5iPTVgRZ7vmDsIogu4O4kgpYNjPE2B66Qz/CbRI6CYFAnF3usKjnNl9k5bFL8d6x+EOZaXm2bZhML5K//tB2TsGl5Bw7sNggC56KqOEOg6WnDIoy4NzzImd8IEamuZdkiaaRl8+/P3Mz+b325kZzAj2e/5feXoup8V/H4edIsIGeIjHNuU+otJ8LQ9EnMFGaZfkiboH7feG1W/n8sZAlusmwcpeISNbskCmQKO44oI8G0WWBpLNo4/5NN1V4XuPGVoIhxQSObLDBHoRttmMNHp3dWv+R9SMxOuswXZYsLUJD5vLD3i9ZzBuLrBdiKgFk7rVFvTrz1CIiBDKeFtvMiEfEtSSQkI5nnh1dHSxRRBrmGa/UME/dCdRGlvTZuHGnq+PgJFlhC3oYLBhOJcw65asHKm94tgLeGeWZ9UytEfuvuL2gIAUUql0sLjgnWBoz84XCkNVMP2fB0Ci6NAbRfE1zJh8PVHezFvvEOl8KvVkLqFtzRqgTvkLV/cjG8bvJsTaHklejY14iv+pG0gYZ4Gkia5jvSzGa3IZEqhOG5hXmEBLcBcfp7ApQ5Ezopt9EJVm4+kRW5nWB6YPiqbzfz8Ab7/uV6GIWSJoG7f0kW1keUtL9SS2n2OxG3S0XWJrYoN9udVviFdl5GqDqTfc4odY9v4fdV3bMgU009S9y6dNRhi3RUTaNIcZHAVbEL0VXzXOi/r4ICjMFXvWVF8xY8RdJPedu9HIbCTq+TPzOgpHoANzm8Rjm2i6J5TLUfqdS7NIHig8M5lni80PlOlnmgvjf5s6PwatrbN6QKMxk8bg6LoI2yGy5ICJ5dncvcR/GgTxHEpz3aknTdMqJMfyST7CmIpTOULEO4zmiKrWYvvlEmaax7j1fJoz4Y1Z29Zm7+mG9lGrCUnsU9CZoAr/d+flJnSWwdwhL/RXhu+pbkdu2gTmg9ar4mwoGYp9GoaefgCIupiL4T3JekNS/MvmZFbiGxl4TVVobj5MsYHawLs5C9AdzjEuK6ktqAr0o1ycBwfj66kuqSnU7KQedmlDs3XmlAqdGk6V2BEs7/b+bfuUJw1FcYf9MVXMQnN1pbDKJVtb+Zrf+AYQ9etUPpsoDxom2NJRgjjdsLkLIPxEZ6HJRAEcnHx49ER+zbdL+7MKolBRzlW4mZHLYkscfx7bqWZsH5PtjDp9Ed1xbHpmwFbv7XV2mYfST6Nu8dLYk/6wkyZybv8hNe1Wj/4o+iMRnOsCUasT9GKF2ezoej1RPzN3GjqR0gfrndn40fXFn4E2n8HP8SKeChiNf++HEzbzd9a7djXE3Xon8/baEaTUBKZUoIZ9OFypU+Ueo0CJpI9CzEipfXp3lGImVhsdQJ2AwRnY6HkXS74sd840HyYzDGL0B8mVvgQwYJQyC+xHRmNUFO9ugmhOmXQjVnkST9XqJpm/vwTAY28C/Al1iKmMjFqWBBNkyRJd6lTus87niZr+tpzBPLW6PZDaAcS5aTPS/dv01W5gLeEhA==
|
||||
sss_pass=wqnmqqsjyvwv:nqrmYJP@17378XrXlBl
|
||||
sss_encryptionSalt=zg-vklie-2l1ZlpxiLJ6wQOvbb4TnC9XrxgUEyVQIu6TID4qP4FUUqoS5XrXlBl
|
||||
addd=BlBlNl
|
||||
getLocationAreaLinks =https://api.tripz-egypt.com/tripz/ride/location/get_location_area_links.php
|
||||
anthropicAIkeySeferNewHamzaayedpython=zg-qbc-qvo39-vCB-WnzEwFNArO0YlTapvfhtmguKWsXJSKqg_NZSjHBYVXMZK1yUK88SobdckV0KuPaBh0c_WHtGsRO_439PBk-e2QqgkQQXrXlBl
|
||||
emailService=seferservice@gmail.com
|
||||
allowed=TripzDriver:
|
||||
allowedWallet=TripzWallet:
|
||||
passnpassenger=hbgbitbXrXrBr
|
||||
ALLOWED_ADMIN_PHONES=963992952235,962790849027,962787021927,963942542053,962772735902,971529155811
|
||||
newId=new
|
||||
a=q
|
||||
b=x
|
||||
c=f
|
||||
d=y
|
||||
e=j
|
||||
f=u
|
||||
g=k
|
||||
h=w
|
||||
i=o
|
||||
j=e
|
||||
k=g
|
||||
l=r
|
||||
m=n
|
||||
n=b
|
||||
o=i
|
||||
p=v
|
||||
q=a
|
||||
r=l
|
||||
s=z
|
||||
t=c
|
||||
u=h
|
||||
v=p
|
||||
w=t
|
||||
x=d
|
||||
y=s
|
||||
z=m
|
||||
|
||||
A=Q
|
||||
B=X
|
||||
C=F
|
||||
D=Y
|
||||
E=J
|
||||
F=U
|
||||
G=K
|
||||
H=W
|
||||
I=O
|
||||
J=E
|
||||
K=G
|
||||
L=R
|
||||
M=N
|
||||
N=B
|
||||
O=I
|
||||
P=V
|
||||
Q=A
|
||||
R=L
|
||||
S=Z
|
||||
T=C
|
||||
U=H
|
||||
V=P
|
||||
W=T
|
||||
X=D
|
||||
Y=S
|
||||
Z=M
|
||||
5
siro_admin/.gitignore
vendored
5
siro_admin/.gitignore
vendored
@@ -43,3 +43,8 @@ app.*.map.json
|
||||
/android/app/debug
|
||||
/android/app/profile
|
||||
/android/app/release
|
||||
|
||||
# Sensitive keys & environment files
|
||||
key.properties
|
||||
*.env
|
||||
**/lib/env/env.g.dart
|
||||
|
||||
13886
siro_admin/lib/env/env.g.dart
vendored
13886
siro_admin/lib/env/env.g.dart
vendored
File diff suppressed because it is too large
Load Diff
5
siro_driver/.gitignore
vendored
5
siro_driver/.gitignore
vendored
@@ -43,3 +43,8 @@ app.*.map.json
|
||||
/android/app/debug
|
||||
/android/app/profile
|
||||
/android/app/release
|
||||
|
||||
# Sensitive keys & environment files
|
||||
key.properties
|
||||
*.env
|
||||
**/lib/env/env.g.dart
|
||||
|
||||
15
siro_driver/lib/constant/currency.dart
Normal file
15
siro_driver/lib/constant/currency.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
import 'package:siro_driver/main.dart';
|
||||
import 'package:siro_driver/constant/box_name.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class CurrencyHelper {
|
||||
static String get currency {
|
||||
String country = box.read(BoxName.countryCode) ?? 'Jordan';
|
||||
switch (country) {
|
||||
case 'Syria': return 'SYP'.tr;
|
||||
case 'Egypt': return 'EGP'.tr;
|
||||
case 'Jordan':
|
||||
default: return 'JOD'.tr;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,431 +4,446 @@ import '../main.dart';
|
||||
import 'box_name.dart';
|
||||
|
||||
class AppLink {
|
||||
static String serverPHP = box.read('serverPHP');
|
||||
static String get serverPHP => box.read('serverPHP');
|
||||
|
||||
static String paymentServer = 'https://walletintaleq.intaleq.xyz/v1/main';
|
||||
static String get paymentServer => 'https://walletintaleq.intaleq.xyz/v1/main';
|
||||
static const String appDomain = 'siromove.com';
|
||||
|
||||
static String locationServer =
|
||||
static String get locationServer =>
|
||||
'https://location.intaleq.xyz/siro/ride/location';
|
||||
static String locationServerSide =
|
||||
static String get locationServerSide =>
|
||||
'https://location.intaleq.xyz/siro/ride/location';
|
||||
static String mapSaasRoute = 'https://map-saas.intaleqapp.com/api/maps/route';
|
||||
static String mapSaasPlaces =
|
||||
static String get mapSaasRoute => 'https://map-saas.intaleqapp.com/api/maps/route';
|
||||
static String get mapSaasPlaces =>
|
||||
'https://map-saas.intaleqapp.com/api/geocoding/places';
|
||||
static const String routeApiBaseUrl =
|
||||
static String get routeApiBaseUrl =>
|
||||
"https://routesjo.intaleq.xyz/route/v1/driving";
|
||||
static final String endPoint = 'https://api.intaleq.xyz/intaleq_v3';
|
||||
static final String syria = 'https://syria.intaleq.xyz/siro';
|
||||
static final String server = endPoint;
|
||||
static String get currentCountry => box.read(BoxName.countryCode) ?? 'Jordan';
|
||||
|
||||
static String get endPoint {
|
||||
switch (currentCountry) {
|
||||
case 'Syria':
|
||||
return 'https://api-syria.siromove.com/intaleq_v3';
|
||||
case 'Egypt':
|
||||
return 'https://api-egypt.siromove.com/intaleq_v3';
|
||||
case 'Jordan':
|
||||
default:
|
||||
return 'https://api-jordan.siromove.com/intaleq_v3';
|
||||
}
|
||||
}
|
||||
|
||||
static String get syria => 'https://api-syria.siromove.com/siro';
|
||||
static String get server => endPoint;
|
||||
|
||||
///=================ride==========================///
|
||||
///https://api.intaleq.xyz/siro/ride
|
||||
static String ride = '$server/ride';
|
||||
static String rideServer = 'https://rides.intaleq.xyz/siro/ride';
|
||||
static String get ride => '$server/ride';
|
||||
static String get rideServer => 'https://rides.intaleq.xyz/siro/ride';
|
||||
|
||||
///mapOSM = 'https://routesy.intaleq.xyz'
|
||||
static String mapOSM = 'https://routesy.intaleq.xyz';
|
||||
static String get mapOSM => 'https://routesy.intaleq.xyz';
|
||||
|
||||
static String seferCairoServer = endPoint;
|
||||
static String seferGizaServer =
|
||||
static String get seferCairoServer => endPoint;
|
||||
static String get seferGizaServer =>
|
||||
box.read('Giza') ?? box.read(BoxName.serverChosen);
|
||||
static String seferAlexandriaServer =
|
||||
static String get seferAlexandriaServer =>
|
||||
box.read('Alexandria') ?? box.read(BoxName.serverChosen);
|
||||
// static final String server = Env.serverPHP;
|
||||
|
||||
static String loginJwtDriver = "$server/loginJwtDriver.php";
|
||||
static String loginJwtWalletDriver = "$server/loginJwtWalletDriver.php";
|
||||
static String loginFirstTimeDriver = "$server/loginFirstTimeDriver.php";
|
||||
static String get loginJwtDriver => "$server/loginJwtDriver.php";
|
||||
static String get loginJwtWalletDriver => "$server/loginJwtWalletDriver.php";
|
||||
static String get loginFirstTimeDriver => "$server/loginFirstTimeDriver.php";
|
||||
|
||||
static String googleMapsLink = 'https://maps.googleapis.com/maps/api/';
|
||||
static String llama = 'https://api.llama-api.com/chat/completions';
|
||||
static String gemini =
|
||||
static String get googleMapsLink => 'https://maps.googleapis.com/maps/api/';
|
||||
static String get llama => 'https://api.llama-api.com/chat/completions';
|
||||
static String get gemini =>
|
||||
'https://generativelanguage.googleapis.com/v1beta3/models/text-bison-001:generateText';
|
||||
|
||||
static String test = "$server/test.php";
|
||||
static String get test => "$server/test.php";
|
||||
|
||||
//===============contact==========================
|
||||
static String savePhones = "$ride/egyptPhones/add.php";
|
||||
static String savePhonesSyria = "$ride/egyptPhones/syrianAdd.php";
|
||||
static String getPhones = "$ride/egyptPhones/get.php";
|
||||
static String get savePhones => "$ride/egyptPhones/add.php";
|
||||
static String get savePhonesSyria => "$ride/egyptPhones/syrianAdd.php";
|
||||
static String get getPhones => "$ride/egyptPhones/get.php";
|
||||
|
||||
////===============firebase==========================
|
||||
static String getTokens = "$ride/firebase/get.php";
|
||||
static String get getTokens => "$ride/firebase/get.php";
|
||||
|
||||
static String getDriverToken = "$ride/firebase/getDriverToken.php";
|
||||
static String addTokens = "$ride/firebase/add.php";
|
||||
static String addTokensDriver = "$ride/firebase/addDriver.php";
|
||||
static String addTokensDriverWallet =
|
||||
static String get getDriverToken => "$ride/firebase/getDriverToken.php";
|
||||
static String get addTokens => "$ride/firebase/add.php";
|
||||
static String get addTokensDriver => "$ride/firebase/addDriver.php";
|
||||
static String get addTokensDriverWallet =>
|
||||
"$paymentServer/ride/firebase/addDriver.php";
|
||||
|
||||
//=======================Wallet===================
|
||||
static String wallet = '$paymentServer/ride/passengerWallet';
|
||||
static String walletDriver = '$paymentServer/ride/driverWallet';
|
||||
static String getAllPassengerTransaction =
|
||||
static String get wallet => '$paymentServer/ride/passengerWallet';
|
||||
static String get walletDriver => '$paymentServer/ride/driverWallet';
|
||||
static String get getAllPassengerTransaction =>
|
||||
"$wallet/getAllPassengerTransaction.php";
|
||||
static String payWithMTNConfirm =
|
||||
static String get payWithMTNConfirm =>
|
||||
"$paymentServer/ride/mtn/driver/confirm_payment.php";
|
||||
static String payWithMTNStart =
|
||||
static String get payWithMTNStart =>
|
||||
"$paymentServer/ride/mtn/driver/mtn_start.php";
|
||||
static String payWithSyriatelConfirm =
|
||||
static String get payWithSyriatelConfirm =>
|
||||
"$paymentServer/ride/syriatel/driver/confirm_payment.php";
|
||||
static String payWithSyriatelStart =
|
||||
static String get payWithSyriatelStart =>
|
||||
"$paymentServer/ride/syriatel/driver/start_payment.php";
|
||||
static String payWithEcashDriver =
|
||||
static String get payWithEcashDriver =>
|
||||
"$paymentServer/ride/ecash/driver/payWithEcash.php";
|
||||
static String payWithEcashPassenger =
|
||||
static String get payWithEcashPassenger =>
|
||||
"$paymentServer/ride/ecash/passenger/payWithEcash.php";
|
||||
// wl.tripz-egypt.com/v1/main/ride/ecash/driver
|
||||
static String getWalletByPassenger = "$wallet/getWalletByPassenger.php";
|
||||
static String getPassengersWallet = "$wallet/get.php";
|
||||
static String getPassengerWalletArchive =
|
||||
static String get getWalletByPassenger => "$wallet/getWalletByPassenger.php";
|
||||
static String get getPassengersWallet => "$wallet/get.php";
|
||||
static String get getPassengerWalletArchive =>
|
||||
"$wallet/getPassengerWalletArchive.php";
|
||||
static String addPassengersWallet = "$wallet/add.php";
|
||||
static String deletePassengersWallet = "$wallet/delete.php";
|
||||
static String updatePassengersWallet = "$wallet/update.php";
|
||||
static String get addPassengersWallet => "$wallet/add.php";
|
||||
static String get deletePassengersWallet => "$wallet/delete.php";
|
||||
static String get updatePassengersWallet => "$wallet/update.php";
|
||||
|
||||
static String getWalletByDriver = "$walletDriver/getWalletByDriver.php";
|
||||
static String driverStatistic =
|
||||
static String get getWalletByDriver => "$walletDriver/getWalletByDriver.php";
|
||||
static String get driverStatistic =>
|
||||
"$endPoint/ride/driverWallet/driverStatistic.php";
|
||||
static String getDriverDetails =
|
||||
static String get getDriverDetails =>
|
||||
"$seferCairoServer/ride/driverWallet/getDriverDetails.php";
|
||||
|
||||
// ================= Gamification Endpoints =================
|
||||
static String getWeeklyAggregate =
|
||||
static String get getWeeklyAggregate =>
|
||||
"$endPoint/ride/gamification/getWeeklyAggregate.php";
|
||||
static String getLeaderboard =
|
||||
static String get getLeaderboard =>
|
||||
"$endPoint/ride/gamification/getLeaderboard.php";
|
||||
static String claimChallengeReward =
|
||||
static String get claimChallengeReward =>
|
||||
"$endPoint/ride/gamification/claimChallengeReward.php";
|
||||
static String getReferralStats =
|
||||
static String get getReferralStats =>
|
||||
"$endPoint/ride/gamification/getReferralStats.php";
|
||||
static String getDriverBehavior =
|
||||
static String get getDriverBehavior =>
|
||||
"$endPoint/ride/gamification/getDriverBehavior.php";
|
||||
static String getDriverWeekPaymentMove =
|
||||
static String get getDriverWeekPaymentMove =>
|
||||
"$walletDriver/getDriverWeekPaymentMove.php";
|
||||
static String getDriversWallet = "$walletDriver/get.php";
|
||||
static String addDriversWalletPoints = "$walletDriver/add.php";
|
||||
static String addpromotionDriver = "$walletDriver/promotionDriver.php";
|
||||
static String deleteDriversWallet = "$walletDriver/delete.php";
|
||||
static String updateDriversWallet = "$walletDriver/update.php";
|
||||
static String get getDriversWallet => "$walletDriver/get.php";
|
||||
static String get addDriversWalletPoints => "$walletDriver/add.php";
|
||||
static String get addpromotionDriver => "$walletDriver/promotionDriver.php";
|
||||
static String get deleteDriversWallet => "$walletDriver/delete.php";
|
||||
static String get updateDriversWallet => "$walletDriver/update.php";
|
||||
|
||||
//=======================promo===================ride.mobile-app.store/ride/promo/get.php
|
||||
static String promo = '$server/ride/promo';
|
||||
static String getPassengersPromo = "$promo/get.php";
|
||||
static String getPromoBytody = "$promo/getPromoBytody.php";
|
||||
static String addPassengersPromo = "$promo/add.php";
|
||||
static String deletePassengersPromo = "$promo/delete.php";
|
||||
static String updatePassengersPromo = "$promo/update.php";
|
||||
static String get promo => '$server/ride/promo';
|
||||
static String get getPassengersPromo => "$promo/get.php";
|
||||
static String get getPromoBytody => "$promo/getPromoBytody.php";
|
||||
static String get addPassengersPromo => "$promo/add.php";
|
||||
static String get deletePassengersPromo => "$promo/delete.php";
|
||||
static String get updatePassengersPromo => "$promo/update.php";
|
||||
|
||||
////=======================cancelRide===================
|
||||
|
||||
static String addCancelRideFromPassenger = "$rideServer/cancelRide/add.php";
|
||||
static String addCancelTripFromDriverAfterApplied =
|
||||
static String get addCancelRideFromPassenger => "$rideServer/cancelRide/add.php";
|
||||
static String get addCancelTripFromDriverAfterApplied =>
|
||||
"$rideServer/cancelRide/addCancelTripFromDriverAfterApplied.php";
|
||||
static String cancelRide = "$rideServer/cancelRide/get.php";
|
||||
static String get cancelRide => "$rideServer/cancelRide/get.php";
|
||||
//-----------------ridessss------------------
|
||||
static String addRides = "$rideServer/rides/add.php";
|
||||
static String getRides = "$rideServer/rides/get.php";
|
||||
static String getPlacesSyria = "$rideServer/places_syria/get.php";
|
||||
static String getMishwari = "$rideServer/mishwari/get.php";
|
||||
static String getMishwariDriver = "$rideServer/mishwari/getDriver.php";
|
||||
static String sendChatMessage = "$server/ride/chat/send_message.php";
|
||||
static String getTripCountByCaptain =
|
||||
static String get addRides => "$rideServer/rides/add.php";
|
||||
static String get getRides => "$rideServer/rides/get.php";
|
||||
static String get getPlacesSyria => "$rideServer/places_syria/get.php";
|
||||
static String get getMishwari => "$rideServer/mishwari/get.php";
|
||||
static String get getMishwariDriver => "$rideServer/mishwari/getDriver.php";
|
||||
static String get sendChatMessage => "$server/ride/chat/send_message.php";
|
||||
static String get getTripCountByCaptain =>
|
||||
"$rideServer/rides/getTripCountByCaptain.php";
|
||||
static String getRideOrderID = "$rideServer/rides/getRideOrderID.php";
|
||||
static String getRideStatus = "$rideServer/rides/getRideStatus.php";
|
||||
static String getOverLayStatus = "$ride/overLay/get.php";
|
||||
static String getArgumentAfterAppliedFromBackground =
|
||||
static String get getRideOrderID => "$rideServer/rides/getRideOrderID.php";
|
||||
static String get getRideStatus => "$rideServer/rides/getRideStatus.php";
|
||||
static String get getOverLayStatus => "$ride/overLay/get.php";
|
||||
static String get getArgumentAfterAppliedFromBackground =>
|
||||
"$ride/overLay/getArgumentAfterAppliedFromBackground.php";
|
||||
static String addOverLayStatus = "$ride/overLay/add.php";
|
||||
static String getapiKey = "$ride/apiKey/get.php";
|
||||
static String get addOverLayStatus => "$ride/overLay/add.php";
|
||||
static String get getapiKey => "$ride/apiKey/get.php";
|
||||
|
||||
static String getapiKeySefer = "$ride/apiKey/get.php";
|
||||
static String getRideStatusBegin = "$rideServer/rides/getRideStatusBegin.php";
|
||||
static String getRideStatusFromStartApp =
|
||||
static String get getapiKeySefer => "$ride/apiKey/get.php";
|
||||
static String get getRideStatusBegin => "$rideServer/rides/getRideStatusBegin.php";
|
||||
static String get getRideStatusFromStartApp =>
|
||||
"$rideServer/rides/getRideStatusFromStartApp.php";
|
||||
static String updateRides = "$rideServer/rides/update.php";
|
||||
static String updateRideAndCheckIfApplied =
|
||||
static String get updateRides => "$rideServer/rides/update.php";
|
||||
static String get updateRideAndCheckIfApplied =>
|
||||
"$rideServer/rides/updateRideAndCheckIfApplied.php";
|
||||
static String updateStausFromSpeed =
|
||||
static String get updateStausFromSpeed =>
|
||||
"$rideServer/rides/updateStausFromSpeed.php";
|
||||
static String deleteRides = "$rideServer/rides/delete.php";
|
||||
static String get deleteRides => "$rideServer/rides/delete.php";
|
||||
|
||||
//-----------------DriverPayment------------------
|
||||
static String addDriverScam = "$ride/driver_scam/add.php";
|
||||
static String getDriverScam = "$ride/driver_scam/get.php";
|
||||
static String get addDriverScam => "$ride/driver_scam/add.php";
|
||||
static String get getDriverScam => "$ride/driver_scam/get.php";
|
||||
|
||||
/////////---getKazanPercent===////////////
|
||||
static String getKazanPercent = "$ride/kazan/get.php";
|
||||
static String addKazanPercent = "$ride/kazan/add.php";
|
||||
static String get getKazanPercent => "$ride/kazan/get.php";
|
||||
static String get addKazanPercent => "$ride/kazan/add.php";
|
||||
|
||||
////-----------------DriverPayment------------------
|
||||
static String addDrivePayment = "$paymentServer/ride/payment/add.php";
|
||||
static String payWithPayMobCardDriver =
|
||||
static String get addDrivePayment => "$paymentServer/ride/payment/add.php";
|
||||
static String get payWithPayMobCardDriver =>
|
||||
"$paymentServer/ride/payMob/paymob_driver/payWithCard.php";
|
||||
static String payWithWallet =
|
||||
static String get payWithWallet =>
|
||||
"$paymentServer/ride/payMob/paymob_driver/payWithWallet.php";
|
||||
static String paymetVerifyDriver =
|
||||
static String get paymetVerifyDriver =>
|
||||
"$paymentServer/ride/payMob/paymob_driver/paymet_verfy.php";
|
||||
static String updatePaymetToPaid =
|
||||
static String get updatePaymetToPaid =>
|
||||
"$paymentServer/ride/payment/updatePaymetToPaid.php";
|
||||
static String paymobPayoutDriverWallet =
|
||||
static String get paymobPayoutDriverWallet =>
|
||||
"$paymentServer/ride/payMob/paymob_driver/paymob_payout.php'";
|
||||
|
||||
static String addSeferWallet = "$paymentServer/ride/seferWallet/add.php";
|
||||
static String getSeferWallet = "$paymentServer/ride/seferWallet/get.php";
|
||||
static String addDriverPaymentPoints =
|
||||
static String get addSeferWallet => "$paymentServer/ride/seferWallet/add.php";
|
||||
static String get getSeferWallet => "$paymentServer/ride/seferWallet/get.php";
|
||||
static String get addDriverPaymentPoints =>
|
||||
"$paymentServer/ride/driverPayment/add.php";
|
||||
static String addPaymentTokenDriver =
|
||||
static String get addPaymentTokenDriver =>
|
||||
"$paymentServer/ride/driverWallet/addPaymentToken.php"; //driverWallet/addPaymentToken.php
|
||||
static String addPaymentTokenPassenger =
|
||||
static String get addPaymentTokenPassenger =>
|
||||
"$paymentServer/ride/passengerWallet/addPaymentTokenPassenger.php";
|
||||
static String getDriverPaymentPoints =
|
||||
static String get getDriverPaymentPoints =>
|
||||
"$paymentServer/ride/driverWallet/get.php";
|
||||
static String getDriverPaymentToday = "$paymentServer/ride/payment/get.php";
|
||||
static String getCountRide = "$rideServer/payment/getCountRide.php";
|
||||
static String getAllPaymentFromRide =
|
||||
static String get getDriverPaymentToday => "$paymentServer/ride/payment/get.php";
|
||||
static String get getCountRide => "$rideServer/payment/getCountRide.php";
|
||||
static String get getAllPaymentFromRide =>
|
||||
"$paymentServer/ride/payment/getAllPayment.php";
|
||||
static String getAllPaymentVisa =
|
||||
static String get getAllPaymentVisa =>
|
||||
"$paymentServer/ride/payment/getAllPaymentVisa.php";
|
||||
|
||||
//-----------------Passenger NotificationCaptain------------------
|
||||
static String addNotificationPassenger =
|
||||
static String get addNotificationPassenger =>
|
||||
"$ride/notificationPassenger/add.php";
|
||||
static String getNotificationPassenger =
|
||||
static String get getNotificationPassenger =>
|
||||
"$ride/notificationPassenger/get.php";
|
||||
static String updateNotificationPassenger =
|
||||
static String get updateNotificationPassenger =>
|
||||
"$ride/notificationPassenger/update.php";
|
||||
//-----------------Driver NotificationCaptain------------------
|
||||
static String addNotificationCaptain = "$ride/notificationCaptain/add.php";
|
||||
static String addWaitingRide = "$ride/notificationCaptain/addWaitingRide.php";
|
||||
static String deleteAvailableRide =
|
||||
static String get addNotificationCaptain => "$ride/notificationCaptain/add.php";
|
||||
static String get addWaitingRide => "$ride/notificationCaptain/addWaitingRide.php";
|
||||
static String get deleteAvailableRide =>
|
||||
"$ride/notificationCaptain/deleteAvailableRide.php";
|
||||
static String updateWaitingRide =
|
||||
static String get updateWaitingRide =>
|
||||
"$ride/notificationCaptain/updateWaitingTrip.php";
|
||||
static String getRideWaiting =
|
||||
static String get getRideWaiting =>
|
||||
"$endPoint/ride/notificationCaptain/getRideWaiting.php";
|
||||
static String getNotificationCaptain = "$ride/notificationCaptain/get.php";
|
||||
static String updateNotificationCaptain =
|
||||
static String get getNotificationCaptain => "$ride/notificationCaptain/get.php";
|
||||
static String get updateNotificationCaptain =>
|
||||
"$ride/notificationCaptain/update.php";
|
||||
static String deleteNotificationCaptain =
|
||||
static String get deleteNotificationCaptain =>
|
||||
"$ride/notificationCaptain/delete.php";
|
||||
//-----------------Api Key------------------
|
||||
static String addApiKey = "$ride/apiKey/add.php";
|
||||
static String getApiKey = "$ride/apiKey/get.php";
|
||||
static String getCnMap = "$server/auth/cnMap.php";
|
||||
static String getPromptDriverDocumentsEgypt =
|
||||
static String get addApiKey => "$ride/apiKey/add.php";
|
||||
static String get getApiKey => "$ride/apiKey/get.php";
|
||||
static String get getCnMap => "$server/auth/cnMap.php";
|
||||
static String get getPromptDriverDocumentsEgypt =>
|
||||
"$server/auth/captin/getPromptDriverDocumentsEgypt.php";
|
||||
|
||||
static String updateApiKey = "$ride/apiKey/update.php";
|
||||
static String deleteApiKey = "$ride/apiKey/delete.php";
|
||||
static String checkPhoneNumberISVerfiedDriver =
|
||||
static String get updateApiKey => "$ride/apiKey/update.php";
|
||||
static String get deleteApiKey => "$ride/apiKey/delete.php";
|
||||
static String get checkPhoneNumberISVerfiedDriver =>
|
||||
"$auth/checkPhoneNumberISVerfiedDriver.php";
|
||||
static String getTesterApp = "$auth/Tester/getTesterApp.php";
|
||||
static String updateTesterApp = "$auth/Tester/updateTesterApp.php";
|
||||
static String get getTesterApp => "$auth/Tester/getTesterApp.php";
|
||||
static String get updateTesterApp => "$auth/Tester/updateTesterApp.php";
|
||||
|
||||
//-----------------healthInsuranceProvider------------------
|
||||
static String addHealthInsuranceProvider = "$server/driver_assurance/add.php";
|
||||
static String getHealthInsuranceProvider = "$server/driver_assurance/get.php";
|
||||
static String get addHealthInsuranceProvider => "$server/driver_assurance/add.php";
|
||||
static String get getHealthInsuranceProvider => "$server/driver_assurance/get.php";
|
||||
|
||||
//-----------------Feed Back------------------
|
||||
static String addFeedBack = "$ride/feedBack/add.php";
|
||||
static String getFeedBack = "$ride/feedBack/get.php";
|
||||
static String updateFeedBack = "$ride/feedBack/updateFeedBack.php";
|
||||
static String add_solve_all = "$server/ride/feedBack/add_solve_all.php";
|
||||
static String uploadAudio = "$server/upload_audio.php";
|
||||
static String get addFeedBack => "$ride/feedBack/add.php";
|
||||
static String get getFeedBack => "$ride/feedBack/get.php";
|
||||
static String get updateFeedBack => "$ride/feedBack/updateFeedBack.php";
|
||||
static String get add_solve_all => "$server/ride/feedBack/add_solve_all.php";
|
||||
static String get uploadAudio => "$server/upload_audio.php";
|
||||
|
||||
//-----------------Tips------------------
|
||||
static String addTips = "$ride/tips/add.php";
|
||||
static String getTips = "$ride/tips/get.php";
|
||||
static String updateTips = "$ride/tips/update.php";
|
||||
static String get addTips => "$ride/tips/add.php";
|
||||
static String get getTips => "$ride/tips/get.php";
|
||||
static String get updateTips => "$ride/tips/update.php";
|
||||
|
||||
//-----------------Help Center------------------
|
||||
static String addhelpCenter = "$ride/helpCenter/add.php";
|
||||
static String gethelpCenter = "$ride/helpCenter/get.php";
|
||||
static String getByIdhelpCenter = "$ride/helpCenter/getById.php";
|
||||
static String updatehelpCenter = "$ride/helpCenter/update.php";
|
||||
static String deletehelpCenter = "$ride/helpCenter/delete.php";
|
||||
static String get addhelpCenter => "$ride/helpCenter/add.php";
|
||||
static String get gethelpCenter => "$ride/helpCenter/get.php";
|
||||
static String get getByIdhelpCenter => "$ride/helpCenter/getById.php";
|
||||
static String get updatehelpCenter => "$ride/helpCenter/update.php";
|
||||
static String get deletehelpCenter => "$ride/helpCenter/delete.php";
|
||||
|
||||
//-----------------license------------------
|
||||
static String addLicense = "$ride/license/add.php";
|
||||
static String getLicense = "$ride/license/get.php";
|
||||
static String updateLicense = "$ride/license/updateFeedBack.php";
|
||||
static String get addLicense => "$ride/license/add.php";
|
||||
static String get getLicense => "$ride/license/get.php";
|
||||
static String get updateLicense => "$ride/license/updateFeedBack.php";
|
||||
//-----------------RegisrationCar------------------
|
||||
static String addRegisrationCar = "$ride/RegisrationCar/add.php";
|
||||
static String getRegisrationCar = "$endPoint/ride/RegisrationCar/get.php";
|
||||
static String updateRegisrationCar = "$ride/RegisrationCar/update.php";
|
||||
static String makeDefaultCar = "$ride/RegisrationCar/makeDefaultCar.php";
|
||||
static String get addRegisrationCar => "$ride/RegisrationCar/add.php";
|
||||
static String get getRegisrationCar => "$endPoint/ride/RegisrationCar/get.php";
|
||||
static String get updateRegisrationCar => "$ride/RegisrationCar/update.php";
|
||||
static String get makeDefaultCar => "$ride/RegisrationCar/makeDefaultCar.php";
|
||||
|
||||
//-----------------DriverOrder------------------
|
||||
|
||||
static String addDriverOrder = "$ride/driver_order/add.php";
|
||||
static String getDriverOrder = "$ride/driver_order/get.php";
|
||||
static String getOrderCancelStatus =
|
||||
static String get addDriverOrder => "$ride/driver_order/add.php";
|
||||
static String get getDriverOrder => "$ride/driver_order/get.php";
|
||||
static String get getOrderCancelStatus =>
|
||||
"$ride/driver_order/getOrderCancelStatus.php";
|
||||
static String updateDriverOrder = "$ride/driver_order/update.php";
|
||||
static String deleteDriverOrder = "$ride/driver_order/delete.php";
|
||||
static String get updateDriverOrder => "$ride/driver_order/update.php";
|
||||
static String get deleteDriverOrder => "$ride/driver_order/delete.php";
|
||||
|
||||
// =====================================
|
||||
static String addRateToPassenger = "$ride/rate/add.php";
|
||||
static String addRateToDriver = "$ride/rate/addRateToDriver.php";
|
||||
static String addRateApp = "$ride/rate/add_rate_app.php";
|
||||
static String sendEmailRateingApp = "$ride/rate/sendEmailRateingApp.php";
|
||||
static String getDriverRate = "$ride/rate/getDriverRate.php";
|
||||
static String getPassengerRate = "$ride/rate/getPassengerRate.php";
|
||||
static String get addRateToPassenger => "$ride/rate/add.php";
|
||||
static String get addRateToDriver => "$ride/rate/addRateToDriver.php";
|
||||
static String get addRateApp => "$ride/rate/add_rate_app.php";
|
||||
static String get sendEmailRateingApp => "$ride/rate/sendEmailRateingApp.php";
|
||||
static String get getDriverRate => "$ride/rate/getDriverRate.php";
|
||||
static String get getPassengerRate => "$ride/rate/getPassengerRate.php";
|
||||
|
||||
////////////////emails ============//
|
||||
static String sendEmailToPassengerForTripDetails =
|
||||
static String get sendEmailToPassengerForTripDetails =>
|
||||
"$ride/rides/emailToPassengerTripDetail.php";
|
||||
static String sendEmailToDrivertransaction =
|
||||
static String get sendEmailToDrivertransaction =>
|
||||
"$server/Admin/sendEmailToDrivertransaction.php";
|
||||
// ===========================================
|
||||
static String pathImage = "$server/upload/types/";
|
||||
static String uploadImage = "$server/uploadImage.php";
|
||||
static String uploadImage1 = "$server/uploadImage1.php";
|
||||
static String uploadImagePortrate = "$server/uploadImagePortrate.php";
|
||||
static String uploadSyrianDocs = "$syria/auth/syria/uploadSyrianDocs.php";
|
||||
static String uploadImageType = "$server/uploadImageType.php";
|
||||
static String get pathImage => "$server/upload/types/";
|
||||
static String get uploadImage => "$server/uploadImage.php";
|
||||
static String get uploadImage1 => "$server/uploadImage1.php";
|
||||
static String get uploadImagePortrate => "$server/uploadImagePortrate.php";
|
||||
static String get uploadSyrianDocs => "$syria/auth/syria/uploadSyrianDocs.php";
|
||||
static String get uploadImageType => "$server/uploadImageType.php";
|
||||
//=============egypt documents ==============
|
||||
static String uploadEgyptidFront =
|
||||
static String get uploadEgyptidFront =>
|
||||
"$server/EgyptDocuments/uploadEgyptidFront.php";
|
||||
static String uploadEgypt = "$server/uploadEgypt.php";
|
||||
static String uploadEgypt1 = "$server/uploadEgypt1.php";
|
||||
static String get uploadEgypt => "$server/uploadEgypt.php";
|
||||
static String get uploadEgypt1 => "$server/uploadEgypt1.php";
|
||||
|
||||
//==================certifcate==========
|
||||
// static String location = '$endPoint/ride/location';
|
||||
|
||||
static String getCarsLocationByPassenger = "$locationServer/get.php";
|
||||
static String addpassengerLocation =
|
||||
static String get getCarsLocationByPassenger => "$locationServer/get.php";
|
||||
static String get addpassengerLocation =>
|
||||
"$locationServer/addpassengerLocation.php";
|
||||
static String getLocationAreaLinks =
|
||||
static String get getLocationAreaLinks =>
|
||||
"$locationServer/get_location_area_links.php";
|
||||
static String getLatestLocationPassenger =
|
||||
static String get getLatestLocationPassenger =>
|
||||
"$locationServer/getLatestLocationPassenger.php";
|
||||
static String getFemalDriverLocationByPassenger =
|
||||
static String get getFemalDriverLocationByPassenger =>
|
||||
"$locationServer/getFemalDriver.php";
|
||||
static String getDriverCarsLocationToPassengerAfterApplied =
|
||||
static String get getDriverCarsLocationToPassengerAfterApplied =>
|
||||
"$locationServer/getDriverCarsLocationToPassengerAfterApplied.php";
|
||||
static String addCarsLocationByPassenger = "$locationServer/add.php";
|
||||
static String saveBehavior = "$locationServer/save_behavior.php";
|
||||
static String addCarsLocationGizaEndpoint = "$locationServer/add.php";
|
||||
static String addCarsLocationAlexandriaEndpoint = "$locationServer/add.php";
|
||||
static String addCarsLocationCairoEndpoint = "$locationServer/add.php";
|
||||
static String deleteCarsLocationByPassenger = "$locationServer/delete.php";
|
||||
static String updateCarsLocationByPassenger = "$locationServer/update.php";
|
||||
static String getTotalDriverDuration =
|
||||
static String get addCarsLocationByPassenger => "$locationServer/add.php";
|
||||
static String get saveBehavior => "$locationServer/save_behavior.php";
|
||||
static String get addCarsLocationGizaEndpoint => "$locationServer/add.php";
|
||||
static String get addCarsLocationAlexandriaEndpoint => "$locationServer/add.php";
|
||||
static String get addCarsLocationCairoEndpoint => "$locationServer/add.php";
|
||||
static String get deleteCarsLocationByPassenger => "$locationServer/delete.php";
|
||||
static String get updateCarsLocationByPassenger => "$locationServer/update.php";
|
||||
static String get getTotalDriverDuration =>
|
||||
"$locationServer/getTotalDriverDuration.php";
|
||||
static String getRidesDriverByDay = "$locationServer/getRidesDriverByDay.php";
|
||||
static String getTotalDriverDurationToday =
|
||||
static String get getRidesDriverByDay => "$locationServer/getRidesDriverByDay.php";
|
||||
static String get getTotalDriverDurationToday =>
|
||||
"$locationServer/getTotalDriverDurationToday.php";
|
||||
|
||||
//==================get_driver_behavior.php=============
|
||||
static String get_driver_behavior =
|
||||
static String get get_driver_behavior =>
|
||||
'$ride/driver_behavior/get_driver_behavior.php';
|
||||
|
||||
//==================cars new drivers=============
|
||||
static String addNewCarsDrivers = '$ride/carDrivers/add.php';
|
||||
static String getNewCarsDrivers = '$ride/carDrivers/get.php';
|
||||
static String deleteNewCarsDrivers = '$ride/carDrivers/delete.php';
|
||||
static String get addNewCarsDrivers => '$ride/carDrivers/add.php';
|
||||
static String get getNewCarsDrivers => '$ride/carDrivers/get.php';
|
||||
static String get deleteNewCarsDrivers => '$ride/carDrivers/delete.php';
|
||||
|
||||
//==================Blog=============
|
||||
static String profile = '$ride/profile';
|
||||
static String getprofile = "$profile/get.php";
|
||||
static String getCaptainProfile = "$profile/getCaptainProfile.php";
|
||||
static String addprofile = "$profile/add.php";
|
||||
static String deleteprofile = "$profile/delete.php";
|
||||
static String updateprofile = "$profile/update.php";
|
||||
static String updateDriverEmail = "$profile/updateDriverEmail.php";
|
||||
static String get profile => '$ride/profile';
|
||||
static String get getprofile => "$profile/get.php";
|
||||
static String get getCaptainProfile => "$profile/getCaptainProfile.php";
|
||||
static String get addprofile => "$profile/add.php";
|
||||
static String get deleteprofile => "$profile/delete.php";
|
||||
static String get updateprofile => "$profile/update.php";
|
||||
static String get updateDriverEmail => "$profile/updateDriverEmail.php";
|
||||
|
||||
//===================Auth============
|
||||
|
||||
static String getUnifiedCode = "$ride/invitor/get_unified_code.php";
|
||||
static String addUnifiedInvite = "$ride/invitor/add_unified_invite.php";
|
||||
static String claimDriverReward = "$ride/invitor/claim_driver_reward.php";
|
||||
static String getDriverReferrals = "$ride/invitor/get_driver_referrals.php";
|
||||
static String get getUnifiedCode => "$ride/invitor/get_unified_code.php";
|
||||
static String get addUnifiedInvite => "$ride/invitor/add_unified_invite.php";
|
||||
static String get claimDriverReward => "$ride/invitor/claim_driver_reward.php";
|
||||
static String get getDriverReferrals => "$ride/invitor/get_driver_referrals.php";
|
||||
|
||||
static String addInviteDriver = "$ride/invitor/add.php";
|
||||
static String addInvitationPassenger =
|
||||
static String get addInviteDriver => "$ride/invitor/add.php";
|
||||
static String get addInvitationPassenger =>
|
||||
"$ride/invitor/addInvitationPassenger.php";
|
||||
static String getInviteDriver = "$ride/invitor/get.php";
|
||||
static String getDriverInvitationToPassengers =
|
||||
static String get getInviteDriver => "$ride/invitor/get.php";
|
||||
static String get getDriverInvitationToPassengers =>
|
||||
"$ride/invitor/getDriverInvitationToPassengers.php";
|
||||
static String updateInviteDriver = "$ride/invitor/update.php";
|
||||
static String updatePassengerGift = "$ride/invitor/updatePassengerGift.php";
|
||||
static String updateInvitationCodeFromRegister =
|
||||
static String get updateInviteDriver => "$ride/invitor/update.php";
|
||||
static String get updatePassengerGift =>
|
||||
"$server/ride/invitor/updatePassengerGift.php";
|
||||
static String get claimInviteReward => "$server/ride/invitor/claim.php";
|
||||
static String get updateInvitationCodeFromRegister =>
|
||||
"$ride/invitor/updateInvitationCodeFromRegister.php";
|
||||
static String register_driver_and_car =
|
||||
static String get register_driver_and_car =>
|
||||
"$auth/syria/driver/register_driver_and_car.php";
|
||||
static String updateDriverInvitationDirectly =
|
||||
static String get updateDriverInvitationDirectly =>
|
||||
"$ride/invitor/updateDriverInvitationDirectly.php";
|
||||
static String updatePassengersInvitation =
|
||||
static String get updatePassengersInvitation =>
|
||||
"$ride/invitor/updatePassengersInvitation.php";
|
||||
|
||||
//===================Auth============
|
||||
|
||||
static String auth = '$server/auth';
|
||||
static String login = "$auth/login.php";
|
||||
static String signUp = "$auth/signup.php";
|
||||
static String updateDriverClaim = "$auth/captin/updateDriverClaim.php";
|
||||
static String updateShamCashDriver = "$auth/captin/updateShamCashDriver.php";
|
||||
static String sendVerifyEmail = "$auth/sendVerifyEmail.php";
|
||||
static String passengerRemovedAccountEmail =
|
||||
static String get auth => '$server/auth';
|
||||
static String get login => "$auth/login.php";
|
||||
static String get signUp => "$auth/signup.php";
|
||||
static String get updateDriverClaim => "$auth/captin/updateDriverClaim.php";
|
||||
static String get updateShamCashDriver => "$auth/captin/updateShamCashDriver.php";
|
||||
static String get sendVerifyEmail => "$auth/sendVerifyEmail.php";
|
||||
static String get passengerRemovedAccountEmail =>
|
||||
"$auth/passengerRemovedAccountEmail.php";
|
||||
static String verifyEmail = "$auth/verifyEmail.php";
|
||||
static String get verifyEmail => "$auth/verifyEmail.php";
|
||||
//===================Auth Captin============
|
||||
static String authCaptin = '$server/auth/captin';
|
||||
static String loginCaptin = "$authCaptin/login.php";
|
||||
static String loginFromGoogleCaptin = "$authCaptin/loginFromGoogle.php";
|
||||
static String loginUsingCredentialsWithoutGoogle =
|
||||
static String get authCaptin => '$server/auth/captin';
|
||||
static String get loginCaptin => "$authCaptin/login.php";
|
||||
static String get loginFromGoogleCaptin => "$authCaptin/loginFromGoogle.php";
|
||||
static String get loginUsingCredentialsWithoutGoogle =>
|
||||
"$authCaptin/loginUsingCredentialsWithoutGoogle.php";
|
||||
static String packageInfo = "$server/auth/packageInfo.php";
|
||||
static String signUpCaptin = "$authCaptin/register.php";
|
||||
static String addCriminalDocuments = "$authCaptin/addCriminalDocuments.php";
|
||||
static String sendVerifyEmailCaptin = "$authCaptin/sendVerifyEmail.php";
|
||||
static String sendVerifyOtpMessage =
|
||||
static String get packageInfo => "$server/auth/packageInfo.php";
|
||||
static String get signUpCaptin => "$authCaptin/register.php";
|
||||
static String get addCriminalDocuments => "$authCaptin/addCriminalDocuments.php";
|
||||
static String get sendVerifyEmailCaptin => "$authCaptin/sendVerifyEmail.php";
|
||||
static String get sendVerifyOtpMessage =>
|
||||
"$server/auth/captin/sendOtpMessageDriver.php";
|
||||
static String verifyOtpMessage = "$server/auth/verifyOtpMessage.php";
|
||||
static String verifyOtpDriver = "$server/auth/captin/verifyOtpDriver.php";
|
||||
static String verifyEmailCaptin = "$authCaptin/verifyEmail.php";
|
||||
static String removeUser = "$authCaptin/removeAccount.php";
|
||||
static String deletecaptainAccounr = "$authCaptin/deletecaptainAccounr.php";
|
||||
static String updateAccountBank = "$authCaptin/updateAccountBank.php";
|
||||
static String getAccount = "$authCaptin/getAccount.php";
|
||||
static String uploadImageToAi = "$auth/document_syria/ai_document.php";
|
||||
static String isPhoneVerified = "$auth/syria/driver/isPhoneVerified.php";
|
||||
static String get verifyOtpMessage => "$server/auth/verifyOtpMessage.php";
|
||||
static String get verifyOtpDriver => "$server/auth/captin/verifyOtpDriver.php";
|
||||
static String get verifyEmailCaptin => "$authCaptin/verifyEmail.php";
|
||||
static String get removeUser => "$authCaptin/removeAccount.php";
|
||||
static String get deletecaptainAccounr => "$authCaptin/deletecaptainAccounr.php";
|
||||
static String get updateAccountBank => "$authCaptin/updateAccountBank.php";
|
||||
static String get getAccount => "$authCaptin/getAccount.php";
|
||||
static String get uploadImageToAi => "$auth/document_syria/ai_document.php";
|
||||
static String get isPhoneVerified => "$auth/syria/driver/isPhoneVerified.php";
|
||||
|
||||
//===================Admin Captin============
|
||||
|
||||
static String getPassengerDetailsByPassengerID =
|
||||
static String get getPassengerDetailsByPassengerID =>
|
||||
"$server/Admin/getPassengerDetailsByPassengerID.php";
|
||||
static String getPassengerDetails = "$server/Admin/getPassengerDetails.php";
|
||||
static String getPassengerbyEmail = "$server/Admin/getPassengerbyEmail.php";
|
||||
static String addAdminUser = "$server/Admin/adminUser/add.php";
|
||||
static String addError = "$server/Admin/errorApp.php";
|
||||
static String getAdminUser = "$server/Admin/adminUser/get.php";
|
||||
static String getCaptainDetailsByEmailOrIDOrPhone =
|
||||
static String get getPassengerDetails => "$server/Admin/getPassengerDetails.php";
|
||||
static String get getPassengerbyEmail => "$server/Admin/getPassengerbyEmail.php";
|
||||
static String get addAdminUser => "$server/Admin/adminUser/add.php";
|
||||
static String get addError => "$server/Admin/errorApp.php";
|
||||
static String get getAdminUser => "$server/Admin/adminUser/get.php";
|
||||
static String get getCaptainDetailsByEmailOrIDOrPhone =>
|
||||
"$server/Admin/AdminCaptain/getCaptainDetailsByEmailOrIDOrPhone.php";
|
||||
static String getCaptainDetails = "$server/Admin/AdminCaptain/get.php";
|
||||
static String getRidesPerMonth =
|
||||
static String get getCaptainDetails => "$server/Admin/AdminCaptain/get.php";
|
||||
static String get getRidesPerMonth =>
|
||||
"$server/Admin/AdminRide/getRidesPerMonth.php";
|
||||
static String getRidesDetails = "$server/Admin/AdminRide/get.php";
|
||||
static String get getRidesDetails => "$server/Admin/AdminRide/get.php";
|
||||
|
||||
//////////Sms egypt///////////
|
||||
static String sendSms = "https://sms.kazumi.me/api/sms/send-sms";
|
||||
static String senddlr = "https://sms.kazumi.me/api/sms/send-dlr";
|
||||
static String sendvalidity = "https://sms.kazumi.me/api/sms/send-validity";
|
||||
static String sendmany = "https://sms.kazumi.me/api/sms/send-many";
|
||||
static String checkCredit = "https://sms.kazumi.me/api/sms/check-credit";
|
||||
static String checkStatus = "https://sms.kazumi.me/api/sms/check-status";
|
||||
static String getSender = "$server/auth/sms/getSender.php";
|
||||
static String updatePhoneInvalidSMS =
|
||||
static String get sendSms => "https://sms.kazumi.me/api/sms/send-sms";
|
||||
static String get senddlr => "https://sms.kazumi.me/api/sms/send-dlr";
|
||||
static String get sendvalidity => "https://sms.kazumi.me/api/sms/send-validity";
|
||||
static String get sendmany => "https://sms.kazumi.me/api/sms/send-many";
|
||||
static String get checkCredit => "https://sms.kazumi.me/api/sms/check-credit";
|
||||
static String get checkStatus => "https://sms.kazumi.me/api/sms/check-status";
|
||||
static String get getSender => "$server/auth/sms/getSender.php";
|
||||
static String get updatePhoneInvalidSMS =>
|
||||
"$server/auth/sms/updatePhoneInvalidSMS.php";
|
||||
|
||||
//////////////service///////////
|
||||
|
||||
static String serviceApp = "$server/serviceapp";
|
||||
static String getComplaintAllData = "$serviceApp/getComplaintAllData.php";
|
||||
static String getComplaintAllDataForDriver =
|
||||
static String get serviceApp => "$server/serviceapp";
|
||||
static String get getComplaintAllData => "$serviceApp/getComplaintAllData.php";
|
||||
static String get getComplaintAllDataForDriver =>
|
||||
"$serviceApp/getComplaintAllDataForDriver.php";
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:siro_driver/constant/currency.dart';
|
||||
import 'dart:convert';
|
||||
import 'dart:developer';
|
||||
|
||||
@@ -10,6 +11,8 @@ import 'package:siro_driver/constant/box_name.dart';
|
||||
import 'package:siro_driver/constant/links.dart';
|
||||
import 'package:siro_driver/controller/functions/crud.dart';
|
||||
import 'package:siro_driver/controller/home/payment/captain_wallet_controller.dart';
|
||||
import 'package:siro_driver/print.dart';
|
||||
import 'package:siro_driver/controller/functions/country_logic.dart';
|
||||
import 'package:siro_driver/main.dart';
|
||||
import 'package:siro_driver/views/widgets/error_snakbar.dart';
|
||||
import 'package:siro_driver/views/widgets/mydialoug.dart';
|
||||
@@ -299,7 +302,7 @@ Download the Siro app now and enjoy your ride!
|
||||
/// **FIX**: Added the missing 'selectPhone' method.
|
||||
void selectPhone(String phone) {
|
||||
// Format the selected phone number and update the text field.
|
||||
invitePhoneController.text = _formatSyrianPhoneNumber(phone);
|
||||
invitePhoneController.text = CountryLogic.formatCurrentCountryPhone(phone);
|
||||
update();
|
||||
Get.back(); // Close the contacts dialog after selection.
|
||||
}
|
||||
@@ -357,30 +360,30 @@ Download the Siro app now and enjoy your ride!
|
||||
if ((driverInvitationData[index]['isGiftToken']).toString() ==
|
||||
'0') {
|
||||
Get.back();
|
||||
await CRUD().post(
|
||||
link: AppLink.updateInviteDriver,
|
||||
payload: {'id': (driverInvitationData[index]['id'])});
|
||||
await Get.find<CaptainWalletController>().addDriverPayment(
|
||||
'paymentMethod',
|
||||
('500'),
|
||||
'',
|
||||
// Server-side claim validation
|
||||
var response = await CRUD().post(
|
||||
link: AppLink.claimInviteReward,
|
||||
payload: {
|
||||
'invite_id': (driverInvitationData[index]['id']).toString(),
|
||||
'driver_id': box.read(BoxName.driverID).toString(),
|
||||
'country_code': box.read(BoxName.countryCode).toString(),
|
||||
}
|
||||
);
|
||||
await Get.find<CaptainWalletController>()
|
||||
.addDriverWalletToInvitor(
|
||||
'paymentMethod',
|
||||
(driverInvitationData[index]['driverInviterId']),
|
||||
('500'),
|
||||
);
|
||||
NotificationCaptainController().addNotificationCaptain(
|
||||
driverInvitationData[index]['driverInviterId'].toString(),
|
||||
"You have got a gift for invitation".tr,
|
||||
'${"You have 500".tr} ${'SYP'.tr}',
|
||||
false);
|
||||
NotificationController().showNotification(
|
||||
"You have got a gift for invitation".tr,
|
||||
'${"You have 500".tr} ${'SYP'.tr}',
|
||||
'tone1',
|
||||
'');
|
||||
|
||||
if (response != 'failure') {
|
||||
var data = jsonDecode(response);
|
||||
if (data['status'] == 'success') {
|
||||
NotificationController().showNotification(
|
||||
"You have got a gift for invitation".tr,
|
||||
'${"You have 500".tr} ${CurrencyHelper.currency}',
|
||||
'tone1',
|
||||
'');
|
||||
// refresh stats
|
||||
fetchDriverStats();
|
||||
} else {
|
||||
mySnackeBarError(data['message'] ?? 'Claim failed'.tr);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Get.back();
|
||||
MyDialog().getDialog("You have got a gift".tr,
|
||||
@@ -440,7 +443,7 @@ Download the Siro app now and enjoy your ride!
|
||||
driverInvitationDataToPassengers[index]['passengerInviterId']
|
||||
.toString(),
|
||||
"You have got a gift for invitation".tr,
|
||||
'${"You have 200".tr} ${'SYP'.tr}',
|
||||
'${"You have 200".tr} ${CurrencyHelper.currency}',
|
||||
false,
|
||||
);
|
||||
} else {
|
||||
@@ -465,47 +468,7 @@ Download the Siro app now and enjoy your ride!
|
||||
);
|
||||
}
|
||||
|
||||
/// Formats a phone number to the standard Syrian international format (+963...).
|
||||
String _formatSyrianPhoneNumber(String input) {
|
||||
String digitsOnly = input.replaceAll(RegExp(r'\D'), '');
|
||||
|
||||
if (digitsOnly.startsWith('09') && digitsOnly.length == 10) {
|
||||
return '963${digitsOnly.substring(1)}';
|
||||
}
|
||||
if (digitsOnly.length == 9 && digitsOnly.startsWith('9')) {
|
||||
return '963$digitsOnly';
|
||||
}
|
||||
return input; // Fallback for unrecognized formats
|
||||
}
|
||||
|
||||
String normalizeSyrianPhone(String input) {
|
||||
String phone = input.trim();
|
||||
|
||||
// احذف كل شيء غير أرقام
|
||||
phone = phone.replaceAll(RegExp(r'[^0-9]'), '');
|
||||
|
||||
// إذا يبدأ بـ 0 → احذفها
|
||||
if (phone.startsWith('0')) {
|
||||
phone = phone.substring(1);
|
||||
}
|
||||
|
||||
// إذا يبدأ بـ 963 مكررة → احذف التكرار
|
||||
while (phone.startsWith('963963')) {
|
||||
phone = phone.substring(3);
|
||||
}
|
||||
|
||||
// إذا يبدأ بـ 963 ولكن داخله كمان 963 → خليه مرة واحدة فقط
|
||||
if (phone.startsWith('963') && phone.length > 12) {
|
||||
phone = phone.substring(phone.length - 9); // آخر 9 أرقام
|
||||
}
|
||||
|
||||
// الآن إذا كان بلا 963 → أضفها
|
||||
if (!phone.startsWith('963')) {
|
||||
phone = '963' + phone;
|
||||
}
|
||||
|
||||
return phone;
|
||||
}
|
||||
// removed normalizeSyrianPhone
|
||||
|
||||
/// Sends an invitation to a potential new driver.
|
||||
void sendInvite() async {
|
||||
@@ -513,9 +476,8 @@ Download the Siro app now and enjoy your ride!
|
||||
mySnackeBarError('Please enter a phone number'.tr);
|
||||
return;
|
||||
}
|
||||
// Format Syrian phone number: remove leading 0 and add +963
|
||||
String formattedPhoneNumber =
|
||||
normalizeSyrianPhone(invitePhoneController.text);
|
||||
CountryLogic.formatCurrentCountryPhone(invitePhoneController.text);
|
||||
if (formattedPhoneNumber.length != 12) {
|
||||
mySnackeBarError('Please enter a correct phone'.tr);
|
||||
return;
|
||||
@@ -553,12 +515,7 @@ Download the Siro app now and enjoy your ride!
|
||||
return;
|
||||
}
|
||||
|
||||
// Format Syrian phone number: remove leading 0 and add +963
|
||||
String formattedPhoneNumber = invitePhoneController.text.trim();
|
||||
if (formattedPhoneNumber.startsWith('0')) {
|
||||
formattedPhoneNumber = formattedPhoneNumber.substring(1);
|
||||
}
|
||||
formattedPhoneNumber = '+963$formattedPhoneNumber';
|
||||
String formattedPhoneNumber = CountryLogic.formatCurrentCountryPhone(invitePhoneController.text);
|
||||
|
||||
if (formattedPhoneNumber.length < 12) {
|
||||
// +963 + 9 digits = 12+
|
||||
|
||||
@@ -4,6 +4,7 @@ import 'package:siro_driver/controller/functions/crud.dart';
|
||||
import 'package:siro_driver/print.dart';
|
||||
import 'package:siro_driver/views/home/on_boarding_page.dart';
|
||||
import 'package:siro_driver/views/widgets/error_snakbar.dart';
|
||||
import 'package:siro_driver/controller/functions/country_logic.dart';
|
||||
|
||||
import '../../../constant/box_name.dart';
|
||||
import '../../../constant/links.dart';
|
||||
@@ -18,69 +19,12 @@ class PhoneAuthHelper {
|
||||
static final String _sendOtpUrl = '${_baseUrl}sendWhatsAppDriver.php';
|
||||
static final String _verifyOtpUrl = '${_baseUrl}verifyOtp.php';
|
||||
static final String _registerUrl = '${_baseUrl}register_driver.php';
|
||||
static String formatSyrianPhone(String phone) {
|
||||
// Remove spaces, symbols, +, -, ()
|
||||
phone = phone.replaceAll(RegExp(r'[ \-\(\)\+]'), '').trim();
|
||||
|
||||
// Normalize 00963 → 963
|
||||
if (phone.startsWith('00963')) {
|
||||
phone = phone.replaceFirst('00963', '963');
|
||||
}
|
||||
|
||||
// Normalize 0963 → 963
|
||||
if (phone.startsWith('0963')) {
|
||||
phone = phone.replaceFirst('0963', '963');
|
||||
}
|
||||
if (phone.startsWith('096309')) {
|
||||
phone = phone.replaceFirst('096309', '963');
|
||||
}
|
||||
|
||||
// NEW: Fix 96309xxxx → 9639xxxx
|
||||
if (phone.startsWith('96309')) {
|
||||
phone = '9639' + phone.substring(5); // remove the "0" after 963
|
||||
}
|
||||
|
||||
// If starts with 9630 → correct to 9639
|
||||
if (phone.startsWith('9630')) {
|
||||
phone = '9639' + phone.substring(4);
|
||||
}
|
||||
|
||||
// If already in correct format: 9639xxxxxxxx
|
||||
if (phone.startsWith('9639') && phone.length == 12) {
|
||||
return phone;
|
||||
}
|
||||
|
||||
// If starts with 963 but missing the 9
|
||||
if (phone.startsWith('963') && phone.length > 3) {
|
||||
// Ensure it begins with 9639
|
||||
if (!phone.startsWith('9639')) {
|
||||
phone = '9639' + phone.substring(3);
|
||||
}
|
||||
return phone;
|
||||
}
|
||||
|
||||
// If starts with 09xxxxxxxx → 9639xxxxxxxx
|
||||
if (phone.startsWith('09')) {
|
||||
return '963' + phone.substring(1);
|
||||
}
|
||||
|
||||
// If 9xxxxxxxx (9 digits)
|
||||
if (phone.startsWith('9') && phone.length == 9) {
|
||||
return '963' + phone;
|
||||
}
|
||||
|
||||
// If starts with incorrect 0xxxxxxx → assume Syrian and fix
|
||||
if (phone.startsWith('0') && phone.length == 10) {
|
||||
return '963' + phone.substring(1);
|
||||
}
|
||||
|
||||
return phone;
|
||||
}
|
||||
// removed formatSyrianPhone
|
||||
|
||||
/// Sends an OTP to the provided phone number.
|
||||
static Future<bool> sendOtp(String phoneNumber) async {
|
||||
try {
|
||||
final fixedPhone = formatSyrianPhone(phoneNumber);
|
||||
final fixedPhone = CountryLogic.formatCurrentCountryPhone(phoneNumber);
|
||||
Log.print('fixedPhone: $fixedPhone');
|
||||
|
||||
final response = await CRUD().post(
|
||||
@@ -112,7 +56,7 @@ class PhoneAuthHelper {
|
||||
/// Verifies the OTP and logs the user in.
|
||||
static Future<void> verifyOtp(String phoneNumber, String otpCode) async {
|
||||
try {
|
||||
final fixedPhone = formatSyrianPhone(phoneNumber);
|
||||
final fixedPhone = CountryLogic.formatCurrentCountryPhone(phoneNumber);
|
||||
Log.print('fixedPhone: $fixedPhone');
|
||||
final response = await CRUD().post(
|
||||
link: _verifyOtpUrl,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:siro_driver/constant/currency.dart';
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
@@ -108,7 +109,7 @@ class NotificationController extends GetxController {
|
||||
|
||||
// تنسيق النص ليكون 4 أسطر واضحة
|
||||
formattedBigText = "👤 $paxName\n"
|
||||
"💰 $price ${'SYP'.tr} | 🛣️ $distance كم\n"
|
||||
"💰 $price ${CurrencyHelper.currency} | 🛣️ $distance كم\n"
|
||||
"🟢 من: $startLoc\n"
|
||||
"🏁 إلى: $endLoc";
|
||||
|
||||
|
||||
94
siro_driver/lib/controller/functions/country_logic.dart
Normal file
94
siro_driver/lib/controller/functions/country_logic.dart
Normal file
@@ -0,0 +1,94 @@
|
||||
import 'package:siro_driver/constant/box_name.dart';
|
||||
import 'package:siro_driver/main.dart';
|
||||
|
||||
class CountryLogic {
|
||||
/// Formats the phone number based on the country's dialing rules.
|
||||
static String formatPhone(String phone, String country) {
|
||||
phone = phone.replaceAll(RegExp(r'[ \-\(\)\+]'), '').trim();
|
||||
|
||||
if (country == 'Egypt') {
|
||||
// Rule: 010, 011, 012, 015 -> 2010, 2011, 2012, 2015
|
||||
if (phone.startsWith('0020')) phone = phone.replaceFirst('0020', '20');
|
||||
if (phone.startsWith('01') && phone.length >= 10) {
|
||||
return '20${phone.substring(1)}';
|
||||
}
|
||||
if (phone.startsWith('1') &&
|
||||
phone.length >= 9 &&
|
||||
!phone.startsWith('20')) {
|
||||
return '20$phone';
|
||||
}
|
||||
if (!phone.startsWith('20') && phone.length > 8) return '20$phone';
|
||||
} else if (country == 'Jordan') {
|
||||
// Rule: 07x -> 9627x
|
||||
if (phone.startsWith('00962')) phone = phone.replaceFirst('00962', '962');
|
||||
if (phone.startsWith('07') && phone.length >= 9) {
|
||||
return '962${phone.substring(1)}';
|
||||
}
|
||||
if (phone.startsWith('7') &&
|
||||
phone.length >= 8 &&
|
||||
!phone.startsWith('962')) {
|
||||
return '962$phone';
|
||||
}
|
||||
if (!phone.startsWith('962') && phone.length > 7) return '962$phone';
|
||||
} else {
|
||||
// Default to Syria
|
||||
if (phone.startsWith('00963')) phone = phone.replaceFirst('00963', '963');
|
||||
if (phone.startsWith('0963')) phone = phone.replaceFirst('0963', '963');
|
||||
if (phone.startsWith('096309')) {
|
||||
phone = phone.replaceFirst('096309', '963');
|
||||
}
|
||||
if (phone.startsWith('96309')) phone = '9639${phone.substring(5)}';
|
||||
if (phone.startsWith('9630')) phone = '9639${phone.substring(4)}';
|
||||
if (phone.startsWith('9639') && phone.length == 12) return phone;
|
||||
if (phone.startsWith('963') &&
|
||||
phone.length > 3 &&
|
||||
!phone.startsWith('9639')) {
|
||||
phone = '9639${phone.substring(3)}';
|
||||
}
|
||||
if (phone.startsWith('09')) return '963${phone.substring(1)}';
|
||||
if (phone.startsWith('9') && phone.length == 9) return '963$phone';
|
||||
if (phone.startsWith('0') && phone.length == 10) {
|
||||
return '963${phone.substring(1)}';
|
||||
}
|
||||
}
|
||||
return phone;
|
||||
}
|
||||
|
||||
/// Returns the default country prefix (EG, JO, SY) for UI initial selection.
|
||||
static String getCountryPrefix(String country) {
|
||||
if (country == 'Egypt') return 'EG';
|
||||
if (country == 'Jordan') return 'JO';
|
||||
return 'SY';
|
||||
}
|
||||
|
||||
/// Returns the default emergency number for the country.
|
||||
static String getEmergencyNumber(String country) {
|
||||
if (country == 'Egypt') return '122';
|
||||
if (country == 'Jordan') return '911';
|
||||
return '112'; // Syria
|
||||
}
|
||||
|
||||
/// Returns the hint text for phone inputs based on the country.
|
||||
static String getPhoneHint(String country) {
|
||||
if (country == 'Egypt') return 'e.g. 01012345678 (Default +20)';
|
||||
if (country == 'Jordan') return 'e.g. 0791234567 (Default +962)';
|
||||
return 'e.g. 0912345678 (Default +963)'; // Syria
|
||||
}
|
||||
|
||||
/// Helper to format phone using the current country in box.
|
||||
static String formatCurrentCountryPhone(String phone) {
|
||||
String cleanPhone = phone.replaceAll(RegExp(r'[ \-\(\)]'), '').trim();
|
||||
if (cleanPhone.startsWith('+963') || cleanPhone.startsWith('00963')) {
|
||||
return formatPhone(cleanPhone, 'Syria');
|
||||
}
|
||||
if (cleanPhone.startsWith('+20') || cleanPhone.startsWith('0020')) {
|
||||
return formatPhone(cleanPhone, 'Egypt');
|
||||
}
|
||||
if (cleanPhone.startsWith('+962') || cleanPhone.startsWith('00962')) {
|
||||
return formatPhone(cleanPhone, 'Jordan');
|
||||
}
|
||||
|
||||
final country = box.read(BoxName.countryCode) ?? 'Syria';
|
||||
return formatPhone(cleanPhone, country);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'dart:io';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:siro_driver/views/widgets/error_snakbar.dart';
|
||||
import 'package:siro_driver/controller/functions/country_logic.dart';
|
||||
|
||||
void showInBrowser(String url) async {
|
||||
if (await canLaunchUrl(Uri.parse(url))) {
|
||||
@@ -10,18 +9,11 @@ void showInBrowser(String url) async {
|
||||
}
|
||||
|
||||
String cleanAndFormatPhoneNumber(String phoneNumber) {
|
||||
// 1. Clean the number
|
||||
String formattedNumber = phoneNumber.replaceAll(RegExp(r'\s+'), '');
|
||||
|
||||
// 2. Format logic (Syria/Egypt/International)
|
||||
if (formattedNumber.length > 6) {
|
||||
if (formattedNumber.startsWith('09')) {
|
||||
formattedNumber = '+963${formattedNumber.substring(1)}';
|
||||
} else if (formattedNumber.startsWith('01') && formattedNumber.length == 11) {
|
||||
formattedNumber = '+20${formattedNumber.substring(1)}';
|
||||
} else if (formattedNumber.startsWith('00')) {
|
||||
formattedNumber = '+${formattedNumber.substring(2)}';
|
||||
} else if (!formattedNumber.startsWith('+')) {
|
||||
formattedNumber = CountryLogic.formatCurrentCountryPhone(formattedNumber);
|
||||
if (!formattedNumber.startsWith('+')) {
|
||||
formattedNumber = '+$formattedNumber';
|
||||
}
|
||||
}
|
||||
@@ -30,11 +22,6 @@ String cleanAndFormatPhoneNumber(String phoneNumber) {
|
||||
|
||||
Future<void> makePhoneCall(String phoneNumber) async {
|
||||
String formattedNumber = cleanAndFormatPhoneNumber(phoneNumber);
|
||||
|
||||
if (!formattedNumber.startsWith('+963')) {
|
||||
mySnackeBarError("Calling non-Syrian numbers is not supported".tr);
|
||||
return;
|
||||
}
|
||||
|
||||
// Create URI directly from String to avoid double encoding '+' as '%2B'
|
||||
final Uri launchUri = Uri.parse('tel:$formattedNumber');
|
||||
@@ -63,10 +50,6 @@ void launchCommunication(
|
||||
if (Platform.isIOS) {
|
||||
switch (method) {
|
||||
case 'phone':
|
||||
if (!formattedContact.startsWith('+963')) {
|
||||
mySnackeBarError("Calling non-Syrian numbers is not supported".tr);
|
||||
return;
|
||||
}
|
||||
url = 'tel:$formattedContact';
|
||||
break;
|
||||
case 'sms':
|
||||
@@ -86,10 +69,6 @@ void launchCommunication(
|
||||
} else if (Platform.isAndroid) {
|
||||
switch (method) {
|
||||
case 'phone':
|
||||
if (!formattedContact.startsWith('+963')) {
|
||||
mySnackeBarError("Calling non-Syrian numbers is not supported".tr);
|
||||
return;
|
||||
}
|
||||
url = 'tel:$formattedContact';
|
||||
break;
|
||||
case 'sms':
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:siro_driver/constant/currency.dart';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:siro_driver/constant/links.dart';
|
||||
@@ -35,7 +36,7 @@ Future<void> showDriverGiftClaim(BuildContext context) async {
|
||||
if (box.read(BoxName.is_claimed).toString() == '0' ||
|
||||
box.read(BoxName.is_claimed) == null) {
|
||||
MyDialog().getDialog(
|
||||
'You have gift 300 SYP'.tr, 'This for new registration'.tr, () async {
|
||||
'You have gift 300 ${CurrencyHelper.currency}'.tr, 'This for new registration'.tr, () async {
|
||||
Get.back();
|
||||
var res = await CRUD().post(link: AppLink.updateDriverClaim, payload: {
|
||||
'driverId': box.read(BoxName.driverID),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:siro_driver/constant/currency.dart';
|
||||
import 'dart:convert';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -97,7 +98,7 @@ class ChallengesController extends GetxController {
|
||||
id: 'daily_earnings',
|
||||
titleEn: 'Money Maker',
|
||||
titleAr: 'صانع المال',
|
||||
descriptionEn: 'Earn 3000 SYP today',
|
||||
descriptionEn: 'Earn 3000 ${CurrencyHelper.currency} today',
|
||||
descriptionAr: 'اربح 3000 ل.س اليوم',
|
||||
icon: Icons.monetization_on_rounded,
|
||||
color: const Color(0xFF4CAF50),
|
||||
@@ -140,7 +141,7 @@ class ChallengesController extends GetxController {
|
||||
id: 'weekly_earnings',
|
||||
titleEn: 'Big Earner',
|
||||
titleAr: 'الربح الكبير',
|
||||
descriptionEn: 'Earn 20,000 SYP this week',
|
||||
descriptionEn: 'Earn 20,000 ${CurrencyHelper.currency} this week',
|
||||
descriptionAr: 'اربح 20,000 ل.س هذا الأسبوع',
|
||||
icon: Icons.account_balance_wallet_rounded,
|
||||
color: const Color(0xFF9C27B0),
|
||||
|
||||
@@ -1395,6 +1395,8 @@ class MyTranslation extends Translations {
|
||||
"SOS Phone": "هاتف الطوارئ",
|
||||
"SUBMIT": "إرسال",
|
||||
"SYP": "ل.س",
|
||||
"EGP": "ج.م",
|
||||
"JOD": "د.أ",
|
||||
"Safety & Security": "السلامة والأمان",
|
||||
"Saudi Arabia": "السعودية",
|
||||
"Save": "حفظ",
|
||||
@@ -2078,7 +2080,11 @@ class MyTranslation extends Translations {
|
||||
"You have finished all times": "خلصت كل الأوقات",
|
||||
"You have gift 300 L.E": "عندك هدية 300 ل.م",
|
||||
"You have gift 300 SYP": "عندك هدية 300 ل.س",
|
||||
"You have gift 300 EGP": "عندك هدية 300 ج.م",
|
||||
"You have gift 300 JOD": "عندك هدية 300 د.أ",
|
||||
"You have gift 30000 SYP": "عندك هدية 30000 ل.س",
|
||||
"You have gift 30000 EGP": "عندك هدية 30000 ج.م",
|
||||
"You have gift 30000 JOD": "عندك هدية 30000 د.أ",
|
||||
"You have got a gift": "وصلتك هدية",
|
||||
"You have got a gift for invitation": "وصلتك هدية للدعوة",
|
||||
"You have in account": "عندك بالحساب",
|
||||
@@ -2608,6 +2614,8 @@ class MyTranslation extends Translations {
|
||||
"Confirm": "تأكيد",
|
||||
"PTS": "نقطة",
|
||||
"SYP": "ل.س",
|
||||
"EGP": "ج.م",
|
||||
"JOD": "د.أ",
|
||||
"You are buying": "أنت تقوم بشراء",
|
||||
"for": "بـ",
|
||||
"Points": "نقاط",
|
||||
@@ -2634,6 +2642,8 @@ class MyTranslation extends Translations {
|
||||
"اختر كيف تريد شحن حسابك",
|
||||
"Add Balance": "إضافة رصيد",
|
||||
"SYP": "ل.س",
|
||||
"EGP": "ج.م",
|
||||
"JOD": "د.أ",
|
||||
"Your completed trips will appear here": "ستظهر رحلاتك المكتملة هنا",
|
||||
"Cancelled by Passenger": "تم الإلغاء بواسطة الراكب",
|
||||
},
|
||||
|
||||
13585
siro_driver/lib/env/env.g.dart
vendored
13585
siro_driver/lib/env/env.g.dart
vendored
File diff suppressed because it is too large
Load Diff
@@ -800,6 +800,8 @@
|
||||
"Select Payment Method": "Select Payment Method",
|
||||
"You are buying": "You are buying",
|
||||
"Points": "SYP",
|
||||
"Points": "EGP",
|
||||
"Points": "JOD",
|
||||
"for": "for",
|
||||
"Use Touch ID or Face ID to confirm payment": "Use Touch ID or Face ID to confirm payment",
|
||||
"Your Budget less than needed": "Your Budget less than needed",
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:siro_driver/constant/currency.dart';
|
||||
import 'package:siro_driver/controller/home/captin/map_driver_controller.dart';
|
||||
import 'package:siro_driver/views/widgets/my_textField.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -113,7 +114,7 @@ class RatePassenger extends StatelessWidget {
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 8.0),
|
||||
child: Text(
|
||||
'SYP'.tr, // Replace with your local currency symbol if needed
|
||||
CurrencyHelper.currency, // Replace with your local currency symbol if needed
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.8),
|
||||
fontSize: 24,
|
||||
|
||||
@@ -10,6 +10,9 @@ import '../../../constant/colors.dart';
|
||||
import '../../../controller/auth/captin/phone_helper_controller.dart';
|
||||
import '../../../controller/local/phone_intel/intl_phone_field.dart';
|
||||
import '../../../print.dart';
|
||||
import '../../../constant/box_name.dart';
|
||||
import '../../../main.dart';
|
||||
import '../../../controller/functions/country_logic.dart';
|
||||
// Assuming you have an AppColor class defined in your project.
|
||||
// import 'path/to/your/app_color.dart';
|
||||
|
||||
@@ -348,7 +351,7 @@ class _PhoneNumberScreenState extends State<PhoneNumberScreen> {
|
||||
const BorderSide(color: AppColor.greenColor, width: 2),
|
||||
),
|
||||
),
|
||||
initialCountryCode: 'SY',
|
||||
initialCountryCode: CountryLogic.getCountryPrefix(box.read(BoxName.countryCode) ?? 'Syria'),
|
||||
onChanged: (phone) {
|
||||
_completePhone = phone.completeNumber;
|
||||
},
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:siro_driver/constant/currency.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../../../constant/finance_design_system.dart';
|
||||
@@ -244,7 +245,7 @@ class LeaderboardPage extends StatelessWidget {
|
||||
// Value
|
||||
Text(
|
||||
isEarnings
|
||||
? '${e.value.toStringAsFixed(0)} ${'SYP'.tr}'
|
||||
? '${e.value.toStringAsFixed(0)} ${CurrencyHelper.currency}'
|
||||
: '${e.value.toInt()} ${'Rides'.tr}',
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:siro_driver/constant/currency.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
@@ -314,7 +315,7 @@ class _TripHistoryCard extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
'${trip['price']} ${'SYP'.tr}',
|
||||
'${trip['price']} ${CurrencyHelper.currency}',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w900,
|
||||
fontSize: 16,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:siro_driver/constant/currency.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
@@ -70,7 +71,7 @@ Widget driverEndRideBar() {
|
||||
value: NumberFormat('#,##0').format(
|
||||
double.tryParse(controller.price.toString()) ?? 0,
|
||||
),
|
||||
unit: 'SYP'.tr,
|
||||
unit: CurrencyHelper.currency,
|
||||
label: isFixed ? 'Fixed Price'.tr : 'Meter Fare'.tr,
|
||||
isHighlight: true,
|
||||
isFixedStyle: isFixed,
|
||||
|
||||
@@ -288,7 +288,13 @@ class MyDropDownSyria extends StatelessWidget {
|
||||
onChanged: (String? newValue) {
|
||||
controller.changeValue(newValue);
|
||||
},
|
||||
items: <String>['Syriatel', 'Cash Mobile', 'Sham Cash']
|
||||
items: (box.read(BoxName.countryCode) == 'Syria'
|
||||
? <String>['Syriatel', 'MTN Cash', 'Sham Cash']
|
||||
: box.read(BoxName.countryCode) == 'Egypt'
|
||||
? <String>['Wallet Payment', 'Bank Card Payment']
|
||||
: box.read(BoxName.countryCode) == 'Jordan'
|
||||
? <String>['CliQ']
|
||||
: <String>['Bank Transfer', 'Mobile Wallet'])
|
||||
.map<DropdownMenuItem<String>>((String value) {
|
||||
return DropdownMenuItem<String>(
|
||||
value: value,
|
||||
@@ -302,7 +308,13 @@ class MyDropDownSyria extends StatelessWidget {
|
||||
|
||||
// هذا المتحكم ضروري لعمل القائمة المنسدلة
|
||||
class SyrianPayoutController extends GetxController {
|
||||
String dropdownValue = 'Syriatel';
|
||||
String dropdownValue = box.read(BoxName.countryCode) == 'Syria'
|
||||
? 'Syriatel'
|
||||
: box.read(BoxName.countryCode) == 'Egypt'
|
||||
? 'Wallet Payment'
|
||||
: box.read(BoxName.countryCode) == 'Jordan'
|
||||
? 'CliQ'
|
||||
: 'Bank Transfer';
|
||||
|
||||
void changeValue(String? newValue) {
|
||||
if (newValue != null) {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:siro_driver/constant/currency.dart';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -17,6 +18,7 @@ import '../../../main.dart';
|
||||
import '../../../print.dart';
|
||||
import '../../widgets/elevated_btn.dart';
|
||||
import '../../widgets/my_textField.dart';
|
||||
import '../../widgets/mydialoug.dart';
|
||||
import 'ecash.dart';
|
||||
|
||||
class PointsCaptain extends StatelessWidget {
|
||||
@@ -77,7 +79,7 @@ class PointsCaptain extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
'$countPoint ${'SYP'.tr}',
|
||||
'$countPoint ${CurrencyHelper.currency}',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w900,
|
||||
fontSize: 15,
|
||||
@@ -86,7 +88,7 @@ class PointsCaptain extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
'${'Price:'.tr} ${pricePoint.toStringAsFixed(0)} ${'SYP'.tr}',
|
||||
'${'Price:'.tr} ${pricePoint.toStringAsFixed(0)} ${CurrencyHelper.currency}',
|
||||
style: TextStyle(
|
||||
fontSize: 11,
|
||||
color: Colors.grey.shade600,
|
||||
@@ -130,47 +132,93 @@ class PointsCaptain extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text("${'Amount to charge:'.tr} $countPoint ${'SYP'.tr}",
|
||||
Text(
|
||||
"${'Amount to charge:'.tr} $countPoint ${CurrencyHelper.currency}",
|
||||
style: FinanceDesignSystem.subHeadingStyle),
|
||||
const SizedBox(height: 24),
|
||||
_buildPaymentMethodTile(
|
||||
icon: Icons.credit_card_rounded,
|
||||
title: 'Debit Card'.tr,
|
||||
subtitle: 'E-Cash payment gateway'.tr,
|
||||
color: Colors.blue,
|
||||
onTap: () {
|
||||
Get.back();
|
||||
payWithEcashDriver(context, pricePoint.toString());
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
_buildPaymentMethodTile(
|
||||
image: 'assets/images/syriatel.jpeg',
|
||||
title: 'Syriatel Cash'.tr,
|
||||
subtitle: 'Pay using Syriatel mobile wallet'.tr,
|
||||
color: Colors.red,
|
||||
onTap: () => _showPhoneInputDialog(context, 'Syriatel'),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
_buildPaymentMethodTile(
|
||||
image: 'assets/images/shamCash.png',
|
||||
title: 'Sham Cash'.tr,
|
||||
subtitle: 'Pay using Sham Cash wallet'.tr,
|
||||
color: Colors.orange,
|
||||
onTap: () async {
|
||||
Get.back();
|
||||
bool isAuthSupported =
|
||||
await LocalAuthentication().isDeviceSupported();
|
||||
if (isAuthSupported) {
|
||||
bool didAuthenticate =
|
||||
await LocalAuthentication().authenticate(
|
||||
localizedReason: 'Confirm payment with biometrics'.tr,
|
||||
);
|
||||
if (!didAuthenticate) return;
|
||||
}
|
||||
Get.to(() => PaymentScreenSmsProvider(amount: pricePoint));
|
||||
},
|
||||
),
|
||||
if (box.read(BoxName.countryCode) == 'Syria') ...[
|
||||
_buildPaymentMethodTile(
|
||||
icon: Icons.credit_card_rounded,
|
||||
title: 'Debit Card'.tr,
|
||||
subtitle: 'E-Cash payment gateway'.tr,
|
||||
color: Colors.blue,
|
||||
onTap: () {
|
||||
Get.back();
|
||||
payWithEcashDriver(context, pricePoint.toString());
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
_buildPaymentMethodTile(
|
||||
image: 'assets/images/syriatel.jpeg',
|
||||
title: 'Syriatel Cash'.tr,
|
||||
subtitle: 'Pay using Syriatel mobile wallet'.tr,
|
||||
color: Colors.red,
|
||||
onTap: () => _showPhoneInputDialog(context, 'Syriatel'),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
_buildPaymentMethodTile(
|
||||
image: 'assets/images/shamCash.png',
|
||||
title: 'Sham Cash'.tr,
|
||||
subtitle: 'Pay using Sham Cash wallet'.tr,
|
||||
color: Colors.orange,
|
||||
onTap: () async {
|
||||
Get.back();
|
||||
bool isAuthSupported =
|
||||
await LocalAuthentication().isDeviceSupported();
|
||||
if (isAuthSupported) {
|
||||
bool didAuthenticate =
|
||||
await LocalAuthentication().authenticate(
|
||||
localizedReason: 'Confirm payment with biometrics'.tr,
|
||||
);
|
||||
if (!didAuthenticate) return;
|
||||
}
|
||||
Get.to(() => PaymentScreenSmsProvider(amount: pricePoint));
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
_buildPaymentMethodTile(
|
||||
image: 'assets/images/cashMTN.png',
|
||||
title: 'MTN Cash'.tr,
|
||||
subtitle: 'Pay using MTN Cash wallet'.tr,
|
||||
color: Colors.yellow.shade700,
|
||||
onTap: () => _showPhoneInputDialog(context, 'MTN'),
|
||||
),
|
||||
],
|
||||
if (box.read(BoxName.countryCode) == 'Jordan') ...[
|
||||
_buildPaymentMethodTile(
|
||||
icon: Icons.qr_code_scanner_rounded,
|
||||
title: 'CliQ'.tr,
|
||||
subtitle: 'Pay via CliQ (Alias: siroapp)'.tr,
|
||||
color: Colors.purple,
|
||||
onTap: () {
|
||||
Get.back();
|
||||
MyDialog().getDialog(
|
||||
'CliQ Payment'.tr,
|
||||
'Please transfer the amount to alias: siroapp'.tr,
|
||||
() => Get.back());
|
||||
},
|
||||
),
|
||||
],
|
||||
if (box.read(BoxName.countryCode) == 'Egypt') ...[
|
||||
_buildPaymentMethodTile(
|
||||
icon: Icons.account_balance_wallet_rounded,
|
||||
title: 'Wallet Payment'.tr,
|
||||
subtitle: 'Mobile Wallets'.tr,
|
||||
color: Colors.red,
|
||||
onTap: () => _showPhoneInputDialog(context, 'PaymobWallet'),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
_buildPaymentMethodTile(
|
||||
icon: Icons.credit_card_rounded,
|
||||
title: 'Bank Card Payment'.tr,
|
||||
subtitle: 'Card Payment'.tr,
|
||||
color: Colors.blue,
|
||||
onTap: () {
|
||||
Get.back();
|
||||
// Navigate to Paymob card payment
|
||||
},
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -267,9 +315,10 @@ class PointsCaptain extends StatelessWidget {
|
||||
paymentController.walletphoneController.text);
|
||||
if (provider == 'Syriatel') {
|
||||
await payWithSyriaTelWallet(
|
||||
context, pricePoint.toString(), 'SYP');
|
||||
context, pricePoint.toString(), CurrencyHelper.currency);
|
||||
} else {
|
||||
await payWithMTNWallet(context, pricePoint.toString(), 'SYP');
|
||||
await payWithMTNWallet(
|
||||
context, pricePoint.toString(), CurrencyHelper.currency);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:siro_driver/constant/currency.dart';
|
||||
import 'package:local_auth/local_auth.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -171,7 +172,7 @@ class WalletCaptainRefactored extends StatelessWidget {
|
||||
?['morning_count'] ??
|
||||
0,
|
||||
targetProgress: 5,
|
||||
reward: "+50 SYP",
|
||||
reward: "+50 ${CurrencyHelper.currency}",
|
||||
onTap: () =>
|
||||
controller.addDriverWalletFromPromo('Morning Promo', 50),
|
||||
),
|
||||
@@ -183,7 +184,7 @@ class WalletCaptainRefactored extends StatelessWidget {
|
||||
?['afternoon_count'] ??
|
||||
0,
|
||||
targetProgress: 5,
|
||||
reward: "+50 SYP",
|
||||
reward: "+50 ${CurrencyHelper.currency}",
|
||||
onTap: () => controller.addDriverWalletFromPromo(
|
||||
'Afternoon Promo', 50),
|
||||
),
|
||||
@@ -408,7 +409,13 @@ Future<dynamic> addSyrianPaymentMethod(
|
||||
}
|
||||
|
||||
class SyrianPayoutController extends GetxController {
|
||||
String dropdownValue = 'syriatel';
|
||||
String dropdownValue = box.read(BoxName.countryCode) == 'Syria'
|
||||
? 'syriatel'
|
||||
: box.read(BoxName.countryCode) == 'Egypt'
|
||||
? 'wallet payment'
|
||||
: box.read(BoxName.countryCode) == 'Jordan'
|
||||
? 'cliq'
|
||||
: 'bank transfer';
|
||||
void changeValue(String? newValue) {
|
||||
if (newValue != null) {
|
||||
dropdownValue = newValue;
|
||||
@@ -433,7 +440,13 @@ class MyDropDownSyria extends StatelessWidget {
|
||||
style: TextStyle(color: theme.textTheme.bodyLarge?.color),
|
||||
underline: Container(height: 2, color: theme.primaryColor),
|
||||
onChanged: (String? newValue) => controller.changeValue(newValue),
|
||||
items: <String>['syriatel', 'mtn']
|
||||
items: (box.read(BoxName.countryCode) == 'Syria'
|
||||
? <String>['syriatel', 'mtn cash', 'sham cash']
|
||||
: box.read(BoxName.countryCode) == 'Egypt'
|
||||
? <String>['wallet payment', 'bank card payment']
|
||||
: box.read(BoxName.countryCode) == 'Jordan'
|
||||
? <String>['cliq']
|
||||
: <String>['bank transfer', 'wallet'])
|
||||
.map<DropdownMenuItem<String>>((String value) {
|
||||
return DropdownMenuItem<String>(value: value, child: Text(value.tr));
|
||||
}).toList(),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:siro_driver/constant/currency.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -127,7 +128,7 @@ class WeeklyPaymentPage extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
color: Colors.white.withValues(alpha: 0.8), fontSize: 14)),
|
||||
const SizedBox(height: 8),
|
||||
Text('${earnings.toStringAsFixed(0)} SYP',
|
||||
Text('${earnings.toStringAsFixed(0)} ${CurrencyHelper.currency}',
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 36,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:siro_driver/constant/currency.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../../../../constant/finance_design_system.dart';
|
||||
@@ -88,7 +89,7 @@ class BalanceCard extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
"SYP".tr,
|
||||
CurrencyHelper.currency,
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.7),
|
||||
fontSize: 18,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:siro_driver/constant/currency.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../../../../constant/finance_design_system.dart';
|
||||
@@ -92,7 +93,7 @@ class FinancialSummaryCard extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
"${item.amount} ${'SYP'.tr}",
|
||||
"${item.amount} ${CurrencyHelper.currency}",
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:siro_driver/constant/currency.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../../../../constant/finance_design_system.dart';
|
||||
@@ -103,7 +104,7 @@ class TransactionPreviewItem extends StatelessWidget {
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Text(
|
||||
"${isCredit ? '+' : '-'}$amount ${'SYP'.tr}",
|
||||
"${isCredit ? '+' : '-'}$amount ${CurrencyHelper.currency}",
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:siro_driver/constant/currency.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../../../../constant/finance_design_system.dart';
|
||||
@@ -115,7 +116,7 @@ class DailyGoalWidget extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
Text(
|
||||
'/ ${controller.dailyGoal.toStringAsFixed(0)} ${'SYP'.tr}',
|
||||
'/ ${controller.dailyGoal.toStringAsFixed(0)} ${CurrencyHelper.currency}',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w500,
|
||||
@@ -205,7 +206,7 @@ class DailyGoalWidget extends StatelessWidget {
|
||||
)
|
||||
else
|
||||
Text(
|
||||
'${'Remaining:'.tr} ${(controller.dailyGoal - controller.dailyEarnings).clamp(0, double.infinity).toStringAsFixed(0)} ${'SYP'.tr}',
|
||||
'${'Remaining:'.tr} ${(controller.dailyGoal - controller.dailyEarnings).clamp(0, double.infinity).toStringAsFixed(0)} ${CurrencyHelper.currency}',
|
||||
style: TextStyle(
|
||||
fontSize: 11,
|
||||
color: FinanceDesignSystem.textSecondary,
|
||||
@@ -248,7 +249,7 @@ class DailyGoalWidget extends StatelessWidget {
|
||||
),
|
||||
decoration: InputDecoration(
|
||||
hintText: '5000',
|
||||
suffixText: 'SYP'.tr,
|
||||
suffixText: CurrencyHelper.currency,
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: BorderSide(color: FinanceDesignSystem.borderColor),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:siro_driver/constant/currency.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
@@ -35,7 +36,7 @@ class MonthlyChartWidget extends StatelessWidget {
|
||||
Row(children: [
|
||||
_summaryTile(
|
||||
'Total Earnings'.tr,
|
||||
'${sc.monthlyTotalEarnings.toStringAsFixed(0)} ${'SYP'.tr}',
|
||||
'${sc.monthlyTotalEarnings.toStringAsFixed(0)} ${CurrencyHelper.currency}',
|
||||
FinanceDesignSystem.successGreen),
|
||||
const SizedBox(width: 12),
|
||||
_summaryTile('Total Trips'.tr, '${sc.monthlyTotalTrips}',
|
||||
@@ -58,7 +59,7 @@ class MonthlyChartWidget extends StatelessWidget {
|
||||
touchTooltipData: LineTouchTooltipData(
|
||||
getTooltipItems: (spots) => spots
|
||||
.map((s) => LineTooltipItem(
|
||||
'${s.y.toStringAsFixed(0)} ${'SYP'.tr}',
|
||||
'${s.y.toStringAsFixed(0)} ${CurrencyHelper.currency}',
|
||||
const TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:siro_driver/constant/currency.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:siro_driver/controller/home/captin/home_captain_controller.dart';
|
||||
@@ -38,7 +39,7 @@ class TodayChartWidget extends StatelessWidget {
|
||||
_buildRow(
|
||||
Icons.monetization_on_rounded,
|
||||
'Earnings'.tr,
|
||||
'${hc.totalMoneyToday} ${'SYP'.tr}',
|
||||
'${hc.totalMoneyToday} ${CurrencyHelper.currency}',
|
||||
FinanceDesignSystem.successGreen),
|
||||
const Divider(height: 24),
|
||||
_buildRow(Icons.local_taxi_rounded, 'Rides'.tr, hc.countRideToday,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:siro_driver/constant/currency.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
@@ -39,7 +40,7 @@ class WeeklyChartWidget extends StatelessWidget {
|
||||
color: FinanceDesignSystem.successGreen.withOpacity(0.1),
|
||||
borderRadius: BorderRadius.circular(12)),
|
||||
child: Text(
|
||||
'${sc.weeklyEarnings.toStringAsFixed(0)} ${'SYP'.tr}',
|
||||
'${sc.weeklyEarnings.toStringAsFixed(0)} ${CurrencyHelper.currency}',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -73,7 +74,7 @@ class WeeklyChartWidget extends StatelessWidget {
|
||||
touchTooltipData: BarTouchTooltipData(
|
||||
getTooltipItem: (group, gi, rod, ri) =>
|
||||
BarTooltipItem(
|
||||
'${rod.toY.toStringAsFixed(0)} ${'SYP'.tr}',
|
||||
'${rod.toY.toStringAsFixed(0)} ${CurrencyHelper.currency}',
|
||||
const TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:siro_driver/constant/currency.dart';
|
||||
import 'dart:convert';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -145,7 +146,7 @@ class RideAvailableCard extends StatelessWidget {
|
||||
children: [
|
||||
Text('Price'.tr, style: AppStyle.subtitle.copyWith(fontSize: 12)),
|
||||
Text(
|
||||
'${rideInfo['price']} ${'SYP'.tr}', // العملة
|
||||
'${rideInfo['price']} ${CurrencyHelper.currency}', // العملة
|
||||
style: AppStyle.title.copyWith(
|
||||
fontSize: 20, color: AppColor.primaryColor, height: 1.2),
|
||||
),
|
||||
|
||||
5
siro_rider/.gitignore
vendored
5
siro_rider/.gitignore
vendored
@@ -43,3 +43,8 @@ app.*.map.json
|
||||
/android/app/debug
|
||||
/android/app/profile
|
||||
/android/app/release
|
||||
|
||||
# Sensitive keys & environment files
|
||||
key.properties
|
||||
*.env
|
||||
**/lib/env/env.g.dart
|
||||
|
||||
15
siro_rider/lib/constant/currency.dart
Normal file
15
siro_rider/lib/constant/currency.dart
Normal file
@@ -0,0 +1,15 @@
|
||||
import 'package:siro_rider/main.dart';
|
||||
import 'package:siro_rider/constant/box_name.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class CurrencyHelper {
|
||||
static String get currency {
|
||||
String country = box.read(BoxName.countryCode) ?? 'Jordan';
|
||||
switch (country) {
|
||||
case 'Syria': return 'SYP'.tr;
|
||||
case 'Egypt': return 'EGP'.tr;
|
||||
case 'Jordan':
|
||||
default: return 'JOD'.tr;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,293 +4,318 @@ import 'package:siro_rider/main.dart';
|
||||
class AppLink {
|
||||
static const String appDomain = 'siromove.com';
|
||||
///https://walletintaleq.intaleq.xyz/v1/main
|
||||
static String paymentServer = 'https://walletintaleq.intaleq.xyz/v2/main';
|
||||
static String get paymentServer => 'https://walletintaleq.intaleq.xyz/v2/main';
|
||||
|
||||
///https://api.intaleq.xyz/siro/ride/location
|
||||
static String location = 'https://api.intaleq.xyz/siro_v3/ride/location';
|
||||
static String get location => 'https://api.intaleq.xyz/siro_v3/ride/location';
|
||||
|
||||
/// هذا الرابط خاص برحلات الركاب، ويستخدمه السيرفر الجانبي للرحلات (Ride Server Side) للتعامل مع عمليات إلغاء الرحلات وتحديث حالة الرحلات وغيرها من العمليات المتعلقة بالرحلات.
|
||||
/// https://routesy.intaleq.xyz for syria
|
||||
/// for jordan https://routesjo.intaleq.xyz
|
||||
static String routesOsm = 'https://routesy.intaleq.xyz';
|
||||
static String mapSaasRoute = 'https://map-saas.intaleqapp.com/api/maps/route';
|
||||
static String reverseGeocoding =
|
||||
static String get routesOsm => 'https://routesy.intaleq.xyz';
|
||||
static String get mapSaasRoute => 'https://map-saas.intaleqapp.com/api/maps/route';
|
||||
static String get reverseGeocoding =>
|
||||
'https://map-saas.intaleqapp.com/api/geocoding/reverse';
|
||||
static String searchGeocoding =
|
||||
static String get searchGeocoding =>
|
||||
'https://map-saas.intaleqapp.com/api/geocoding/search';
|
||||
static String mapSaasPlaces =
|
||||
static String get mapSaasPlaces =>
|
||||
'https://map-saas.intaleqapp.com/api/geocoding/places';
|
||||
|
||||
///https://location.intaleq.xyz/siro/ride/location
|
||||
///locationServerSide هو السيرفر الجانبي الخاص بموقع السائقين، حيث يتم إرسال تحديثات الموقع من التطبيق إلى هذا السيرفر، ومن ثم يقوم هذا السيرفر بتوزيع هذه التحديثات إلى الركاب المتصلين الذين يتابعون السائق في الوقت الحقيقي.
|
||||
static String locationServerSide =
|
||||
static String get locationServerSide =>
|
||||
'https://location.intaleq.xyz/siro/ride/location';
|
||||
|
||||
static String get currentCountry => box.read(BoxName.countryCode) ?? 'Jordan';
|
||||
|
||||
///https://api.intaleq.xyz/siro
|
||||
static final String endPoint = 'https://api.intaleq.xyz/siro_v3';
|
||||
static String get endPoint => server;
|
||||
|
||||
/// هذا الرابط خاص برحلات الركاب، ويستخدمه السيرفر الجانبي للرحلات (Ride Server Side) للتعامل مع عمليات إلغاء الرحلات وتحديث حالة الرحلات وغيرها من العمليات المتعلقة بالرحلات.
|
||||
/// https://rides.intaleq.xyz/siro
|
||||
static final String rideServerSide = 'https://rides.intaleq.xyz/siro';
|
||||
static String get rideServerSide => 'https://rides.intaleq.xyz/siro';
|
||||
|
||||
///https://api.intaleq.xyz/siro
|
||||
/// main api link for all api calls except rides and location
|
||||
static final String server = 'https://api.intaleq.xyz/siro_v3';
|
||||
static String get server {
|
||||
switch (currentCountry) {
|
||||
case 'Syria':
|
||||
return 'https://api-syria.siromove.com/siro_v3';
|
||||
case 'Egypt':
|
||||
return 'https://api-egypt.siromove.com/siro_v3';
|
||||
case 'Jordan':
|
||||
default:
|
||||
return 'https://api-jordan.siromove.com/siro_v3';
|
||||
}
|
||||
}
|
||||
|
||||
///https://rides.intaleq.xyz
|
||||
/// هذا الرابط خاص برحلات الركاب، ويستخدمه السيرفر الجانبي للرحلات (Ride Server Side) للتعامل مع عمليات إلغاء الرحلات وتحديث حالة الرحلات وغيرها من العمليات المتعلقة بالرحلات.
|
||||
static final String serverSocket = 'https://rides.intaleq.xyz';
|
||||
static String get serverSocket => 'https://rides.intaleq.xyz';
|
||||
|
||||
///
|
||||
static String googleMapsLink = 'https://maps.googleapis.com/maps/api/';
|
||||
static String get googleMapsLink => 'https://maps.googleapis.com/maps/api/';
|
||||
|
||||
/// here map link for searching for places
|
||||
static String searcMaps =
|
||||
static String get searcMaps =>
|
||||
'https://autosuggest.search.hereapi.com/v1/autosuggest';
|
||||
|
||||
static String test = "$server/test.php";
|
||||
static String get test => "$server/test.php";
|
||||
//===============firebase==========================
|
||||
static String getTokens = "$server/ride/firebase/getTokensPassenger.php";
|
||||
static String getTokenParent = "$server/ride/firebase/getTokenParent.php";
|
||||
static String addTokens = "$server/ride/firebase/add.php";
|
||||
static String addFingerPrint = "$paymentServer/ride/firebase/add.php";
|
||||
static String addTokensDriver = "$server/ride/firebase/addDriver.php";
|
||||
static String packageInfo = "$server/auth/packageInfo.php";
|
||||
static String get getTokens => "$server/ride/firebase/getTokensPassenger.php";
|
||||
static String get getTokenParent => "$server/ride/firebase/getTokenParent.php";
|
||||
static String get addTokens => "$server/ride/firebase/add.php";
|
||||
static String get addFingerPrint => "$paymentServer/ride/firebase/add.php";
|
||||
static String get addTokensDriver => "$server/ride/firebase/addDriver.php";
|
||||
static String get packageInfo => "$server/auth/packageInfo.php";
|
||||
|
||||
//=======================Wallet===================
|
||||
static String wallet = '$paymentServer/ride/passengerWallet';
|
||||
static String walletDriver = '$paymentServer/ride/driverWallet';
|
||||
static String getAllPassengerTransaction =
|
||||
static String get wallet => '$paymentServer/ride/passengerWallet';
|
||||
static String get walletDriver => '$paymentServer/ride/driverWallet';
|
||||
static String get getAllPassengerTransaction =>
|
||||
"$wallet/getAllPassengerTransaction.php";
|
||||
static String getWalletByPassenger = "$wallet/getWalletByPassenger.php";
|
||||
static String getPassengersWallet = "$wallet/get.php";
|
||||
static String payWithPayMobWalletPasenger =
|
||||
static String get getWalletByPassenger => "$wallet/getWalletByPassenger.php";
|
||||
static String get getPassengersWallet => "$wallet/get.php";
|
||||
static String get payWithPayMobWalletPasenger =>
|
||||
'$paymentServer/ride/payMob/wallet/payWithPayMob.php';
|
||||
static String payWithPayMobCardPassenger =
|
||||
static String get payWithPayMobCardPassenger =>
|
||||
'$paymentServer/ride/payMob/payWithPayMob.php';
|
||||
static String payWithEcash = "$paymentServer/ecash/payWithEcash.php";
|
||||
static String get payWithEcash => "$paymentServer/ecash/payWithEcash.php";
|
||||
|
||||
static String paymetVerifyPassenger =
|
||||
static String get paymetVerifyPassenger =>
|
||||
"$paymentServer/ride/payMob/paymet_verfy.php";
|
||||
static String getPassengerWalletArchive =
|
||||
static String get getPassengerWalletArchive =>
|
||||
"$wallet/getPassengerWalletArchive.php";
|
||||
|
||||
static String addDrivePayment = "$paymentServer/ride/payment/add.php";
|
||||
static String addSeferWallet = "$paymentServer/ride/seferWallet/add.php";
|
||||
static String addPassengersWallet = "$wallet/add.php";
|
||||
static String deletePassengersWallet = "$wallet/delete.php";
|
||||
static String updatePassengersWallet = "$wallet/update.php";
|
||||
static String get addDrivePayment => "$paymentServer/ride/payment/add.php";
|
||||
static String get addSeferWallet => "$paymentServer/ride/seferWallet/add.php";
|
||||
static String get addPassengersWallet => "$wallet/add.php";
|
||||
static String get deletePassengersWallet => "$wallet/delete.php";
|
||||
static String get updatePassengersWallet => "$wallet/update.php";
|
||||
|
||||
static String getWalletByDriver = "$walletDriver/getWalletByDriver.php";
|
||||
static String getDriversWallet = "$walletDriver/get.php";
|
||||
static String addDriversWalletPoints = "$walletDriver/add.php";
|
||||
static String deleteDriversWallet = "$walletDriver/delete.php";
|
||||
static String updateDriversWallet = "$walletDriver/update.php";
|
||||
static String get getWalletByDriver => "$walletDriver/getWalletByDriver.php";
|
||||
static String get getDriversWallet => "$walletDriver/get.php";
|
||||
static String get addDriversWalletPoints => "$walletDriver/add.php";
|
||||
static String get deleteDriversWallet => "$walletDriver/delete.php";
|
||||
static String get updateDriversWallet => "$walletDriver/update.php";
|
||||
|
||||
//=======================promo===================ride.mobile-app.store/ride/promo/get.php
|
||||
static String promo = '$server/ride/promo';
|
||||
static String getPassengersPromo = "$promo/get.php";
|
||||
static String getPromoFirst = "$promo/getPromoFirst.php";
|
||||
static String getPromoBytody = "$promo/getPromoBytody.php";
|
||||
static String addPassengersPromo = "$promo/add.php";
|
||||
static String deletePassengersPromo = "$promo/delete.php";
|
||||
static String updatePassengersPromo = "$promo/update.php";
|
||||
static String get promo => '$server/ride/promo';
|
||||
static String get getPassengersPromo => "$promo/get.php";
|
||||
static String get getPromoFirst => "$promo/getPromoFirst.php";
|
||||
static String get getPromoBytody => "$promo/getPromoBytody.php";
|
||||
static String get addPassengersPromo => "$promo/add.php";
|
||||
static String get deletePassengersPromo => "$promo/delete.php";
|
||||
static String get updatePassengersPromo => "$promo/update.php";
|
||||
|
||||
//===============contact==========================
|
||||
static String savePhones = "$server/ride/egyptPhones/add.php";
|
||||
static String getPhones = "$server/ride/egyptPhones/get.php";
|
||||
static String get savePhones => "$server/ride/egyptPhones/add.php";
|
||||
static String get getPhones => "$server/ride/egyptPhones/get.php";
|
||||
|
||||
////=======================cancelRide===================
|
||||
// static String ride = '$server/ride';
|
||||
static String addCancelRideFromPassenger =
|
||||
static String get addCancelRideFromPassenger =>
|
||||
"$rideServerSide/cancelRide/add.php";
|
||||
static String cancelRide = "$rideServerSide/cancelRide/get.php";
|
||||
static String get cancelRide => "$rideServerSide/cancelRide/get.php";
|
||||
//-----------------ridessss------------------
|
||||
static String addRides = "$rideServerSide/ride/rides/add.php";
|
||||
static String getRides = "$rideServerSide/ride/rides/get.php";
|
||||
static String getRideOrderID =
|
||||
static String get addRides => "$rideServerSide/ride/rides/add.php";
|
||||
static String get getRides => "$rideServerSide/ride/rides/get.php";
|
||||
static String get getRideOrderID =>
|
||||
"$rideServerSide/ride/rides/getRideOrderID.php";
|
||||
static String getRideStatus = "$rideServerSide/ride/rides/getRideStatus.php";
|
||||
static String getRideStatusBegin =
|
||||
static String get getRideStatus => "$rideServerSide/ride/rides/getRideStatus.php";
|
||||
static String get getRideStatusBegin =>
|
||||
"$rideServerSide/ride/rides/getRideStatusBegin.php";
|
||||
static String getRideStatusFromStartApp =
|
||||
static String get getRideStatusFromStartApp =>
|
||||
"$server/ride/rides/getRideStatusFromStartApp.php";
|
||||
static String updateRides = "$rideServerSide/ride/rides/update.php";
|
||||
static String updateStausFromSpeed =
|
||||
static String get updateRides => "$rideServerSide/ride/rides/update.php";
|
||||
static String get updateStausFromSpeed =>
|
||||
"$rideServerSide/ride/rides/updateStausFromSpeed.php";
|
||||
static String deleteRides = "$rideServerSide/ride/rides/delete.php";
|
||||
static String get deleteRides => "$rideServerSide/ride/rides/delete.php";
|
||||
|
||||
//-----------------DriverPayment------------------
|
||||
static String adddriverScam = "$server/driver_scam/add.php";
|
||||
static String getdriverScam = "$server/ride/driver_scam/get.php";
|
||||
static String get adddriverScam => "$server/driver_scam/add.php";
|
||||
static String get getdriverScam => "$server/ride/driver_scam/get.php";
|
||||
|
||||
/////////---getKazanPercent===////////////
|
||||
static String getKazanPercent = "$server/ride/kazan/get.php";
|
||||
static String addKazanPercent = "$server/ride/kazan/add.php";
|
||||
static String get getKazanPercent => "$server/ride/kazan/get.php";
|
||||
static String get addKazanPercent => "$server/ride/kazan/add.php";
|
||||
|
||||
////-----------------DriverPayment------------------
|
||||
static String addDriverpayment = "$paymentServer/ride/payment/add.php";
|
||||
static String addDriverPaymentPoints =
|
||||
static String get addDriverpayment => "$paymentServer/ride/payment/add.php";
|
||||
static String get addDriverPaymentPoints =>
|
||||
"$paymentServer/ride/driverPayment/add.php";
|
||||
static String addPaymentTokenPassenger =
|
||||
static String get addPaymentTokenPassenger =>
|
||||
"$paymentServer/ride/passengerWallet/addPaymentTokenPassenger.php";
|
||||
static String addPaymentTokenDriver =
|
||||
static String get addPaymentTokenDriver =>
|
||||
"$paymentServer/ride/driverWallet/addPaymentToken.php";
|
||||
static String getDriverPaymentPoints =
|
||||
static String get getDriverPaymentPoints =>
|
||||
"$paymentServer/ride/driverWallet/get.php";
|
||||
static String payWithEcashPassenger =
|
||||
static String get payWithEcashPassenger =>
|
||||
"$paymentServer/ride/ecash/passenger/payWithEcash.php";
|
||||
static String payWithMTNConfirm =
|
||||
static String get payWithMTNConfirm =>
|
||||
"$paymentServer/ride/mtn/passenger/mtn_confirm.php";
|
||||
static String payWithMTNStart =
|
||||
static String get payWithMTNStart =>
|
||||
"$paymentServer/ride/mtn/passenger/mtn_start.php";
|
||||
static String payWithSyriatelConfirm =
|
||||
static String get payWithSyriatelConfirm =>
|
||||
"$paymentServer/ride/syriatel/passenger/confirm_payment.php";
|
||||
static String payWithSyriatelStart =
|
||||
static String get payWithSyriatelStart =>
|
||||
"$paymentServer/ride/syriatel/passenger/start_payment.php";
|
||||
static String getDriverpaymentToday = "$paymentServer/ride/payment/get.php";
|
||||
static String getCountRide = "$paymentServer/ride/payment/getCountRide.php";
|
||||
static String getAllPaymentFromRide =
|
||||
static String get getDriverpaymentToday => "$paymentServer/ride/payment/get.php";
|
||||
static String get getCountRide => "$paymentServer/ride/payment/getCountRide.php";
|
||||
static String get getAllPaymentFromRide =>
|
||||
"$paymentServer/ride/payment/getAllPayment.php";
|
||||
static String getAllPaymentVisa =
|
||||
static String get getAllPaymentVisa =>
|
||||
"$paymentServer/ride/payment/getAllPaymentVisa.php";
|
||||
static String get createMtnInvoice =>
|
||||
"$paymentServer/ride/mtn_new/create_mtn_invoice.php";
|
||||
static String get createCliqInvoice =>
|
||||
"$paymentServer/ride/cliq/create_cliq_invoice.php";
|
||||
|
||||
static String get checkMtnStatus => "$paymentServer/ride/mtn_new/check_status.php";
|
||||
static String get checkCliqStatus => "$paymentServer/ride/cliq/check_status.php";
|
||||
static String get uploadMtnProof => "$paymentServer/ride/mtn_new/verify_payment_ai.php";
|
||||
static String get uploadCliqProof => "$paymentServer/ride/cliq/verify_payment_ai.php";
|
||||
|
||||
//-----------------Passenger NotificationCaptain------------------
|
||||
static String addNotificationPassenger =
|
||||
static String get addNotificationPassenger =>
|
||||
"$server/ride/notificationPassenger/add.php";
|
||||
static String getNotificationPassenger =
|
||||
static String get getNotificationPassenger =>
|
||||
"$server/ride/notificationPassenger/get.php";
|
||||
static String updateNotificationPassenger =
|
||||
static String get updateNotificationPassenger =>
|
||||
"$server/ride/notificationPassenger/update.php";
|
||||
//-----------------Driver NotificationCaptain------------------
|
||||
static String addNotificationCaptain =
|
||||
static String get addNotificationCaptain =>
|
||||
"$server/ride/notificationCaptain/add.php";
|
||||
static String addWaitingRide =
|
||||
static String get addWaitingRide =>
|
||||
"$server/ride/notificationCaptain/addWaitingRide.php";
|
||||
static String updateWaitingTrip =
|
||||
static String get updateWaitingTrip =>
|
||||
"$server/ride/notificationCaptain/updateWaitingTrip.php";
|
||||
static String getRideWaiting =
|
||||
static String get getRideWaiting =>
|
||||
"$endPoint/ride/notificationCaptain/getRideWaiting.php";
|
||||
static String getNotificationCaptain =
|
||||
static String get getNotificationCaptain =>
|
||||
"$server/ride/notificationCaptain/get.php";
|
||||
static String updateNotificationCaptain =
|
||||
static String get updateNotificationCaptain =>
|
||||
"$server/ride/notificationCaptain/update.php";
|
||||
static String deleteNotificationCaptain =
|
||||
static String get deleteNotificationCaptain =>
|
||||
"$server/ride/notificationCaptain/delete.php";
|
||||
//-----------------invitor------------------
|
||||
static String getUnifiedCode = "$server/ride/invitor/get_unified_code.php";
|
||||
static String addUnifiedInvite = "$server/ride/invitor/add_unified_invite.php";
|
||||
static String getPassengerReferrals = "$server/ride/invitor/get_passenger_referrals.php";
|
||||
static String addInviteDriver = "$server/ride/invitor/add.php";
|
||||
static String addInvitationPassenger =
|
||||
static String get getUnifiedCode => "$server/ride/invitor/get_unified_code.php";
|
||||
static String get addUnifiedInvite => "$server/ride/invitor/add_unified_invite.php";
|
||||
static String get getPassengerReferrals => "$server/ride/invitor/get_passenger_referrals.php";
|
||||
static String get addInviteDriver => "$server/ride/invitor/add.php";
|
||||
static String get addInvitationPassenger =>
|
||||
"$server/ride/invitor/addInvitationPassenger.php";
|
||||
static String getInviteDriver = "$server/ride/invitor/get.php";
|
||||
static String getDriverInvitationToPassengers =
|
||||
static String get getInviteDriver => "$server/ride/invitor/get.php";
|
||||
static String get getDriverInvitationToPassengers =>
|
||||
"$server/ride/invitor/getDriverInvitationToPassengers.php";
|
||||
static String updateInviteDriver = "$server/ride/invitor/update.php";
|
||||
static String updatePassengerGift =
|
||||
static String get updateInviteDriver => "$server/ride/invitor/update.php";
|
||||
static String get updatePassengerGift =>
|
||||
"$server/ride/invitor/updatePassengerGift.php";
|
||||
static String get claimInviteReward => "$server/ride/invitor/claim.php";
|
||||
//-----------------Api Key------------------
|
||||
static String addApiKey = "$server/ride/apiKey/add.php";
|
||||
static String getApiKey = "$server/ride/apiKey/get.php";
|
||||
static String getCnMap = "$server/auth/cnMap.php";
|
||||
static String updateApiKey = "$server/ride/apiKey/update.php";
|
||||
static String deleteApiKey = "$server/ride/apiKey/delete.php";
|
||||
static String getPlacesSyria = "$server/ride/places_syria/get.php";
|
||||
static String get addApiKey => "$server/ride/apiKey/add.php";
|
||||
static String get getApiKey => "$server/ride/apiKey/get.php";
|
||||
static String get getCnMap => "$server/auth/cnMap.php";
|
||||
static String get updateApiKey => "$server/ride/apiKey/update.php";
|
||||
static String get deleteApiKey => "$server/ride/apiKey/delete.php";
|
||||
static String get getPlacesSyria => "$server/ride/places_syria/get.php";
|
||||
|
||||
//-----------------Feed Back------------------
|
||||
static String addFeedBack = "$server/ride/feedBack/add.php";
|
||||
static String add_solve_all = "$server/ride/feedBack/add_solve_all.php";
|
||||
static String uploadAudio = "$server/ride/feedBack/upload_audio.php";
|
||||
static String getFeedBack = "$server/ride/feedBack/get.php";
|
||||
static String updateFeedBack = "$server/ride/feedBack/updateFeedBack.php";
|
||||
static String get addFeedBack => "$server/ride/feedBack/add.php";
|
||||
static String get add_solve_all => "$server/ride/feedBack/add_solve_all.php";
|
||||
static String get uploadAudio => "$server/ride/feedBack/upload_audio.php";
|
||||
static String get getFeedBack => "$server/ride/feedBack/get.php";
|
||||
static String get updateFeedBack => "$server/ride/feedBack/updateFeedBack.php";
|
||||
|
||||
//-----------------Tips------------------
|
||||
static String addTips = "$server/ride/tips/add.php";
|
||||
static String getTips = "$server/ride/tips/get.php";
|
||||
static String updateTips = "$server/ride/tips/update.php";
|
||||
static String get addTips => "$server/ride/tips/add.php";
|
||||
static String get getTips => "$server/ride/tips/get.php";
|
||||
static String get updateTips => "$server/ride/tips/update.php";
|
||||
|
||||
//-----------------Help Center------------------
|
||||
static String addhelpCenter = "$server/ride/helpCenter/add.php";
|
||||
static String gethelpCenter = "$server/ride/helpCenter/get.php";
|
||||
static String getByIdhelpCenter = "$server/ride/helpCenter/getById.php";
|
||||
static String updatehelpCenter = "$server/ride/helpCenter/update.php";
|
||||
static String deletehelpCenter = "$server/ride/helpCenter/delete.php";
|
||||
static String get addhelpCenter => "$server/ride/helpCenter/add.php";
|
||||
static String get gethelpCenter => "$server/ride/helpCenter/get.php";
|
||||
static String get getByIdhelpCenter => "$server/ride/helpCenter/getById.php";
|
||||
static String get updatehelpCenter => "$server/ride/helpCenter/update.php";
|
||||
static String get deletehelpCenter => "$server/ride/helpCenter/delete.php";
|
||||
|
||||
//-----------------license------------------
|
||||
static String addLicense = "$server/ride/license/add.php";
|
||||
static String getLicense = "$server/ride/license/get.php";
|
||||
static String updateLicense = "$server/ride/license/updateFeedBack.php";
|
||||
static String get addLicense => "$server/ride/license/add.php";
|
||||
static String get getLicense => "$server/ride/license/get.php";
|
||||
static String get updateLicense => "$server/ride/license/updateFeedBack.php";
|
||||
//-----------------RegisrationCar------------------
|
||||
static String addRegisrationCar = "$server/ride/RegisrationCar/add.php";
|
||||
static String getRegisrationCar =
|
||||
static String get addRegisrationCar => "$server/ride/RegisrationCar/add.php";
|
||||
static String get getRegisrationCar =>
|
||||
"${box.read(BoxName.serverChosen)}/server/ride/RegisrationCar/get.php";
|
||||
static String selectDriverAndCarForMishwariTrip =
|
||||
static String get selectDriverAndCarForMishwariTrip =>
|
||||
"$server/ride/RegisrationCar/selectDriverAndCarForMishwariTrip.php";
|
||||
static String updateRegisrationCar = "$server/ride/RegisrationCar/update.php";
|
||||
static String get updateRegisrationCar => "$server/ride/RegisrationCar/update.php";
|
||||
|
||||
//-----------------mishwari------------------
|
||||
|
||||
static String addMishwari = "$server/ride/mishwari/add.php";
|
||||
static String cancelMishwari = "$server/ride/mishwari/cancel.php";
|
||||
static String getMishwari = "$server/ride/mishwari/get.php";
|
||||
static String sendChatMessage = "$server/ride/chat/send_message.php";
|
||||
static String get addMishwari => "$server/ride/mishwari/add.php";
|
||||
static String get cancelMishwari => "$server/ride/mishwari/cancel.php";
|
||||
static String get getMishwari => "$server/ride/mishwari/get.php";
|
||||
static String get sendChatMessage => "$server/ride/chat/send_message.php";
|
||||
|
||||
//-----------------DriverOrder------------------
|
||||
|
||||
static String addDriverOrder = "$server/ride/driver_order/add.php";
|
||||
static String getDriverOrder = "$server/ride/driver_order/get.php";
|
||||
static String getOrderCancelStatus =
|
||||
static String get addDriverOrder => "$server/ride/driver_order/add.php";
|
||||
static String get getDriverOrder => "$server/ride/driver_order/get.php";
|
||||
static String get getOrderCancelStatus =>
|
||||
"$server/ride/driver_order/getOrderCancelStatus.php";
|
||||
static String updateDriverOrder = "$server/ride/driver_order/update.php";
|
||||
static String deleteDriverOrder = "$server/ride/driver_order/delete.php";
|
||||
static String get updateDriverOrder => "$server/ride/driver_order/update.php";
|
||||
static String get deleteDriverOrder => "$server/ride/driver_order/delete.php";
|
||||
|
||||
// =====================================
|
||||
static String addRateToPassenger = "$server/ride/rate/add.php";
|
||||
static String savePlacesServer = "$server/ride/places/add.php";
|
||||
static String getapiKey = "$server/ride/apiKey/get.php";
|
||||
static String addRateToDriver = "$server/ride/rate/addRateToDriver.php";
|
||||
static String getDriverRate = "$server/ride/rate/getDriverRate.php";
|
||||
static String getPassengerRate = "$server/ride/rate/getPassengerRate.php";
|
||||
static String get addRateToPassenger => "$server/ride/rate/add.php";
|
||||
static String get savePlacesServer => "$server/ride/places/add.php";
|
||||
static String get getapiKey => "$server/ride/apiKey/get.php";
|
||||
|
||||
// Endpoint لجلب التسعيرة من السيرفر (Server-Side Pricing)
|
||||
static String get getPrices => "$server/ride/pricing/get.php";
|
||||
|
||||
static String get addRateToDriver => "$server/ride/rate/addRateToDriver.php";
|
||||
static String get getDriverRate => "$server/ride/rate/getDriverRate.php";
|
||||
static String get getPassengerRate => "$server/ride/rate/getPassengerRate.php";
|
||||
|
||||
////////////////emails ============//
|
||||
static String sendEmailToPassengerForTripDetails =
|
||||
static String get sendEmailToPassengerForTripDetails =>
|
||||
"$server/ride/rides/emailToPassengerTripDetail.php";
|
||||
|
||||
// ===========================================
|
||||
static String pathImage = "$server/upload/types/";
|
||||
static String uploadImage = "$server/uploadImage.php";
|
||||
static String uploadImage1 = "$server/uploadImage1.php";
|
||||
static String uploadImagePortrate = "$server/uploadImagePortrate.php";
|
||||
static String uploadImageType = "$server/uploadImageType.php";
|
||||
static String get pathImage => "$server/upload/types/";
|
||||
static String get uploadImage => "$server/uploadImage.php";
|
||||
static String get uploadImage1 => "$server/uploadImage1.php";
|
||||
static String get uploadImagePortrate => "$server/uploadImagePortrate.php";
|
||||
static String get uploadImageType => "$server/uploadImageType.php";
|
||||
//=============egypt documents ==============
|
||||
static String uploadEgyptidFront =
|
||||
static String get uploadEgyptidFront =>
|
||||
"$server/EgyptDocuments/uploadEgyptidFront.php";
|
||||
static String uploadEgypt = "$server/uploadEgypt.php";
|
||||
static String get uploadEgypt => "$server/uploadEgypt.php";
|
||||
|
||||
//==================certifcate==========
|
||||
// static String location = '${box.read(BoxName.serverChosen)}/ride/location';
|
||||
static String getCarsLocationByPassenger = "$location/get.php";
|
||||
static String get getCarsLocationByPassenger => "$location/get.php";
|
||||
|
||||
static String getLocationAreaLinks =
|
||||
static String get getLocationAreaLinks =>
|
||||
'$server/ride/location/get_location_area_links.php';
|
||||
static String addpassengerLocation =
|
||||
static String get addpassengerLocation =>
|
||||
"$locationServerSide/addpassengerLocation.php";
|
||||
static String getCarsLocationByPassengerSpeed = "$location/getSpeed.php";
|
||||
static String getCarsLocationByPassengerComfort = "$location/getComfort.php";
|
||||
static String getCarsLocationByPassengerBalash = "$location/getBalash.php";
|
||||
static String getCarsLocationByPassengerElectric =
|
||||
static String get getCarsLocationByPassengerSpeed => "$location/getSpeed.php";
|
||||
static String get getCarsLocationByPassengerComfort => "$location/getComfort.php";
|
||||
static String get getCarsLocationByPassengerBalash => "$location/getBalash.php";
|
||||
static String get getCarsLocationByPassengerElectric =>
|
||||
"$location/getElectric.php";
|
||||
static String getCarsLocationByPassengerPinkBike =
|
||||
static String get getCarsLocationByPassengerPinkBike =>
|
||||
"$location/getPinkBike.php";
|
||||
static String getCarsLocationByPassengerVan =
|
||||
static String get getCarsLocationByPassengerVan =>
|
||||
"$location/getCarsLocationByPassengerVan.php";
|
||||
static String getCarsLocationByPassengerDelivery =
|
||||
static String get getCarsLocationByPassengerDelivery =>
|
||||
"$location/getDelivery.php";
|
||||
static String getLocationParents = "$location/getLocationParents.php";
|
||||
static String getFemalDriverLocationByPassenger =
|
||||
static String get getLocationParents => "$location/getLocationParents.php";
|
||||
static String get getFemalDriverLocationByPassenger =>
|
||||
"$location/getFemalDriver.php";
|
||||
static String getDriverCarsLocationToPassengerAfterApplied =
|
||||
static String get getDriverCarsLocationToPassengerAfterApplied =>
|
||||
"$location/getDriverCarsLocationToPassengerAfterApplied.php";
|
||||
// static String addCarsLocationByPassenger = "$location/add.php";
|
||||
// static String deleteCarsLocationByPassenger = "$location/delete.php";
|
||||
@@ -300,76 +325,76 @@ class AppLink {
|
||||
// "$location/getTotalDriverDurationToday.php";
|
||||
|
||||
//==================Blog=============
|
||||
static String profile = '$server/ride/profile';
|
||||
static String getprofile = "$profile/get.php";
|
||||
static String getCaptainProfile = "$profile/getCaptainProfile.php";
|
||||
static String addprofile = "$profile/add.php";
|
||||
static String deleteprofile = "$profile/delete.php";
|
||||
static String updateprofile = "$profile/update.php";
|
||||
static String get profile => '$server/ride/profile';
|
||||
static String get getprofile => "$profile/get.php";
|
||||
static String get getCaptainProfile => "$profile/getCaptainProfile.php";
|
||||
static String get addprofile => "$profile/add.php";
|
||||
static String get deleteprofile => "$profile/delete.php";
|
||||
static String get updateprofile => "$profile/update.php";
|
||||
|
||||
//===================Auth============
|
||||
|
||||
static String auth = '$server/auth';
|
||||
static String login = "$auth/login.php";
|
||||
static String loginJwtRider = "$server/login.php";
|
||||
static String loginJwtWalletRider = "$server/loginWallet.php";
|
||||
static String loginFirstTime = "$server/loginFirstTime.php";
|
||||
static String getTesterApp = "$auth/Tester/getTesterApp.php";
|
||||
static String updateTesterApp = "$auth/Tester/updateTesterApp.php";
|
||||
static String signUp = "$auth/signup.php";
|
||||
static String sendVerifyEmail = "$auth/sendVerifyEmail.php";
|
||||
static String loginFromGooglePassenger = "$auth/loginFromGooglePassenger.php";
|
||||
static String checkPhoneNumberISVerfiedPassenger =
|
||||
static String get auth => '$server/auth';
|
||||
static String get login => "$auth/login.php";
|
||||
static String get loginJwtRider => "$server/login.php";
|
||||
static String get loginJwtWalletRider => "$server/loginWallet.php";
|
||||
static String get loginFirstTime => "$server/loginFirstTime.php";
|
||||
static String get getTesterApp => "$auth/Tester/getTesterApp.php";
|
||||
static String get updateTesterApp => "$auth/Tester/updateTesterApp.php";
|
||||
static String get signUp => "$auth/signup.php";
|
||||
static String get sendVerifyEmail => "$auth/sendVerifyEmail.php";
|
||||
static String get loginFromGooglePassenger => "$auth/loginFromGooglePassenger.php";
|
||||
static String get checkPhoneNumberISVerfiedPassenger =>
|
||||
"$auth/checkPhoneNumberISVerfiedPassenger.php";
|
||||
|
||||
static String passengerRemovedAccountEmail =
|
||||
static String get passengerRemovedAccountEmail =>
|
||||
"$auth/passengerRemovedAccountEmail.php";
|
||||
static String verifyEmail = "$auth/verifyEmail.php";
|
||||
static String get verifyEmail => "$auth/verifyEmail.php";
|
||||
//===================Auth Captin============
|
||||
static String authCaptin = '$server/auth/captin';
|
||||
static String loginCaptin = "$authCaptin/login.php";
|
||||
static String loginFromGoogleCaptin = "$authCaptin/loginFromGoogle.php";
|
||||
static String signUpCaptin = "$authCaptin/register.php";
|
||||
static String sendVerifyEmailCaptin = "$authCaptin/sendVerifyEmail.php";
|
||||
static String sendVerifyOtpMessage = "$server/auth/otpmessage.php";
|
||||
static String verifyOtpMessage = "$server/auth/verifyOtpMessage.php";
|
||||
static String verifyEmailCaptin = "$authCaptin/verifyEmail.php";
|
||||
static String removeUser = "$authCaptin/removeAccount.php";
|
||||
static String deletecaptainAccounr = "$authCaptin/deletecaptainAccounr.php";
|
||||
static String updateAccountBank = "$authCaptin/updateAccountBank.php";
|
||||
static String getAccount = "$authCaptin/getAccount.php";
|
||||
static String updatePassengersInvitation =
|
||||
static String get authCaptin => '$server/auth/captin';
|
||||
static String get loginCaptin => "$authCaptin/login.php";
|
||||
static String get loginFromGoogleCaptin => "$authCaptin/loginFromGoogle.php";
|
||||
static String get signUpCaptin => "$authCaptin/register.php";
|
||||
static String get sendVerifyEmailCaptin => "$authCaptin/sendVerifyEmail.php";
|
||||
static String get sendVerifyOtpMessage => "$server/auth/otpmessage.php";
|
||||
static String get verifyOtpMessage => "$server/auth/verifyOtpMessage.php";
|
||||
static String get verifyEmailCaptin => "$authCaptin/verifyEmail.php";
|
||||
static String get removeUser => "$authCaptin/removeAccount.php";
|
||||
static String get deletecaptainAccounr => "$authCaptin/deletecaptainAccounr.php";
|
||||
static String get updateAccountBank => "$authCaptin/updateAccountBank.php";
|
||||
static String get getAccount => "$authCaptin/getAccount.php";
|
||||
static String get updatePassengersInvitation =>
|
||||
"$server/ride/invitor/updatePassengersInvitation.php";
|
||||
static String updateDriverInvitationDirectly =
|
||||
static String get updateDriverInvitationDirectly =>
|
||||
"$server/ride/invitor/updateDriverInvitationDirectly.php";
|
||||
//===================Admin Captin============
|
||||
|
||||
static String getPassengerDetailsByPassengerID =
|
||||
static String get getPassengerDetailsByPassengerID =>
|
||||
"$server/Admin/getPassengerDetailsByPassengerID.php";
|
||||
static String getPassengerDetails = "$server/Admin/getPassengerDetails.php";
|
||||
static String getPassengerbyEmail = "$server/Admin/getPassengerbyEmail.php";
|
||||
static String addAdminUser = "$server/Admin/adminUser/add.php";
|
||||
static String getAdminUser = "$server/Admin/adminUser/get.php";
|
||||
static String addError = "$server/Admin/errorApp.php";
|
||||
static String getCaptainDetailsByEmailOrIDOrPhone =
|
||||
static String get getPassengerDetails => "$server/Admin/getPassengerDetails.php";
|
||||
static String get getPassengerbyEmail => "$server/Admin/getPassengerbyEmail.php";
|
||||
static String get addAdminUser => "$server/Admin/adminUser/add.php";
|
||||
static String get getAdminUser => "$server/Admin/adminUser/get.php";
|
||||
static String get addError => "$server/Admin/errorApp.php";
|
||||
static String get getCaptainDetailsByEmailOrIDOrPhone =>
|
||||
"$server/Admin/AdminCaptain/getCaptainDetailsByEmailOrIDOrPhone.php";
|
||||
static String getCaptainDetails = "$server/Admin/AdminCaptain/get.php";
|
||||
static String getRidesPerMonth =
|
||||
static String get getCaptainDetails => "$server/Admin/AdminCaptain/get.php";
|
||||
static String get getRidesPerMonth =>
|
||||
"$server/Admin/AdminRide/getRidesPerMonth.php";
|
||||
static String getRidesDetails = "$server/Admin/AdminRide/get.php";
|
||||
static String get getRidesDetails => "$server/Admin/AdminRide/get.php";
|
||||
|
||||
//////////Sms egypt///////////
|
||||
static String sendSms = "https://sms.kazumi.me/api/sms/send-sms";
|
||||
static String sendSmsFromPHP =
|
||||
static String get sendSms => "https://sms.kazumi.me/api/sms/send-sms";
|
||||
static String get sendSmsFromPHP =>
|
||||
'$server/auth/sms_new_backend/sendOtpPassenger.php';
|
||||
static String verifyOtpPassenger =
|
||||
static String get verifyOtpPassenger =>
|
||||
'$server/auth/passengerOTP/verifyOtpPassenger.php';
|
||||
static String senddlr = "https://sms.kazumi.me/api/sms/send-dlr";
|
||||
static String sendvalidity = "https://sms.kazumi.me/api/sms/send-validity";
|
||||
static String sendmany = "https://sms.kazumi.me/api/sms/send-many";
|
||||
static String checkCredit = "https://sms.kazumi.me/api/sms/check-credit";
|
||||
static String getSender = "$server/auth/sms/getSender.php";
|
||||
static String checkStatus = "https://sms.kazumi.me/api/sms/check-status";
|
||||
static String updatePhoneInvalidSMSPassenger =
|
||||
static String get senddlr => "https://sms.kazumi.me/api/sms/send-dlr";
|
||||
static String get sendvalidity => "https://sms.kazumi.me/api/sms/send-validity";
|
||||
static String get sendmany => "https://sms.kazumi.me/api/sms/send-many";
|
||||
static String get checkCredit => "https://sms.kazumi.me/api/sms/check-credit";
|
||||
static String get getSender => "$server/auth/sms/getSender.php";
|
||||
static String get checkStatus => "https://sms.kazumi.me/api/sms/check-status";
|
||||
static String get updatePhoneInvalidSMSPassenger =>
|
||||
"$server/auth/sms/updatePhoneInvalidSMSPassenger.php";
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import 'package:siro_rider/constant/links.dart';
|
||||
import 'package:siro_rider/views/home/map_page_passenger.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../../../constant/box_name.dart';
|
||||
import '../../../main.dart';
|
||||
@@ -8,6 +7,7 @@ import '../../views/auth/otp_page.dart';
|
||||
import '../../views/widgets/error_snakbar.dart';
|
||||
import '../functions/crud.dart';
|
||||
import '../functions/package_info.dart';
|
||||
import '../functions/country_logic.dart';
|
||||
import 'login_controller.dart';
|
||||
|
||||
// --- Helper Class for Phone Authentication ---
|
||||
@@ -19,67 +19,13 @@ class PhoneAuthHelper {
|
||||
static final String _verifyOtpUrl = '${_baseUrl}verifyOtp.php';
|
||||
static final String _registerUrl = '${_baseUrl}register_passenger.php';
|
||||
|
||||
static String formatSyrianPhone(String phone) {
|
||||
// Remove spaces, symbols, +, -, ()
|
||||
phone = phone.replaceAll(RegExp(r'[ \-\(\)\+]'), '').trim();
|
||||
|
||||
// Normalize 00963 → 963
|
||||
if (phone.startsWith('00963')) {
|
||||
phone = phone.replaceFirst('00963', '963');
|
||||
}
|
||||
|
||||
// Normalize 0963 → 963
|
||||
if (phone.startsWith('0963')) {
|
||||
phone = phone.replaceFirst('0963', '963');
|
||||
}
|
||||
|
||||
// NEW: Fix 96309xxxx → 9639xxxx
|
||||
if (phone.startsWith('96309')) {
|
||||
phone = '9639' + phone.substring(5); // remove the "0" after 963
|
||||
}
|
||||
|
||||
// If starts with 9630 → correct to 9639
|
||||
if (phone.startsWith('9630')) {
|
||||
phone = '9639' + phone.substring(4);
|
||||
}
|
||||
|
||||
// If already in correct format: 9639xxxxxxxx
|
||||
if (phone.startsWith('9639') && phone.length == 12) {
|
||||
return phone;
|
||||
}
|
||||
|
||||
// If starts with 963 but missing the 9
|
||||
if (phone.startsWith('963') && phone.length > 3) {
|
||||
// Ensure it begins with 9639
|
||||
if (!phone.startsWith('9639')) {
|
||||
phone = '9639' + phone.substring(3);
|
||||
}
|
||||
return phone;
|
||||
}
|
||||
|
||||
// If starts with 09xxxxxxxx → 9639xxxxxxxx
|
||||
if (phone.startsWith('09')) {
|
||||
return '963' + phone.substring(1);
|
||||
}
|
||||
|
||||
// If 9xxxxxxxx (9 digits)
|
||||
if (phone.startsWith('9') && phone.length == 9) {
|
||||
return '963' + phone;
|
||||
}
|
||||
|
||||
// If starts with incorrect 0xxxxxxx → assume Syrian and fix
|
||||
if (phone.startsWith('0') && phone.length == 10) {
|
||||
return '963' + phone.substring(1);
|
||||
}
|
||||
|
||||
return phone;
|
||||
}
|
||||
// removed formatSyrianPhone
|
||||
|
||||
/// Sends an OTP to the provided phone number.
|
||||
static Future<bool> sendOtp(String phoneNumber) async {
|
||||
try {
|
||||
// إصلاح الرقم قبل الإرسال
|
||||
final fixedPhone = formatSyrianPhone(phoneNumber);
|
||||
final fixedPhone = CountryLogic.formatCurrentCountryPhone(phoneNumber);
|
||||
|
||||
final response = await CRUD().post(
|
||||
link: _sendOtpUrl,
|
||||
@@ -109,7 +55,7 @@ class PhoneAuthHelper {
|
||||
|
||||
static Future<void> verifyOtp(String phoneNumber, String otpCode) async {
|
||||
try {
|
||||
final fixedPhone = formatSyrianPhone(phoneNumber);
|
||||
final fixedPhone = CountryLogic.formatCurrentCountryPhone(phoneNumber);
|
||||
final response = await CRUD().post(
|
||||
link: _verifyOtpUrl,
|
||||
payload: {
|
||||
|
||||
@@ -666,7 +666,7 @@ class DriverTipWidget extends StatelessWidget {
|
||||
|
||||
Toast.show(
|
||||
context,
|
||||
'${'Tip is '.tr}${(controller.totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
|
||||
'${'Tip is '.tr}${(double.parse(controller.totalPassenger.toString())) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
|
||||
AppColor.cyanBlue);
|
||||
controller.update();
|
||||
},
|
||||
@@ -685,7 +685,7 @@ class DriverTipWidget extends StatelessWidget {
|
||||
box.write(BoxName.tipPercentage, '0.10');
|
||||
Toast.show(
|
||||
context,
|
||||
'${'Tip is'.tr} ${(controller.totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
|
||||
'${'Tip is'.tr} ${(double.parse(controller.totalPassenger.toString())) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
|
||||
AppColor.cyanBlue);
|
||||
controller.update();
|
||||
},
|
||||
@@ -704,7 +704,7 @@ class DriverTipWidget extends StatelessWidget {
|
||||
box.write(BoxName.tipPercentage, '0.15');
|
||||
Toast.show(
|
||||
context,
|
||||
'${'Tip is'.tr} ${(controller.totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
|
||||
'${'Tip is'.tr} ${(double.parse(controller.totalPassenger.toString())) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
|
||||
AppColor.cyanBlue);
|
||||
controller.update();
|
||||
},
|
||||
@@ -723,7 +723,7 @@ class DriverTipWidget extends StatelessWidget {
|
||||
box.write(BoxName.tipPercentage, '0.20');
|
||||
Toast.show(
|
||||
context,
|
||||
'${'Tip is'.tr} ${(controller.totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
|
||||
'${'Tip is'.tr} ${(double.parse(controller.totalPassenger.toString())) * (double.parse(box.read(BoxName.tipPercentage.toString())))}',
|
||||
AppColor.cyanBlue);
|
||||
controller.update();
|
||||
},
|
||||
@@ -754,7 +754,7 @@ class DriverTipWidget extends StatelessWidget {
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(6),
|
||||
child: Text(
|
||||
'${(controller.totalPassenger) * (double.parse(box.read(BoxName.tipPercentage.toString())))} ${box.read(BoxName.countryCode) == 'Egypt' ? 'LE'.tr : 'JOD'.tr}',
|
||||
'${(double.parse(controller.totalPassenger.toString())) * (double.parse(box.read(BoxName.tipPercentage.toString())))} ${box.read(BoxName.countryCode) == 'Egypt' ? 'LE'.tr : 'JOD'.tr}',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
),
|
||||
|
||||
94
siro_rider/lib/controller/functions/country_logic.dart
Normal file
94
siro_rider/lib/controller/functions/country_logic.dart
Normal file
@@ -0,0 +1,94 @@
|
||||
import 'package:siro_rider/constant/box_name.dart';
|
||||
import 'package:siro_rider/main.dart';
|
||||
|
||||
class CountryLogic {
|
||||
/// Formats the phone number based on the country's dialing rules.
|
||||
static String formatPhone(String phone, String country) {
|
||||
phone = phone.replaceAll(RegExp(r'[ \-\(\)\+]'), '').trim();
|
||||
|
||||
if (country == 'Egypt') {
|
||||
// Rule: 010, 011, 012, 015 -> 2010, 2011, 2012, 2015
|
||||
if (phone.startsWith('0020')) phone = phone.replaceFirst('0020', '20');
|
||||
if (phone.startsWith('01') && phone.length >= 10) {
|
||||
return '20${phone.substring(1)}';
|
||||
}
|
||||
if (phone.startsWith('1') &&
|
||||
phone.length >= 9 &&
|
||||
!phone.startsWith('20')) {
|
||||
return '20$phone';
|
||||
}
|
||||
if (!phone.startsWith('20') && phone.length > 8) return '20$phone';
|
||||
} else if (country == 'Jordan') {
|
||||
// Rule: 07x -> 9627x
|
||||
if (phone.startsWith('00962')) phone = phone.replaceFirst('00962', '962');
|
||||
if (phone.startsWith('07') && phone.length >= 9) {
|
||||
return '962${phone.substring(1)}';
|
||||
}
|
||||
if (phone.startsWith('7') &&
|
||||
phone.length >= 8 &&
|
||||
!phone.startsWith('962')) {
|
||||
return '962$phone';
|
||||
}
|
||||
if (!phone.startsWith('962') && phone.length > 7) return '962$phone';
|
||||
} else {
|
||||
// Default to Syria
|
||||
if (phone.startsWith('00963')) phone = phone.replaceFirst('00963', '963');
|
||||
if (phone.startsWith('0963')) phone = phone.replaceFirst('0963', '963');
|
||||
if (phone.startsWith('096309')) {
|
||||
phone = phone.replaceFirst('096309', '963');
|
||||
}
|
||||
if (phone.startsWith('96309')) phone = '9639${phone.substring(5)}';
|
||||
if (phone.startsWith('9630')) phone = '9639${phone.substring(4)}';
|
||||
if (phone.startsWith('9639') && phone.length == 12) return phone;
|
||||
if (phone.startsWith('963') &&
|
||||
phone.length > 3 &&
|
||||
!phone.startsWith('9639')) {
|
||||
phone = '9639${phone.substring(3)}';
|
||||
}
|
||||
if (phone.startsWith('09')) return '963${phone.substring(1)}';
|
||||
if (phone.startsWith('9') && phone.length == 9) return '963$phone';
|
||||
if (phone.startsWith('0') && phone.length == 10) {
|
||||
return '963${phone.substring(1)}';
|
||||
}
|
||||
}
|
||||
return phone;
|
||||
}
|
||||
|
||||
/// Returns the default country prefix (EG, JO, SY) for UI initial selection.
|
||||
static String getCountryPrefix(String country) {
|
||||
if (country == 'Egypt') return 'EG';
|
||||
if (country == 'Jordan') return 'JO';
|
||||
return 'SY';
|
||||
}
|
||||
|
||||
/// Returns the default emergency number for the country.
|
||||
static String getEmergencyNumber(String country) {
|
||||
if (country == 'Egypt') return '122';
|
||||
if (country == 'Jordan') return '911';
|
||||
return '112'; // Syria
|
||||
}
|
||||
|
||||
/// Returns the hint text for phone inputs based on the country.
|
||||
static String getPhoneHint(String country) {
|
||||
if (country == 'Egypt') return 'e.g. 01012345678 (Default +20)';
|
||||
if (country == 'Jordan') return 'e.g. 0791234567 (Default +962)';
|
||||
return 'e.g. 0912345678 (Default +963)'; // Syria
|
||||
}
|
||||
|
||||
/// Helper to format phone using the current country in box.
|
||||
static String formatCurrentCountryPhone(String phone) {
|
||||
String cleanPhone = phone.replaceAll(RegExp(r'[ \-\(\)]'), '').trim();
|
||||
if (cleanPhone.startsWith('+963') || cleanPhone.startsWith('00963')) {
|
||||
return formatPhone(cleanPhone, 'Syria');
|
||||
}
|
||||
if (cleanPhone.startsWith('+20') || cleanPhone.startsWith('0020')) {
|
||||
return formatPhone(cleanPhone, 'Egypt');
|
||||
}
|
||||
if (cleanPhone.startsWith('+962') || cleanPhone.startsWith('00962')) {
|
||||
return formatPhone(cleanPhone, 'Jordan');
|
||||
}
|
||||
|
||||
final country = box.read(BoxName.countryCode) ?? 'Syria';
|
||||
return formatPhone(cleanPhone, country);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:siro_rider/print.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import 'dart:io';
|
||||
import 'package:siro_rider/controller/functions/country_logic.dart';
|
||||
|
||||
void showInBrowser(String url) async {
|
||||
if (await canLaunchUrl(Uri.parse(url))) {
|
||||
@@ -9,16 +10,11 @@ void showInBrowser(String url) async {
|
||||
}
|
||||
|
||||
Future<void> makePhoneCall(String phoneNumber) async {
|
||||
// 1. تنظيف الرقم (إزالة المسافات والفواصل)
|
||||
String formattedNumber = phoneNumber.replaceAll(RegExp(r'\s+'), '');
|
||||
|
||||
// 2. منطق التنسيق (مع الحفاظ على الأرقام القصيرة مثل 112 كما هي)
|
||||
if (formattedNumber.length > 6) {
|
||||
if (formattedNumber.startsWith('09')) {
|
||||
// إذا كان يبدأ بـ 09 (رقم موبايل سوري محلي) -> +963
|
||||
formattedNumber = '+963${formattedNumber.substring(1)}';
|
||||
} else if (!formattedNumber.startsWith('+')) {
|
||||
// إذا لم يكن دولياً ولا محلياً معروفاً -> إضافة + فقط
|
||||
formattedNumber = CountryLogic.formatCurrentCountryPhone(formattedNumber);
|
||||
if (!formattedNumber.startsWith('+')) {
|
||||
formattedNumber = '+$formattedNumber';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,25 +125,23 @@ class RideLifecycleController extends GetxController {
|
||||
late String driverCompletedRides = '0';
|
||||
late String driverTier = 'Verified driver';
|
||||
late String driverToken = '';
|
||||
|
||||
double kazan = 8;
|
||||
double totalPassenger = 0;
|
||||
String totalPassenger = '0';
|
||||
double totalDriver = 0;
|
||||
double costDistance = 0;
|
||||
double costDuration = 0;
|
||||
double averageDuration = 0;
|
||||
double totalCostPassenger = 0;
|
||||
String totalCostPassenger = '0';
|
||||
|
||||
double totalPassengerSpeed = 0;
|
||||
double totalPassengerBalash = 0;
|
||||
double totalPassengerComfort = 0;
|
||||
double totalPassengerElectric = 0;
|
||||
double totalPassengerLady = 0;
|
||||
double totalPassengerScooter = 0;
|
||||
double totalPassengerVan = 0;
|
||||
double totalPassengerRayehGai = 0;
|
||||
double totalPassengerRayehGaiComfort = 0;
|
||||
double totalPassengerRayehGaiBalash = 0;
|
||||
String totalPassengerSpeed = '0';
|
||||
String totalPassengerBalash = '0';
|
||||
String totalPassengerComfort = '0';
|
||||
String totalPassengerElectric = '0';
|
||||
String totalPassengerLady = '0';
|
||||
String totalPassengerScooter = '0';
|
||||
String totalPassengerVan = '0';
|
||||
String totalPassengerRayehGai = '0';
|
||||
String totalPassengerRayehGaiComfort = '0';
|
||||
String totalPassengerRayehGaiBalash = '0';
|
||||
|
||||
double latePrice = 0;
|
||||
double fuelPrice = 0;
|
||||
@@ -744,7 +742,7 @@ class RideLifecycleController extends GetxController {
|
||||
style: TextStyle(color: AppColor.greenColor)),
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
double newPrice = totalPassenger * 1.10;
|
||||
double newPrice = double.parse(totalPassenger) * 1.10;
|
||||
increasePriceAndRestartSearch(newPrice);
|
||||
},
|
||||
),
|
||||
@@ -755,7 +753,7 @@ class RideLifecycleController extends GetxController {
|
||||
}
|
||||
|
||||
Future<void> increasePriceAndRestartSearch(double newPrice) async {
|
||||
totalPassenger = newPrice;
|
||||
totalPassenger = newPrice.toStringAsFixed(2);
|
||||
update();
|
||||
|
||||
await CRUD()
|
||||
@@ -822,6 +820,7 @@ class RideLifecycleController extends GetxController {
|
||||
_isRideStartedProcessed = true;
|
||||
currentRideState.value = RideState.inProgress;
|
||||
statusRide = 'Begin';
|
||||
box.write(BoxName.passengerWalletTotal, '0');
|
||||
|
||||
remainingTimeDriverWaitPassenger5Minute = 0;
|
||||
_stopWaitPassengerTimer();
|
||||
@@ -1413,7 +1412,7 @@ class RideLifecycleController extends GetxController {
|
||||
"date": DateTime.now().toString(),
|
||||
"time": DateTime.now().toString(),
|
||||
"endtime": "00:00:00",
|
||||
"price": totalPassenger.toStringAsFixed(2),
|
||||
"price": double.parse(totalPassenger.toString()).toStringAsFixed(2),
|
||||
"passenger_id": box.read(BoxName.passengerID).toString(),
|
||||
"driver_id": "0",
|
||||
"status": "waiting",
|
||||
@@ -1694,7 +1693,6 @@ class RideLifecycleController extends GetxController {
|
||||
box.write(BoxName.serverChosen, AppLink.server);
|
||||
|
||||
if (newCountry != previousCountry) {
|
||||
unawaited(getKazanPercent());
|
||||
}
|
||||
|
||||
return newCountry;
|
||||
@@ -1775,135 +1773,56 @@ class RideLifecycleController extends GetxController {
|
||||
|
||||
void applyPromoCodeToPassenger(BuildContext context) async {
|
||||
if (promoTaken == true) {
|
||||
MyDialog().getDialog(
|
||||
'Promo Already Used'.tr,
|
||||
'You have already used this promo code.'.tr,
|
||||
() => Get.back(),
|
||||
);
|
||||
MyDialog().getDialog('Promo Already Used'.tr, 'You have already used this promo code.'.tr, () => Get.back());
|
||||
return;
|
||||
}
|
||||
|
||||
if (!promoFormKey.currentState!.validate()) return;
|
||||
|
||||
const double minPromoLowSYP = 172;
|
||||
const double minPromoHighSYP = 200;
|
||||
|
||||
|
||||
try {
|
||||
final value = await CRUD().get(
|
||||
link: AppLink.getPassengersPromo,
|
||||
payload: {'promo_code': promo.text},
|
||||
);
|
||||
final res = await CRUD().post(link: AppLink.getPrices, payload: {
|
||||
'distance': distance.toString(),
|
||||
'durationToRide': durationToRide.toString(),
|
||||
'startNameAddress': startNameAddress,
|
||||
'endNameAddress': endNameAddress,
|
||||
'destLat': myDestination.latitude.toString(),
|
||||
'destLng': myDestination.longitude.toString(),
|
||||
'passengerLat': newMyLocation.latitude.toString(),
|
||||
'passengerLng': newMyLocation.longitude.toString(),
|
||||
'walletVal': box.read(BoxName.passengerWalletTotal)?.toString() ?? '0',
|
||||
'activeMenuWaypointCount': activeMenuWaypointCount.toString(),
|
||||
'promo_code': promo.text,
|
||||
'passenger_id' :box.read(BoxName.passengerID),
|
||||
'country': box.read(BoxName.countryCode) ?? '',
|
||||
});
|
||||
|
||||
if (value == 'failure') {
|
||||
MyDialog().getDialog(
|
||||
'Promo Ended'.tr,
|
||||
'The promotion period has ended.'.tr,
|
||||
() => Get.back(),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
final bool eligibleNow = (totalPassengerSpeed >= minPromoLowSYP) ||
|
||||
(totalPassengerBalash >= minPromoLowSYP) ||
|
||||
(totalPassengerComfort >= minPromoHighSYP) ||
|
||||
(totalPassengerElectric >= minPromoHighSYP) ||
|
||||
(totalPassengerLady >= minPromoHighSYP);
|
||||
|
||||
if (!eligibleNow) {
|
||||
Get.snackbar(
|
||||
'Lowest Price Achieved'.tr,
|
||||
'Cannot apply further discounts.'.tr,
|
||||
backgroundColor: AppColor.yellowColor,
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
final decode = jsonDecode(value);
|
||||
if (decode["status"] != "success") {
|
||||
MyDialog().getDialog(
|
||||
'Promo Ended'.tr,
|
||||
'The promotion period has ended.'.tr,
|
||||
() => Get.back(),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
Get.snackbar('Promo Code Accepted'.tr, '',
|
||||
backgroundColor: AppColor.greenColor);
|
||||
|
||||
final firstElement = decode["message"][0];
|
||||
final int discountPercentage =
|
||||
int.tryParse(firstElement['amount'].toString()) ?? 0;
|
||||
|
||||
final double walletVal = double.tryParse(
|
||||
box.read(BoxName.passengerWalletTotal)?.toString() ?? '0') ??
|
||||
0.0;
|
||||
|
||||
final bool isWalletNegative = walletVal < 0;
|
||||
|
||||
double _applyDiscountPerTier({
|
||||
required double fare,
|
||||
required double minThreshold,
|
||||
required bool isWalletNegative,
|
||||
}) {
|
||||
if (fare < minThreshold) return fare;
|
||||
|
||||
final double discount = fare * (discountPercentage / 100.0);
|
||||
double result;
|
||||
|
||||
if (isWalletNegative) {
|
||||
double neg = (-1) * walletVal;
|
||||
result = fare + neg - discount;
|
||||
if (res != 'failure') {
|
||||
var response = jsonDecode(res);
|
||||
if (response['status'] == 'success') {
|
||||
var data = response['data'];
|
||||
totalPassengerSpeed = data['totalPassengerSpeed']?.toString() ?? '0';
|
||||
totalPassengerBalash = data['totalPassengerBalash']?.toString() ?? '0';
|
||||
totalPassengerComfort = data['totalPassengerComfort']?.toString() ?? '0';
|
||||
totalPassengerElectric = data['totalPassengerElectric']?.toString() ?? '0';
|
||||
totalPassengerLady = data['totalPassengerLady']?.toString() ?? '0';
|
||||
totalPassengerScooter = data['totalPassengerScooter']?.toString() ?? '0';
|
||||
totalPassengerVan = data['totalPassengerVan']?.toString() ?? '0';
|
||||
totalPassengerRayehGai = data['totalPassengerRayehGai']?.toString() ?? '0';
|
||||
totalPassengerRayehGaiComfort = data['totalPassengerRayehGaiComfort']?.toString() ?? '0';
|
||||
totalPassengerRayehGaiBalash = data['totalPassengerRayehGaiBalash']?.toString() ?? '0';
|
||||
|
||||
promoTaken = true;
|
||||
update();
|
||||
|
||||
Confetti.launch(
|
||||
context,
|
||||
options: const ConfettiOptions(particleCount: 100, spread: 70, y: 0.6),
|
||||
);
|
||||
} else {
|
||||
result = fare - discount;
|
||||
MyDialog().getDialog('Promo Error'.tr, response['message']?.toString() ?? 'Invalid Promo'.tr, () => Get.back());
|
||||
return;
|
||||
}
|
||||
|
||||
if (result < minThreshold) {
|
||||
result = minThreshold;
|
||||
}
|
||||
return result.clamp(0.0, double.infinity);
|
||||
}
|
||||
|
||||
totalPassengerComfort = _applyDiscountPerTier(
|
||||
fare: totalPassengerComfort,
|
||||
minThreshold: minPromoHighSYP,
|
||||
isWalletNegative: isWalletNegative,
|
||||
);
|
||||
|
||||
totalPassengerElectric = _applyDiscountPerTier(
|
||||
fare: totalPassengerElectric,
|
||||
minThreshold: minPromoHighSYP,
|
||||
isWalletNegative: isWalletNegative,
|
||||
);
|
||||
|
||||
totalPassengerLady = _applyDiscountPerTier(
|
||||
fare: totalPassengerLady,
|
||||
minThreshold: minPromoHighSYP,
|
||||
isWalletNegative: isWalletNegative,
|
||||
);
|
||||
|
||||
totalPassengerSpeed = _applyDiscountPerTier(
|
||||
fare: totalPassengerSpeed,
|
||||
minThreshold: minPromoLowSYP,
|
||||
isWalletNegative: isWalletNegative,
|
||||
);
|
||||
|
||||
totalPassengerBalash = _applyDiscountPerTier(
|
||||
fare: totalPassengerBalash,
|
||||
minThreshold: minPromoLowSYP,
|
||||
isWalletNegative: isWalletNegative,
|
||||
);
|
||||
|
||||
totalDriver = totalDriver - (totalDriver * discountPercentage / 100.0);
|
||||
promoTaken = true;
|
||||
update();
|
||||
|
||||
Confetti.launch(
|
||||
context,
|
||||
options: const ConfettiOptions(particleCount: 100, spread: 70, y: 0.6),
|
||||
);
|
||||
|
||||
Get.back();
|
||||
Get.back();
|
||||
await Future.delayed(const Duration(milliseconds: 120));
|
||||
} catch (e) {
|
||||
Get.snackbar('Error'.tr, e.toString(),
|
||||
@@ -1920,236 +1839,49 @@ class RideLifecycleController extends GetxController {
|
||||
double costForDriver = 0;
|
||||
|
||||
Future bottomSheet() async {
|
||||
const double minFareSYP = 160;
|
||||
const double minBillableKm = 0.3;
|
||||
const double ladyFlatAddon = 20;
|
||||
const double airportAddonSYP = 200;
|
||||
const double damascusAirportBoundAddon = 1400;
|
||||
|
||||
const double electricPerKmUplift = 4;
|
||||
const double electricFlatAddon = 10;
|
||||
|
||||
const double longSpeedThresholdKm = 40.0;
|
||||
const double longSpeedPerKm = 26.0;
|
||||
|
||||
const double mediumDistThresholdKm = 25.0;
|
||||
const double longDistThresholdKm = 35.0;
|
||||
const double longTripPerMin = 6.0;
|
||||
const int minuteCapMedium = 60;
|
||||
const int minuteCapLong = 80;
|
||||
const int freeMinutesLong = 10;
|
||||
|
||||
const double extraReduction100 = 0.07;
|
||||
const double maxReductionCap = 0.35;
|
||||
|
||||
durationToAdd = Duration(seconds: durationToRide);
|
||||
hours = durationToAdd.inHours;
|
||||
minutes = (durationToAdd.inMinutes % 60).round();
|
||||
final DateTime currentTime = DateTime.now();
|
||||
newTime = currentTime.add(durationToAdd);
|
||||
averageDuration = (durationToRide / 60) / distance;
|
||||
final int waypointSurchargeMinutes = activeMenuWaypointCount * 5;
|
||||
final int totalMinutes =
|
||||
(durationToRide / 60).floor() + waypointSurchargeMinutes;
|
||||
|
||||
bool _isAirport(String s) {
|
||||
final t = s.toLowerCase();
|
||||
return t.contains('airport') ||
|
||||
s.contains('مطار') ||
|
||||
s.contains('المطار');
|
||||
}
|
||||
|
||||
bool _isClub(String s) {
|
||||
final t = s.toLowerCase();
|
||||
return t.contains('club') ||
|
||||
t.contains('nightclub') ||
|
||||
t.contains('night club') ||
|
||||
s.contains('ديسكو') ||
|
||||
s.contains('ملهى ليلي');
|
||||
}
|
||||
|
||||
bool _isInsideDamascusAirportBounds(double lat, double lng) {
|
||||
final double northLat = 33.415313;
|
||||
final double southLat = 33.400265;
|
||||
final double eastLng = 36.531505;
|
||||
final double westLng = 36.499687;
|
||||
|
||||
bool isLatInside = (lat <= northLat) && (lat >= southLat);
|
||||
bool isLngInside = (lng <= eastLng) && (lng >= westLng);
|
||||
return isLatInside && isLngInside;
|
||||
}
|
||||
|
||||
final double naturePerMin = naturePrice;
|
||||
final double latePerMin = latePrice;
|
||||
final double heavyPerMin = heavyPrice;
|
||||
|
||||
double _perMinuteByTime(DateTime now, bool clubCtx) {
|
||||
final h = now.hour;
|
||||
if (h >= 21 || h < 1) return latePerMin;
|
||||
if (h >= 1 && h < 5) return clubCtx ? (latePerMin * 2) : latePerMin;
|
||||
if (h >= 14 && h <= 17) return heavyPerMin;
|
||||
return naturePerMin;
|
||||
}
|
||||
|
||||
double _applyMinFare(double fare) =>
|
||||
(fare < minFareSYP) ? minFareSYP : fare;
|
||||
|
||||
double _withCommission(double base) =>
|
||||
(base * (1 + kazan / 100)).ceilToDouble();
|
||||
|
||||
final bool airportCtx =
|
||||
_isAirport(startNameAddress) || _isAirport(endNameAddress);
|
||||
final bool clubCtx = _isClub(startNameAddress) || _isClub(endNameAddress);
|
||||
|
||||
double destLat = 0.0;
|
||||
double destLng = 0.0;
|
||||
try {
|
||||
destLat = myDestination.latitude;
|
||||
destLng = myDestination.longitude;
|
||||
} catch (_) {
|
||||
if (locSearch.coordinatesWithoutEmpty.isNotEmpty) {
|
||||
destLat = double.tryParse(
|
||||
locSearch.coordinatesWithoutEmpty.last.split(',')[0]) ??
|
||||
0.0;
|
||||
destLng = double.tryParse(
|
||||
locSearch.coordinatesWithoutEmpty.last.split(',')[1]) ??
|
||||
0.0;
|
||||
}
|
||||
}
|
||||
|
||||
final bool damascusAirportBoundCtx =
|
||||
_isInsideDamascusAirportBounds(destLat, destLng);
|
||||
final bool isInDamascusAirportBoundCtx = _isInsideDamascusAirportBounds(
|
||||
newMyLocation.latitude.toDouble(),
|
||||
newMyLocation.longitude.toDouble(),
|
||||
);
|
||||
|
||||
final double billableDistance =
|
||||
(distance < minBillableKm) ? minBillableKm : distance;
|
||||
|
||||
final bool isLongSpeed = billableDistance > longSpeedThresholdKm;
|
||||
final double perKmSpeedBaseFromServer = speedPrice;
|
||||
final double perKmSpeed =
|
||||
isLongSpeed ? longSpeedPerKm : perKmSpeedBaseFromServer;
|
||||
|
||||
double reductionPct40 = 0.0;
|
||||
if (perKmSpeedBaseFromServer > 0) {
|
||||
reductionPct40 = (1.0 - (longSpeedPerKm / perKmSpeedBaseFromServer))
|
||||
.clamp(0.0, maxReductionCap);
|
||||
}
|
||||
final double reductionPct100 =
|
||||
(reductionPct40 + extraReduction100).clamp(0.0, maxReductionCap);
|
||||
double distanceReduction = 0.0;
|
||||
if (billableDistance > 100.0) {
|
||||
distanceReduction = reductionPct100;
|
||||
} else if (billableDistance > 40.0) {
|
||||
distanceReduction = reductionPct40;
|
||||
}
|
||||
|
||||
double effectivePerMin = _perMinuteByTime(currentTime, clubCtx);
|
||||
int billableMinutes = totalMinutes;
|
||||
if (billableDistance > longDistThresholdKm) {
|
||||
effectivePerMin = longTripPerMin;
|
||||
final int capped =
|
||||
(billableMinutes > minuteCapLong) ? minuteCapLong : billableMinutes;
|
||||
billableMinutes = capped - freeMinutesLong;
|
||||
if (billableMinutes < 0) billableMinutes = 0;
|
||||
} else if (billableDistance > mediumDistThresholdKm) {
|
||||
effectivePerMin = longTripPerMin;
|
||||
billableMinutes = (billableMinutes > minuteCapMedium)
|
||||
? minuteCapMedium
|
||||
: billableMinutes;
|
||||
}
|
||||
|
||||
final double perKmComfortRaw = comfortPrice;
|
||||
final double perKmDelivery = deliveryPrice;
|
||||
final double perKmVanRaw =
|
||||
(familyPrice > 0 ? familyPrice : (speedPrice + 13));
|
||||
final double perKmElectricRaw = perKmComfortRaw + electricPerKmUplift;
|
||||
|
||||
double perKmComfort = perKmComfortRaw * (1.0 - distanceReduction);
|
||||
double perKmElectric = perKmElectricRaw * (1.0 - distanceReduction);
|
||||
double perKmVan = perKmVanRaw * (1.0 - distanceReduction);
|
||||
perKmComfort = perKmComfort.clamp(0, double.infinity);
|
||||
perKmElectric = perKmElectric.clamp(0, double.infinity);
|
||||
perKmVan = perKmVan.clamp(0, double.infinity);
|
||||
final double perKmBalash = (perKmSpeed - 5).clamp(0, double.infinity);
|
||||
|
||||
double _oneWayFare({
|
||||
required double perKm,
|
||||
required bool isLady,
|
||||
double flatAddon = 0,
|
||||
}) {
|
||||
double fare = billableDistance * perKm;
|
||||
fare += billableMinutes * effectivePerMin;
|
||||
fare += flatAddon;
|
||||
if (isLady) fare += ladyFlatAddon;
|
||||
if (airportCtx) fare += airportAddonSYP;
|
||||
|
||||
if (damascusAirportBoundCtx || isInDamascusAirportBoundCtx) {
|
||||
fare += damascusAirportBoundAddon;
|
||||
}
|
||||
return _applyMinFare(fare);
|
||||
}
|
||||
|
||||
double _roundTripFare({required double perKm}) {
|
||||
double distPart =
|
||||
(billableDistance * 2 * perKm) - ((billableDistance * perKm) * 0.4);
|
||||
double timePart = (billableMinutes * 2) * effectivePerMin;
|
||||
double fare = distPart + timePart;
|
||||
if (airportCtx) fare += airportAddonSYP;
|
||||
|
||||
if (damascusAirportBoundCtx || isInDamascusAirportBoundCtx) {
|
||||
fare += damascusAirportBoundAddon;
|
||||
}
|
||||
return _applyMinFare(fare);
|
||||
}
|
||||
|
||||
final double costSpeed = _oneWayFare(perKm: perKmSpeed, isLady: false);
|
||||
final double costBalash = _oneWayFare(perKm: perKmBalash, isLady: false);
|
||||
final double costComfort = _oneWayFare(perKm: perKmComfort, isLady: false);
|
||||
final double costElectric = _oneWayFare(
|
||||
perKm: perKmElectric, isLady: false, flatAddon: electricFlatAddon);
|
||||
final double costDelivery =
|
||||
_oneWayFare(perKm: perKmDelivery, isLady: false);
|
||||
final double costLady = _oneWayFare(perKm: perKmComfort, isLady: true);
|
||||
final double costVan = _oneWayFare(perKm: perKmVan, isLady: false);
|
||||
final double costRayehGai = _roundTripFare(perKm: perKmSpeed);
|
||||
final double costRayehGaiComfort = _roundTripFare(perKm: perKmComfort);
|
||||
final double costRayehGaiBalash = _roundTripFare(perKm: perKmBalash);
|
||||
|
||||
totalPassengerSpeed = _withCommission(costSpeed);
|
||||
totalPassengerBalash = _withCommission(costBalash);
|
||||
totalPassengerComfort = _withCommission(costComfort);
|
||||
totalPassengerElectric = _withCommission(costElectric);
|
||||
totalPassengerLady = _withCommission(costLady);
|
||||
totalPassengerScooter = _withCommission(costDelivery);
|
||||
totalPassengerVan = _withCommission(costVan);
|
||||
totalPassengerRayehGai = _withCommission(costRayehGai);
|
||||
totalPassengerRayehGaiComfort = _withCommission(costRayehGaiComfort);
|
||||
totalPassengerRayehGaiBalash = _withCommission(costRayehGaiBalash);
|
||||
|
||||
totalPassenger = totalPassengerSpeed;
|
||||
totalCostPassenger = totalPassenger;
|
||||
|
||||
try {
|
||||
final walletStr = box.read(BoxName.passengerWalletTotal).toString();
|
||||
final walletVal = double.tryParse(walletStr) ?? 0.0;
|
||||
if (walletVal < 0) {
|
||||
final neg = (-1) * walletVal;
|
||||
totalPassenger += neg;
|
||||
totalPassengerComfort += neg;
|
||||
totalPassengerElectric += neg;
|
||||
totalPassengerLady += neg;
|
||||
totalPassengerBalash += neg;
|
||||
totalPassengerScooter += neg;
|
||||
totalPassengerRayehGai += neg;
|
||||
totalPassengerRayehGaiComfort += neg;
|
||||
totalPassengerRayehGaiBalash += neg;
|
||||
totalPassengerVan += neg;
|
||||
final res = await CRUD().post(link: AppLink.getPrices, payload: {
|
||||
'distance': distance.toString(),
|
||||
'durationToRide': durationToRide.toString(),
|
||||
'startNameAddress': startNameAddress,
|
||||
'endNameAddress': endNameAddress,
|
||||
'destLat': myDestination.latitude.toString(),
|
||||
'destLng': myDestination.longitude.toString(),
|
||||
'passengerLat': newMyLocation.latitude.toString(),
|
||||
'passengerLng': newMyLocation.longitude.toString(),
|
||||
'walletVal': box.read(BoxName.passengerWalletTotal)?.toString() ?? '0',
|
||||
'activeMenuWaypointCount': activeMenuWaypointCount.toString(),
|
||||
'passenger_id': box.read(BoxName.passengerID) ?? '',
|
||||
'country': box.read(BoxName.countryCode) ?? '',
|
||||
});
|
||||
|
||||
if (res != 'failure') {
|
||||
var response = jsonDecode(res);
|
||||
if (response['status'] == 'success') {
|
||||
var data = response['data'];
|
||||
totalPassengerSpeed = data['totalPassengerSpeed']?.toString() ?? '0';
|
||||
totalPassengerBalash = data['totalPassengerBalash']?.toString() ?? '0';
|
||||
totalPassengerComfort = data['totalPassengerComfort']?.toString() ?? '0';
|
||||
totalPassengerElectric = data['totalPassengerElectric']?.toString() ?? '0';
|
||||
totalPassengerLady = data['totalPassengerLady']?.toString() ?? '0';
|
||||
totalPassengerScooter = data['totalPassengerScooter']?.toString() ?? '0';
|
||||
totalPassengerVan = data['totalPassengerVan']?.toString() ?? '0';
|
||||
totalPassengerRayehGai = data['totalPassengerRayehGai']?.toString() ?? '0';
|
||||
totalPassengerRayehGaiComfort = data['totalPassengerRayehGaiComfort']?.toString() ?? '0';
|
||||
totalPassengerRayehGaiBalash = data['totalPassengerRayehGaiBalash']?.toString() ?? '0';
|
||||
|
||||
totalPassenger = totalPassengerSpeed;
|
||||
totalCostPassenger = totalPassenger;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
Log.print("Error: $e");
|
||||
Log.print("Error fetching prices: $e");
|
||||
}
|
||||
|
||||
update();
|
||||
@@ -2694,7 +2426,7 @@ class RideLifecycleController extends GetxController {
|
||||
"end_location": '${endLoc.latitude},${endLoc.longitude}',
|
||||
"date": DateTime.now().toString(),
|
||||
"time": DateTime.now().toString(),
|
||||
"price": totalPassenger.toStringAsFixed(2),
|
||||
"price": double.parse(totalPassenger.toString()).toStringAsFixed(2),
|
||||
'passenger_id': box.read(BoxName.passengerID).toString(),
|
||||
'status': 'waiting',
|
||||
'carType': box.read(BoxName.carType),
|
||||
@@ -2720,144 +2452,9 @@ class RideLifecycleController extends GetxController {
|
||||
double familyPrice = 55;
|
||||
double deliveryPrice = 1.2;
|
||||
|
||||
Future<void> getKazanPercent() async {
|
||||
var res = await CRUD().get(
|
||||
link: AppLink.getKazanPercent,
|
||||
payload: {'country': box.read(BoxName.countryCode).toString()},
|
||||
);
|
||||
if (res != 'failure') {
|
||||
var json = jsonDecode(res);
|
||||
var dataList = json['data'] ?? json['message'];
|
||||
|
||||
if (dataList != null && dataList is List && dataList.isNotEmpty) {
|
||||
var firstRow = dataList[0];
|
||||
kazan = double.parse(firstRow['kazan'].toString());
|
||||
naturePrice = double.parse(firstRow['naturePrice'].toString());
|
||||
heavyPrice = double.parse(firstRow['heavyPrice'].toString());
|
||||
latePrice = double.parse(firstRow['latePrice'].toString());
|
||||
comfortPrice = double.parse(firstRow['comfortPrice'].toString());
|
||||
speedPrice = double.parse(firstRow['speedPrice'].toString());
|
||||
deliveryPrice = double.parse(firstRow['deliveryPrice'].toString());
|
||||
mashwariPrice = double.parse(firstRow['freePrice'].toString());
|
||||
familyPrice = double.parse(firstRow['familyPrice'].toString());
|
||||
fuelPrice = double.parse(firstRow['fuelPrice'].toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> getPassengerRate() async {
|
||||
var res = await CRUD().get(
|
||||
link: AppLink.getPassengerRate,
|
||||
payload: {'passenger_id': box.read(BoxName.passengerID)});
|
||||
if (res != 'failure') {
|
||||
var json = jsonDecode(res);
|
||||
var message = json['data'] ?? json['message'];
|
||||
if (message['rating'] == null) {
|
||||
passengerRate = 5.0;
|
||||
} else {
|
||||
var rating = message['rating'];
|
||||
if (rating is String) {
|
||||
passengerRate = double.tryParse(rating) ?? 5.0;
|
||||
} else if (rating is num) {
|
||||
passengerRate = rating.toDouble();
|
||||
} else {
|
||||
passengerRate = 5.0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
passengerRate = 5.0;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> addFingerPrint() async {
|
||||
String fingerPrint = await DeviceHelper.getDeviceFingerprint();
|
||||
await CRUD().postWallet(link: AppLink.addFingerPrint, payload: {
|
||||
'token': (box.read(BoxName.tokenFCM.toString())),
|
||||
'passengerID': box.read(BoxName.passengerID).toString(),
|
||||
"fingerPrint": fingerPrint
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> firstTimeRunToGetCoupon() async {
|
||||
if (box.read(BoxName.isFirstTime).toString() == '0' &&
|
||||
box.read(BoxName.isInstall).toString() == '1' &&
|
||||
box.read(BoxName.isGiftToken).toString() == '0') {
|
||||
var promoCode, discount, validity;
|
||||
var resPromo = await CRUD().get(link: AppLink.getPromoFirst, payload: {
|
||||
"passengerID": box.read(BoxName.passengerID).toString(),
|
||||
});
|
||||
if (resPromo != 'failure') {
|
||||
var d1 = jsonDecode(resPromo);
|
||||
promoCode = d1['message']['promo_code'];
|
||||
discount = d1['message']['amount'];
|
||||
validity = d1['message']['validity_end_date'];
|
||||
}
|
||||
box.write(BoxName.isFirstTime, '1');
|
||||
|
||||
Get.dialog(
|
||||
AlertDialog(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
content: SizedBox(
|
||||
width: 300,
|
||||
child: PromoBanner(
|
||||
promoCode: promoCode,
|
||||
discountPercentage: discount,
|
||||
validity: validity,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> detectAndCacheDeviceTier() async {
|
||||
bool isHighEnd = await DevicePerformanceManager.isHighEndDevice();
|
||||
Log.print("Device Analysis - Is Flagship/HighEnd? $isHighEnd");
|
||||
box.write(BoxName.lowEndMode, !isHighEnd);
|
||||
}
|
||||
|
||||
Future<void> initilizeGetStorage() async {
|
||||
if (box.read(BoxName.addWork) == null) {
|
||||
box.write(BoxName.addWork, 'addWork');
|
||||
}
|
||||
if (box.read(BoxName.addHome) == null) {
|
||||
box.write(BoxName.addHome, 'addHome');
|
||||
}
|
||||
if (box.read(BoxName.lowEndMode) == null) {
|
||||
detectAndCacheDeviceTier();
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> selectDriverAndCarForMishwariTrip() async {
|
||||
double latitudeOffset = 0.1;
|
||||
double longitudeOffset = 0.12;
|
||||
|
||||
double southwestLat = passengerLocation.latitude - latitudeOffset;
|
||||
double northeastLat = passengerLocation.latitude + latitudeOffset;
|
||||
double southwestLon = passengerLocation.longitude - longitudeOffset;
|
||||
double northeastLon = passengerLocation.longitude + longitudeOffset;
|
||||
|
||||
var payload = {
|
||||
'southwestLat': southwestLat.toString(),
|
||||
'northeastLat': northeastLat.toString(),
|
||||
'southwestLon': southwestLon.toString(),
|
||||
'northeastLon': northeastLon.toString(),
|
||||
};
|
||||
|
||||
Future selectDriverAndCarForMishwariTrip() async {
|
||||
try {
|
||||
var res = await CRUD().get(
|
||||
link: AppLink.selectDriverAndCarForMishwariTrip, payload: payload);
|
||||
|
||||
if (res != 'failure') {
|
||||
try {
|
||||
var d = jsonDecode(res);
|
||||
driversForMishwari = d['message'];
|
||||
Log.print('driversForMishwari: $driversForMishwari');
|
||||
update();
|
||||
} catch (e) {
|
||||
Log.print("Error decoding JSON: $e");
|
||||
}
|
||||
}
|
||||
// Logic for mishwari trip driver selection
|
||||
} catch (e) {
|
||||
Log.print("Error Mishwari select: $e");
|
||||
}
|
||||
@@ -4311,7 +3908,6 @@ class RideLifecycleController extends GetxController {
|
||||
|
||||
Future<void> _stagePricingAndState() async {
|
||||
try {
|
||||
await getKazanPercent();
|
||||
} catch (e) {
|
||||
Log.print("Error: $e");
|
||||
}
|
||||
@@ -4663,4 +4259,68 @@ class RideLifecycleController extends GetxController {
|
||||
mapEngine.update();
|
||||
update();
|
||||
}
|
||||
initilizeGetStorage() async {
|
||||
if (box.read(BoxName.addWork) == null) {
|
||||
box.write(BoxName.addWork, 'addWork');
|
||||
}
|
||||
if (box.read(BoxName.addHome) == null) {
|
||||
box.write(BoxName.addHome, 'addHome');
|
||||
}
|
||||
}
|
||||
|
||||
getPassengerRate() async {
|
||||
var res = await CRUD().get(
|
||||
link: AppLink.getPassengerRate,
|
||||
payload: {'passenger_id': box.read(BoxName.passengerID)});
|
||||
if (res != 'failure') {
|
||||
var json = jsonDecode(res);
|
||||
var message = json['data'] ?? json['message'];
|
||||
if (message['rating'] == null) {
|
||||
passengerRate = 5.0; // Default rating
|
||||
} else {
|
||||
var rating = message['rating'];
|
||||
if (rating is String) {
|
||||
passengerRate = double.tryParse(rating) ?? 5.0;
|
||||
} else if (rating is num) {
|
||||
passengerRate = rating.toDouble();
|
||||
} else {
|
||||
passengerRate = 5.0;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
passengerRate = 5.0;
|
||||
}
|
||||
}
|
||||
|
||||
firstTimeRunToGetCoupon() async {
|
||||
if (box.read(BoxName.isFirstTime).toString() == '0' &&
|
||||
box.read(BoxName.isInstall).toString() == '1' &&
|
||||
box.read(BoxName.isGiftToken).toString() == '0') {
|
||||
var promo, discount, validity;
|
||||
var resPromo = await CRUD().get(link: AppLink.getPromoFirst, payload: {
|
||||
"passengerID": box.read(BoxName.passengerID).toString(),
|
||||
});
|
||||
if (resPromo != 'failure') {
|
||||
var d1 = jsonDecode(resPromo);
|
||||
promo = d1['message']['promo_code'];
|
||||
discount = d1['message']['amount'];
|
||||
validity = d1['message']['validity_end_date'];
|
||||
}
|
||||
box.write(BoxName.isFirstTime, '1');
|
||||
Get.dialog(
|
||||
AlertDialog(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
content: SizedBox(
|
||||
width: 300,
|
||||
child: PromoBanner(
|
||||
promoCode: promo ?? '',
|
||||
discountPercentage: discount ?? '',
|
||||
validity: validity ?? '',
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import '../../functions/crud.dart';
|
||||
import '../../functions/tts.dart';
|
||||
import 'ride_lifecycle_controller.dart';
|
||||
import 'location_search_controller.dart';
|
||||
import '../../functions/country_logic.dart';
|
||||
|
||||
class UiInteractionsController extends GetxController {
|
||||
TextEditingController sosPhonePassengerProfile = TextEditingController();
|
||||
@@ -58,7 +59,8 @@ class UiInteractionsController extends GetxController {
|
||||
MyTextForm(
|
||||
controller: sosPhonePassengerProfile,
|
||||
label: 'insert sos phone'.tr,
|
||||
hint: 'e.g. 0912345678 (Default +963)'.tr,
|
||||
hint: CountryLogic.getPhoneHint(
|
||||
box.read(BoxName.countryCode) ?? 'Syria').tr,
|
||||
type: TextInputType.phone,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
@@ -77,7 +79,7 @@ class UiInteractionsController extends GetxController {
|
||||
if (sosFormKey.currentState!.validate()) {
|
||||
Get.back();
|
||||
var numberPhone =
|
||||
formatSyrianPhoneNumber(sosPhonePassengerProfile.text);
|
||||
CountryLogic.formatCurrentCountryPhone(sosPhonePassengerProfile.text);
|
||||
|
||||
await CRUD().post(
|
||||
link: AppLink.updateprofile,
|
||||
@@ -160,36 +162,7 @@ class UiInteractionsController extends GetxController {
|
||||
'whatsapp', box.read(BoxName.sosPhonePassenger), message);
|
||||
}
|
||||
|
||||
String formatSyrianPhone(String phone) {
|
||||
phone = phone.replaceAll(' ', '').replaceAll('+', '');
|
||||
if (phone.startsWith('00963')) {
|
||||
phone = phone.replaceFirst('00963', '963');
|
||||
}
|
||||
if (phone.startsWith('0963')) {
|
||||
phone = phone.replaceFirst('0963', '963');
|
||||
}
|
||||
if (phone.startsWith('963')) {
|
||||
return phone;
|
||||
}
|
||||
if (phone.startsWith('09')) {
|
||||
return '963' + phone.substring(1);
|
||||
}
|
||||
if (phone.startsWith('9') && phone.length == 9) {
|
||||
return '963' + phone;
|
||||
}
|
||||
return phone;
|
||||
}
|
||||
|
||||
String formatSyrianPhoneNumber(String phoneNumber) {
|
||||
String trimmedPhone = phoneNumber.trim();
|
||||
if (trimmedPhone.startsWith('09')) {
|
||||
return '963${trimmedPhone.substring(1)}';
|
||||
}
|
||||
if (trimmedPhone.startsWith('963')) {
|
||||
return trimmedPhone;
|
||||
}
|
||||
return '963$trimmedPhone';
|
||||
}
|
||||
// removed formatSyrianPhone and formatSyrianPhoneNumber
|
||||
|
||||
void sendSMS(String to) async {
|
||||
final rideLifecycle = Get.find<RideLifecycleController>();
|
||||
@@ -205,7 +178,7 @@ class UiInteractionsController extends GetxController {
|
||||
void sendWhatsapp(String to) async {
|
||||
final rideLifecycle = Get.find<RideLifecycleController>();
|
||||
final locSearch = Get.find<LocationSearchController>();
|
||||
String formattedPhone = formatSyrianPhone(to);
|
||||
String formattedPhone = CountryLogic.formatCurrentCountryPhone(to);
|
||||
|
||||
String message =
|
||||
'${'${'Hi! This is'.tr} ${(box.read(BoxName.name).toString().split(' ')[0]).toString()}.\n${' I am using'.tr}'} ${AppInformation.appName}${' to ride with'.tr} ${rideLifecycle.passengerName}${' as the driver.'.tr} ${rideLifecycle.passengerName} \n${'is driving a '.tr}${rideLifecycle.model}\n${' with license plate '.tr}${rideLifecycle.licensePlate}.\n${' I am currently located at '.tr} https://www.google.com/maps/place/${locSearch.passengerLocation.latitude},${locSearch.passengerLocation.longitude}.\n${' If you need to reach me, please contact the driver directly at'.tr}\n\n ${rideLifecycle.driverPhone}.';
|
||||
@@ -286,7 +259,7 @@ class UiInteractionsController extends GetxController {
|
||||
return;
|
||||
}
|
||||
|
||||
var numberPhone = formatSyrianPhoneNumber(storedPhone);
|
||||
var numberPhone = CountryLogic.formatCurrentCountryPhone(storedPhone);
|
||||
String trackingLink = rideLifecycle.generateTrackingLink(
|
||||
rideLifecycle.rideId, rideLifecycle.driverId);
|
||||
|
||||
@@ -326,7 +299,7 @@ Thank you for using Siro!
|
||||
Future getTokenForParent() async {
|
||||
_ensureSosNumber(() async {
|
||||
String storedPhone = box.read(BoxName.sosPhonePassenger)!;
|
||||
var numberPhone = formatSyrianPhoneNumber(storedPhone);
|
||||
var numberPhone = CountryLogic.formatCurrentCountryPhone(storedPhone);
|
||||
Log.print("Searching for Parent Token with Phone: $numberPhone");
|
||||
|
||||
var res = await CRUD()
|
||||
@@ -375,7 +348,7 @@ Thank you for using Siro!
|
||||
Get.back();
|
||||
var rawPhone = box.read(BoxName.sosPhonePassenger);
|
||||
if (rawPhone == null) return;
|
||||
var phone = formatSyrianPhoneNumber(rawPhone);
|
||||
var phone = CountryLogic.formatCurrentCountryPhone(rawPhone);
|
||||
|
||||
var message = '''Dear Friend,
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// import 'dart:async';
|
||||
// import 'package:siro_rider/constant/currency.dart';
|
||||
import 'dart:async';
|
||||
// import 'package:siro_rider/services/offline_map_service.dart';
|
||||
// import 'package:siro_rider/services/emergency_signal_service.dart';
|
||||
// import 'package:siro_rider/views/widgets/mycircular.dart';
|
||||
@@ -6559,8 +6560,8 @@
|
||||
// if (!promoFormKey.currentState!.validate()) return;
|
||||
|
||||
// // العتبات بالليرة السورية
|
||||
// const double minPromoLowSYP = 172; // Speed / Balash
|
||||
// const double minPromoHighSYP = 200; // Comfort / Electric / Lady
|
||||
// const double minPromoLow${CurrencyHelper.currency} = 172; // Speed / Balash
|
||||
// const double minPromoHigh${CurrencyHelper.currency} = 200; // Comfort / Electric / Lady
|
||||
|
||||
// try {
|
||||
// final value = await CRUD().get(
|
||||
@@ -6723,10 +6724,10 @@
|
||||
// // if (data.isEmpty) return;
|
||||
|
||||
// // === إعدادات عامة ===
|
||||
// const double minFareSYP = 160; // حد أدنى
|
||||
// const double minFare${CurrencyHelper.currency} = 160; // حد أدنى
|
||||
// const double minBillableKm = 0.3; // حد أدنى للمسافة المفوترة
|
||||
// const double ladyFlatAddon = 20; // إضافة ثابتة لـ Lady
|
||||
// const double airportAddonSYP = 200; // إضافة المطار
|
||||
// const double airportAddon${CurrencyHelper.currency} = 200; // إضافة المطار
|
||||
|
||||
// // --- ⬇️ الإضافة الجديدة: إضافة حدود مطار دمشق ⬇️ ---
|
||||
// const double damascusAirportBoundAddon = 1400; // إضافة المطار (حدود)
|
||||
@@ -6814,7 +6815,7 @@
|
||||
|
||||
// // حد أدنى
|
||||
// double _applyMinFare(double fare) =>
|
||||
// (fare < minFareSYP) ? minFareSYP : fare;
|
||||
// (fare < minFareSYP) ? minFare${CurrencyHelper.currency} : fare;
|
||||
|
||||
// // عمولة الراكب (kazan من السيرفر)
|
||||
// double _withCommission(double base) =>
|
||||
@@ -7341,7 +7342,7 @@
|
||||
// double mashwariPrice = 40;
|
||||
// double familyPrice = 55;
|
||||
// double deliveryPrice = 1.2;
|
||||
// double minFareSYP = 16000; // حد أدنى للأجرة (سوريا)
|
||||
// double minFare${CurrencyHelper.currency} = 16000; // حد أدنى للأجرة (سوريا)
|
||||
// double minBillableKm = 1.0; // حد أدنى للمسافة المفوترة
|
||||
// double commissionPct = 15; // عمولة التطبيق % (راكب)
|
||||
|
||||
|
||||
@@ -302,18 +302,30 @@ ${'Download the Siro app now and enjoy your ride!'.tr}
|
||||
'${'Claim your 20 LE gift for inviting'.tr} $passengerName!',
|
||||
() async {
|
||||
Get.back(); // Close dialog first
|
||||
await Get.find<PaymentController>().addPassengersWallet('20');
|
||||
await CRUD().post(
|
||||
link: AppLink.updatePassengerGift,
|
||||
payload: {'id': invitation['id']},
|
||||
|
||||
var response = await CRUD().post(
|
||||
link: AppLink.claimInviteReward,
|
||||
payload: {
|
||||
'invite_id': invitation['id'].toString(),
|
||||
'passenger_id': box.read(BoxName.passengerID).toString(),
|
||||
'country_code': box.read(BoxName.countryCode).toString(),
|
||||
},
|
||||
);
|
||||
NotificationCaptainController().addNotificationCaptain(
|
||||
invitation['passengerInviterId'].toString(),
|
||||
"You have got a gift for invitation".tr,
|
||||
'${"You have earned 20".tr} ${'LE'}',
|
||||
false,
|
||||
);
|
||||
fetchDriverStatsPassengers(); // Refresh list
|
||||
|
||||
if (response != 'failure') {
|
||||
var data = jsonDecode(response);
|
||||
if (data['status'] == 'success') {
|
||||
NotificationCaptainController().addNotificationCaptain(
|
||||
invitation['passengerInviterId'].toString(),
|
||||
"You have got a gift for invitation".tr,
|
||||
'${"You have earned 20".tr} ${'LE'}',
|
||||
false,
|
||||
);
|
||||
fetchDriverStatsPassengers(); // Refresh list
|
||||
} else {
|
||||
Get.snackbar('Error'.tr, data['message'] ?? 'Claim failed'.tr, backgroundColor: AppColor.redColor);
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
} else {
|
||||
|
||||
@@ -286,6 +286,8 @@ class MyTranslation extends Translations {
|
||||
"you must insert token code": "لازم تدخل الكود",
|
||||
"Syria": "سوريا",
|
||||
"SYP": "ل.س",
|
||||
"EGP": "ج.م",
|
||||
"JOD": "د.أ",
|
||||
"Order": "طلب",
|
||||
"OrderVIP": "طلب VIP",
|
||||
"Cancel Trip": "إلغاء المشوار",
|
||||
@@ -1700,6 +1702,8 @@ class MyTranslation extends Translations {
|
||||
"ar-main": {
|
||||
"Syria": "سوريا",
|
||||
"SYP": "ل.س",
|
||||
"EGP": "ج.م",
|
||||
"JOD": "د.أ",
|
||||
"Order": "طلب",
|
||||
"OrderVIP": "طلب VIP",
|
||||
"Cancel Trip": "إلغاء الرحلة",
|
||||
@@ -3127,6 +3131,8 @@ class MyTranslation extends Translations {
|
||||
"ar-eg": {
|
||||
"Syria": "سوريا",
|
||||
"SYP": "ل.س",
|
||||
"EGP": "ج.م",
|
||||
"JOD": "د.أ",
|
||||
"Order": "طلب",
|
||||
"OrderVIP": "طلب VIP",
|
||||
"Cancel Trip": "إلغاء المشوار",
|
||||
@@ -4542,6 +4548,8 @@ class MyTranslation extends Translations {
|
||||
"AR-Gulf": {
|
||||
"Syria": "سوريا",
|
||||
"SYP": "ل.س",
|
||||
"EGP": "ج.م",
|
||||
"JOD": "د.أ",
|
||||
"Order": "طلب",
|
||||
"OrderVIP": "طلب VIP",
|
||||
"Cancel Trip": "إلغاء الرحلة",
|
||||
@@ -5960,6 +5968,8 @@ class MyTranslation extends Translations {
|
||||
"ar-ma": {
|
||||
"Syria": "سوريا",
|
||||
"SYP": "ل.س",
|
||||
"EGP": "ج.م",
|
||||
"JOD": "د.أ",
|
||||
"Order": "طلب",
|
||||
"OrderVIP": "طلب VIP",
|
||||
"Cancel Trip": "إلغي الرحلة",
|
||||
@@ -7571,6 +7581,8 @@ class MyTranslation extends Translations {
|
||||
"you must insert token code": "you must insert token code",
|
||||
"Syria": "Suriye",
|
||||
"SYP": "SYP",
|
||||
"EGP": "EGP",
|
||||
"JOD": "JOD",
|
||||
"Order": "Sipariş",
|
||||
"OrderVIP": "VIP Sipariş",
|
||||
"Cancel Trip": "Yolculuğu İptal Et",
|
||||
@@ -9099,6 +9111,8 @@ class MyTranslation extends Translations {
|
||||
"you must insert token code": "you must insert token code",
|
||||
"Syria": "Syrie",
|
||||
"SYP": "SYP",
|
||||
"EGP": "EGP",
|
||||
"JOD": "JOD",
|
||||
"Order": "Commande",
|
||||
"OrderVIP": "Commande VIP",
|
||||
"Cancel Trip": "Annuler le trajet",
|
||||
@@ -10669,6 +10683,8 @@ class MyTranslation extends Translations {
|
||||
"you must insert token code": "you must insert token code",
|
||||
"Syria": "Syrien",
|
||||
"SYP": "SYP",
|
||||
"EGP": "EGP",
|
||||
"JOD": "JOD",
|
||||
"Order": "Bestellung",
|
||||
"OrderVIP": "VIP-Bestellung",
|
||||
"Cancel Trip": "Fahrt stornieren",
|
||||
@@ -12418,6 +12434,8 @@ class MyTranslation extends Translations {
|
||||
"you must insert token code": "you must insert token code",
|
||||
"Syria": "Siria",
|
||||
"SYP": "SYP",
|
||||
"EGP": "EGP",
|
||||
"JOD": "JOD",
|
||||
"Order": "Pedido",
|
||||
"OrderVIP": "Pedido VIP",
|
||||
"Cancel Trip": "Cancelar viaje",
|
||||
@@ -14160,6 +14178,8 @@ class MyTranslation extends Translations {
|
||||
"you must insert token code": "you must insert token code",
|
||||
"Syria": "سوریه",
|
||||
"SYP": "لیره سوریه",
|
||||
"EGP": "EGP",
|
||||
"JOD": "JOD",
|
||||
"Order": "درخواست",
|
||||
"OrderVIP": "درخواست VIP",
|
||||
"Cancel Trip": "لغو سفر",
|
||||
@@ -15666,6 +15686,8 @@ class MyTranslation extends Translations {
|
||||
"you must insert token code": "you must insert token code",
|
||||
"Syria": "Συρία",
|
||||
"SYP": "SYP",
|
||||
"EGP": "EGP",
|
||||
"JOD": "JOD",
|
||||
"Order": "Αίτημα",
|
||||
"OrderVIP": "VIP Αίτημα",
|
||||
"Cancel Trip": "Ακύρωση Διαδρομής",
|
||||
@@ -17159,6 +17181,8 @@ class MyTranslation extends Translations {
|
||||
"you must insert token code": "you must insert token code",
|
||||
"Syria": "شام",
|
||||
"SYP": "شامی پاؤن",
|
||||
"EGP": "EGP",
|
||||
"JOD": "JOD",
|
||||
"Order": "آرڈر",
|
||||
"OrderVIP": "VIP آرڈر",
|
||||
"Cancel Trip": "سفر منسوخ کریں",
|
||||
@@ -18721,6 +18745,8 @@ class MyTranslation extends Translations {
|
||||
"you must insert token code": "you must insert token code",
|
||||
"Syria": "भारत",
|
||||
"SYP": "₹",
|
||||
"EGP": "EGP",
|
||||
"JOD": "JOD",
|
||||
"Order": "ऑर्डर",
|
||||
"OrderVIP": "VIP ऑर्डर",
|
||||
"Cancel Trip": "ट्रिप रद्द करें",
|
||||
@@ -20281,6 +20307,8 @@ class MyTranslation extends Translations {
|
||||
"you must insert token code": "you must insert token code",
|
||||
"Syria": "Сирия",
|
||||
"SYP": "SYP",
|
||||
"EGP": "EGP",
|
||||
"JOD": "JOD",
|
||||
"Order": "Заказ",
|
||||
"OrderVIP": "VIP Заказ",
|
||||
"Cancel Trip": "Отменить поездку",
|
||||
@@ -21745,6 +21773,8 @@ class MyTranslation extends Translations {
|
||||
"you must insert token code": "you must insert token code",
|
||||
"Syria": "Siria",
|
||||
"SYP": "SYP",
|
||||
"EGP": "EGP",
|
||||
"JOD": "JOD",
|
||||
"Order": "Ordine",
|
||||
"OrderVIP": "Ordine VIP",
|
||||
"Cancel Trip": "Annulla corsa",
|
||||
@@ -23244,6 +23274,8 @@ class MyTranslation extends Translations {
|
||||
"you must insert token code": "you must insert token code",
|
||||
"Syria": "叙利亚",
|
||||
"SYP": "叙利亚镑",
|
||||
"EGP": "EGP",
|
||||
"JOD": "JOD",
|
||||
"Order": "طلب",
|
||||
"OrderVIP": "طلب VIP",
|
||||
"Cancel Trip": "إلغاء المشوار",
|
||||
|
||||
@@ -1,29 +1,21 @@
|
||||
import 'dart:convert';
|
||||
import 'package:siro_rider/constant/api_key.dart';
|
||||
import 'package:siro_rider/constant/style.dart';
|
||||
import 'package:siro_rider/controller/firebase/firbase_messge.dart';
|
||||
import 'package:siro_rider/controller/payment/paymob/paymob_response.dart';
|
||||
import 'package:siro_rider/views/home/map_page_passenger.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:local_auth/local_auth.dart';
|
||||
import 'package:siro_rider/controller/home/map/ride_lifecycle_controller.dart';
|
||||
import 'package:siro_rider/controller/home/map/ride_state.dart';
|
||||
import 'package:siro_rider/controller/home/map/ride_state.dart';
|
||||
import 'package:webview_flutter/webview_flutter.dart';
|
||||
|
||||
import '../../constant/box_name.dart';
|
||||
import '../../constant/colors.dart';
|
||||
import '../../constant/info.dart';
|
||||
import '../../constant/links.dart';
|
||||
import '../../main.dart';
|
||||
import '../../print.dart';
|
||||
import '../firebase/notification_service.dart';
|
||||
import '../functions/crud.dart';
|
||||
import '../functions/encrypt_decrypt.dart';
|
||||
import '../functions/toast.dart';
|
||||
import 'paymob/e_cash_screen.dart';
|
||||
import '../../views/home/my_wallet/payment_screen_mtn.dart';
|
||||
import '../../views/home/my_wallet/payment_screen_cliq.dart';
|
||||
|
||||
class PaymentController extends GetxController {
|
||||
bool isLoading = false;
|
||||
@@ -34,7 +26,8 @@ class PaymentController extends GetxController {
|
||||
final formKey = GlobalKey<FormState>();
|
||||
final promo = TextEditingController();
|
||||
final walletphoneController = TextEditingController();
|
||||
double totalPassenger = Get.find<RideLifecycleController>().totalPassenger;
|
||||
double totalPassenger = double.parse(
|
||||
Get.find<RideLifecycleController>().totalPassenger.toString());
|
||||
int? selectedAmount = 0;
|
||||
List<dynamic> totalPassengerWalletDetails = [];
|
||||
String passengerTotalWalletAmount = '';
|
||||
@@ -67,6 +60,20 @@ class PaymentController extends GetxController {
|
||||
}
|
||||
|
||||
String paymentToken = '';
|
||||
|
||||
Future<void> addPassengersWallet(String amount) async {
|
||||
try {
|
||||
await CRUD().postWallet(link: AppLink.addPassengersWallet, payload: {
|
||||
'passenger_id': box.read(BoxName.passengerID).toString(),
|
||||
'amount': amount,
|
||||
});
|
||||
await getPassengerWallet();
|
||||
} catch (e) {
|
||||
Log.print(e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Future<String> generateTokenPassenger(String amount) async {
|
||||
var res =
|
||||
await CRUD().post(link: AppLink.addPaymentTokenPassenger, payload: {
|
||||
@@ -86,27 +93,8 @@ class PaymentController extends GetxController {
|
||||
return d['message'];
|
||||
}
|
||||
|
||||
Future addSeferWallet(String paymentMethod, point) async {
|
||||
var seferToken = await generateTokenPassenger(point);
|
||||
await CRUD().postWallet(link: AppLink.addSeferWallet, payload: {
|
||||
'amount': point.toString(),
|
||||
'paymentMethod': paymentMethod,
|
||||
'passengerId': box.read(BoxName.passengerID).toString(),
|
||||
'token': seferToken,
|
||||
'driverId': 'passenger',
|
||||
});
|
||||
}
|
||||
|
||||
Future addPassengersWallet(String point) async {
|
||||
var token = await generateTokenPassenger(point);
|
||||
await CRUD().postWallet(link: AppLink.addPassengersWallet, payload: {
|
||||
'passenger_id': box.read(BoxName.passengerID).toString(),
|
||||
'balance': point,
|
||||
'token': token,
|
||||
});
|
||||
}
|
||||
|
||||
payToDriverForCancelAfterAppliedAndHeNearYou(String rideId) async {
|
||||
Future<void> payToDriverForCancelAfterAppliedAndHeNearYou(
|
||||
String rideId) async {
|
||||
{
|
||||
double costOfWaiting5Minute = box.read(BoxName.countryCode) == 'Egypt'
|
||||
? (4 * .08) + (5 * 1)
|
||||
@@ -135,14 +123,6 @@ class PaymentController extends GetxController {
|
||||
});
|
||||
|
||||
if (res != 'failure') {
|
||||
// Get.find<FirebaseMessagesController>().sendNotificationToDriverMAP(
|
||||
// 'Cancel',
|
||||
// 'Trip Cancelled. The cost of the trip will be added to your wallet.'
|
||||
// .tr,
|
||||
// Get.find<RideLifecycleController>().driverToken,
|
||||
// [],
|
||||
// 'cancel',
|
||||
// );
|
||||
await NotificationService.sendNotification(
|
||||
category: 'Cancel',
|
||||
target: Get.find<RideLifecycleController>().driverToken.toString(),
|
||||
@@ -157,7 +137,7 @@ class PaymentController extends GetxController {
|
||||
}
|
||||
var paymentTokenWaitPassenger1 =
|
||||
await generateTokenPassenger((costOfWaiting5Minute * -1).toString());
|
||||
await CRUD().post(link: AppLink.addPassengersWallet, payload: {
|
||||
await CRUD().postWallet(link: AppLink.addPassengersWallet, payload: {
|
||||
'passenger_id': box.read(BoxName.passengerID).toString(),
|
||||
'balance': (costOfWaiting5Minute * -1).toString(),
|
||||
'token': paymentTokenWaitPassenger1,
|
||||
@@ -166,27 +146,6 @@ class PaymentController extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
addPassengerWallet() async {
|
||||
isLoading = true;
|
||||
update();
|
||||
|
||||
await addSeferWallet('visa-in', selectedAmount.toString());
|
||||
await addPassengersWallet(selectedAmount == 100
|
||||
? '100'
|
||||
: selectedAmount == 200
|
||||
? '215'
|
||||
: selectedAmount == 400
|
||||
? '450'
|
||||
: selectedAmount == 1000
|
||||
? '1140'
|
||||
: '0');
|
||||
|
||||
// getPassengerWallet();
|
||||
|
||||
isLoading = false;
|
||||
update();
|
||||
}
|
||||
|
||||
void onChangedPaymentMethodWallet(bool? value) {
|
||||
if (box.read(BoxName.passengerWalletTotal) == null ||
|
||||
double.parse(box.read(BoxName.passengerWalletTotal).toString()) <
|
||||
@@ -215,28 +174,6 @@ class PaymentController extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
void applyPromoCodeToPassenger() async {
|
||||
//TAWJIHI
|
||||
CRUD().get(link: AppLink.getPassengersPromo, payload: {
|
||||
'promo_code': promo.text,
|
||||
}).then((value) {
|
||||
var decod = jsonDecode(value);
|
||||
|
||||
if (decod["status"] == "success") {
|
||||
var firstElement = decod["message"][0];
|
||||
totalPassenger = totalPassenger -
|
||||
(totalPassenger * int.parse(firstElement['amount']));
|
||||
Get.find<RideLifecycleController>().promoTaken = true;
|
||||
update();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 'https://accept.paymob.com/unifiedcheckout/?publicKey=egy_pk_live_mbjDC9Ni6FSHKmsz8sOHiVk2xd7oWRve&clientSecret=egy_sk_live_c0904e9cf04506ae64f818d4e075b4a957e3713fdf7a22cb7da30a29e72442b5'
|
||||
// أضف هذا الرابط إلى ملف AppLink الخاص بك
|
||||
|
||||
// هذه هي الدالة الجديدة التي ستستخدمها لبدء الدفع
|
||||
Future<void> payWithEcash(BuildContext context, String amount) async {
|
||||
try {
|
||||
// 1. يمكنك استخدام نفس طريقة التحقق بالبصمة إذا أردت
|
||||
@@ -293,225 +230,6 @@ class PaymentController extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
// Future<void> payWithEcashDriver(BuildContext context, String amount) async {
|
||||
// try {
|
||||
// // يمكنك استخدام نفس طريقة التحقق بالبصمة إذا أردت
|
||||
// bool isAvailable = await LocalAuthentication().isDeviceSupported();
|
||||
// if (isAvailable) {
|
||||
// bool didAuthenticate = await LocalAuthentication().authenticate(
|
||||
// localizedReason: 'Use Touch ID or Face ID to confirm payment'.tr,
|
||||
// );
|
||||
|
||||
// if (didAuthenticate) {
|
||||
// // استدعاء الـ Endpoint الجديد على السيرفر الخاص بك
|
||||
// var res = await CRUD().postWallet(
|
||||
// link: AppLink.payWithEcashPassenger,
|
||||
// // link:
|
||||
// // 'https://wl.tripz-egypt.com/v1/main/ride/ecash/driver/payWithEcash.php',
|
||||
// payload: {
|
||||
// // أرسل البيانات التي يحتاجها السيرفر
|
||||
// "amount": amount,
|
||||
// // "driverId": box.read(BoxName.driverID), // تأكد من وجود هذا المتغير
|
||||
// "passengerId":
|
||||
// box.read(BoxName.passengerID), // تأكد من وجود هذا المتغير
|
||||
// },
|
||||
// );
|
||||
|
||||
// // التأكد من أن السيرفر أعاد رابط الدفع بنجاح
|
||||
// if (res != null &&
|
||||
// res['status'] == 'success' &&
|
||||
// res['message'] != null) {
|
||||
// final String paymentUrl = res['message'];
|
||||
// // الانتقال إلى شاشة الدفع الجديدة الخاصة بـ ecash للسائق
|
||||
// Navigator.push(
|
||||
// context,
|
||||
// MaterialPageRoute(
|
||||
// builder: (context) =>
|
||||
// EcashDriverPaymentScreen(paymentUrl: paymentUrl),
|
||||
// ),
|
||||
// );
|
||||
// } else {
|
||||
// // عرض رسالة خطأ في حال فشل السيرفر في إنشاء الرابط
|
||||
// Get.defaultDialog(
|
||||
// title: 'Error'.tr,
|
||||
// content: Text(
|
||||
// 'Failed to initiate payment. Please try again.'.tr,
|
||||
// style: AppStyle.title,
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// } catch (e) {
|
||||
// Get.defaultDialog(
|
||||
// title: 'Error'.tr,
|
||||
// content: Text(
|
||||
// 'An error occurred during the payment process.'.tr,
|
||||
// style: AppStyle.title,
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
/// شاشة جديدة ومبسطة خاصة بدفع السائقين عبر ecash
|
||||
|
||||
// Future<void> payWithMTNWallet(
|
||||
// BuildContext context, String amount, String currency) async {
|
||||
// // خزن سياق علوي آمن من البداية
|
||||
// final BuildContext safeContext =
|
||||
// Get.overlayContext ?? Get.context ?? context;
|
||||
|
||||
// // سبينر تحميل
|
||||
// if (!(Get.isDialogOpen ?? false)) {
|
||||
// Get.dialog(const Center(child: CircularProgressIndicator()),
|
||||
// barrierDismissible: false);
|
||||
// }
|
||||
|
||||
// try {
|
||||
// final phone = box.read(BoxName.phoneWallet) as String;
|
||||
// final passengerID = box.read(BoxName.passengerID).toString();
|
||||
// final formattedAmount = double.parse(amount).toStringAsFixed(0);
|
||||
|
||||
// Log.print("🚀 بدء عملية دفع MTN");
|
||||
// Log.print(
|
||||
// "📦 Payload: passengerID: $passengerID, amount: $formattedAmount, phone: $phone");
|
||||
|
||||
// // التحقق بالبصمة (اختياري) + حماية من الـ await
|
||||
// final localAuth = LocalAuthentication();
|
||||
// final isAuthSupported = await localAuth.isDeviceSupported();
|
||||
// if (isAuthSupported) {
|
||||
// final didAuth = await localAuth.authenticate(
|
||||
// localizedReason: 'استخدم بصمة الإصبع أو الوجه لتأكيد الدفع',
|
||||
// );
|
||||
// if (!didAuth) {
|
||||
// if (Get.isDialogOpen == true) Get.back();
|
||||
// Log.print("❌ المستخدم لم يؤكد بالبصمة/الوجه");
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
|
||||
// // 1) بدء الدفع
|
||||
// final responseData = await CRUD().postWalletMtn(
|
||||
// link: AppLink.payWithMTNStart,
|
||||
// payload: {
|
||||
// "amount": formattedAmount,
|
||||
// "passengerId": passengerID,
|
||||
// "phone": phone,
|
||||
// "lang": box.read(BoxName.lang) ?? 'ar',
|
||||
// },
|
||||
// );
|
||||
|
||||
// // Log.print("✅ استجابة الخادم (mtn_start_payment.php):");
|
||||
// // Log.print(responseData);
|
||||
// Log.print('responseData: ${responseData}');
|
||||
|
||||
// // فحص الاستجابة بقوة
|
||||
// late final Map<String, dynamic> startRes;
|
||||
// if (responseData is Map<String, dynamic>) {
|
||||
// startRes = responseData;
|
||||
// } else if (responseData is String) {
|
||||
// startRes = json.decode(responseData) as Map<String, dynamic>;
|
||||
// } else {
|
||||
// throw Exception("تم استلام نوع بيانات غير متوقع من الخادم.");
|
||||
// }
|
||||
|
||||
// if (startRes['status'] != 'success') {
|
||||
// final errorMsg = startRes['message']['Error']?.toString().tr ??
|
||||
// "فشل بدء عملية الدفع. حاول مرة أخرى.";
|
||||
// throw Exception(errorMsg);
|
||||
// }
|
||||
|
||||
// final messageData = startRes["message"] as Map<String, dynamic>;
|
||||
// final invoiceNumber = messageData["invoiceNumber"].toString();
|
||||
// final operationNumber = messageData["operationNumber"].toString();
|
||||
// final guid = messageData["guid"].toString();
|
||||
|
||||
// // Log.print(
|
||||
// // "📄 invoiceNumber: $invoiceNumber, 🔢 operationNumber: $operationNumber, 🧭 guid: $guid");
|
||||
|
||||
// // أغلق السبينر قبل إظهار حوار OTP
|
||||
// if (Get.isDialogOpen == true) Get.back();
|
||||
|
||||
// // 2) إدخال OTP بـ Get.defaultDialog (لا يستخدم context قابل للتلف)
|
||||
// String otpInput = "";
|
||||
// await Get.defaultDialog(
|
||||
// title: "أدخل كود التحقق",
|
||||
// barrierDismissible: false,
|
||||
// content: TextField(
|
||||
// keyboardType: TextInputType.number,
|
||||
// decoration: const InputDecoration(hintText: "كود OTP"),
|
||||
// onChanged: (v) => otpInput = v,
|
||||
// ),
|
||||
// confirm: TextButton(
|
||||
// onPressed: () {
|
||||
// if (otpInput.isEmpty ||
|
||||
// otpInput.length < 4 ||
|
||||
// otpInput.length > 8) {
|
||||
// Get.snackbar("تنبيه", "أدخل كود OTP صحيح (4–8 أرقام)");
|
||||
// return;
|
||||
// }
|
||||
// Get.back(result: otpInput);
|
||||
// },
|
||||
// child: const Text("تأكيد"),
|
||||
// ),
|
||||
// cancel: TextButton(
|
||||
// onPressed: () => Get.back(result: null),
|
||||
// child: const Text("إلغاء"),
|
||||
// ),
|
||||
// ).then((res) => otpInput = (res ?? "") as String);
|
||||
|
||||
// if (otpInput.isEmpty) {
|
||||
// Log.print("❌ لم يتم إدخال OTP");
|
||||
// return;
|
||||
// }
|
||||
// Log.print("🔐 تم إدخال OTP: $otpInput");
|
||||
|
||||
// // سبينر أثناء التأكيد
|
||||
// Get.dialog(const Center(child: CircularProgressIndicator()),
|
||||
// barrierDismissible: false);
|
||||
|
||||
// // 3) تأكيد الدفع
|
||||
// final confirmRes = await CRUD().postWalletMtn(
|
||||
// link: AppLink.payWithMTNConfirm,
|
||||
// payload: {
|
||||
// "invoiceNumber": invoiceNumber,
|
||||
// "operationNumber": operationNumber,
|
||||
// "guid": guid,
|
||||
// "otp": otpInput,
|
||||
// "phone": phone,
|
||||
// "lang": box.read(BoxName.lang) ?? 'ar',
|
||||
// },
|
||||
// );
|
||||
|
||||
// if (Get.isDialogOpen == true) Get.back();
|
||||
|
||||
// // Log.print("✅ استجابة mtn_confirm.php:");
|
||||
// // Log.print('confirmRes: ${confirmRes}');
|
||||
|
||||
// final ok = (confirmRes is Map && confirmRes['status'] == 'success');
|
||||
// if (ok) {
|
||||
// Get.defaultDialog(
|
||||
// title: "✅ نجاح",
|
||||
// content: const Text("تمت عملية الدفع وإضافة الرصيد إلى محفظتك."),
|
||||
// );
|
||||
// await getPassengerWallet();
|
||||
// } else {
|
||||
// final errorMsg = (confirmRes['message']['message']?.toString()) ??
|
||||
// "فشل في تأكيد الدفع";
|
||||
// Get.defaultDialog(title: "❌ فشل", content: Text(errorMsg.tr));
|
||||
// }
|
||||
// } catch (e, s) {
|
||||
// Log.print("🔥 خطأ أثناء الدفع عبر MTN:");
|
||||
// Log.print(e);
|
||||
// Log.print(s);
|
||||
// if (Get.isDialogOpen == true) Get.back();
|
||||
// Get.defaultDialog(
|
||||
// title: 'حدث خطأ',
|
||||
// content: Text(e.toString().replaceFirst("Exception: ", "")),
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
|
||||
Future<void> payWithSyriaTelWallet(String amount, String currency) async {
|
||||
// helper لفتح لودينغ بأمان
|
||||
Future<void> _showLoading() async {
|
||||
@@ -661,6 +379,104 @@ class PaymentController extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> payWithMTNWallet(BuildContext context, String amount, String currency) async {
|
||||
try {
|
||||
final phone = walletphoneController.text.trim();
|
||||
if (phone.isEmpty) {
|
||||
Get.defaultDialog(title: 'Error'.tr, content: Text('Please enter phone number'.tr));
|
||||
return;
|
||||
}
|
||||
|
||||
Get.dialog(const Center(child: CircularProgressIndicator()), barrierDismissible: false);
|
||||
|
||||
var res = await CRUD().postWalletMtn(
|
||||
link: AppLink.createMtnInvoice,
|
||||
payload: {
|
||||
"amount": amount,
|
||||
"user_id": box.read(BoxName.passengerID).toString(),
|
||||
"user_type": "passenger",
|
||||
"mtn_phone": phone,
|
||||
},
|
||||
);
|
||||
|
||||
Get.back(); // close loading
|
||||
|
||||
late final Map<String, dynamic> resMap;
|
||||
if (res is Map<String, dynamic>) {
|
||||
resMap = res;
|
||||
} else if (res is String) {
|
||||
resMap = json.decode(res) as Map<String, dynamic>;
|
||||
} else {
|
||||
throw Exception("Unexpected response type");
|
||||
}
|
||||
|
||||
if (resMap['status'] == 'success') {
|
||||
Get.to(() => PaymentScreenMtn(
|
||||
invoiceNumber: resMap['invoice_number'],
|
||||
mtnNumber: resMap['mtn_payment_number'] ?? '---',
|
||||
amount: double.parse(amount),
|
||||
));
|
||||
} else {
|
||||
Get.defaultDialog(
|
||||
title: 'Error'.tr,
|
||||
content: Text(resMap['message']?.toString() ?? 'Failed to create invoice'.tr),
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
if (Get.isDialogOpen ?? false) Get.back();
|
||||
Get.defaultDialog(title: 'Error'.tr, content: Text(e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> payWithClickWallet(BuildContext context, String amount, String currency) async {
|
||||
try {
|
||||
final phone = walletphoneController.text.trim();
|
||||
if (phone.isEmpty) {
|
||||
Get.defaultDialog(title: 'Error'.tr, content: Text('Please enter phone number'.tr));
|
||||
return;
|
||||
}
|
||||
|
||||
Get.dialog(const Center(child: CircularProgressIndicator()), barrierDismissible: false);
|
||||
|
||||
var res = await CRUD().postWalletMtn(
|
||||
link: AppLink.createCliqInvoice,
|
||||
payload: {
|
||||
"amount": amount,
|
||||
"user_id": box.read(BoxName.passengerID).toString(),
|
||||
"user_type": "passenger",
|
||||
"click_phone": phone,
|
||||
},
|
||||
);
|
||||
|
||||
Get.back(); // close loading
|
||||
|
||||
late final Map<String, dynamic> resMap;
|
||||
if (res is Map<String, dynamic>) {
|
||||
resMap = res;
|
||||
} else if (res is String) {
|
||||
resMap = json.decode(res) as Map<String, dynamic>;
|
||||
} else {
|
||||
throw Exception("Unexpected response type");
|
||||
}
|
||||
|
||||
if (resMap['status'] == 'success') {
|
||||
Get.to(() => PaymentScreenCliq(
|
||||
invoiceNumber: resMap['invoice_number'],
|
||||
cliqAlias: resMap['cliq_alias'] ?? '---',
|
||||
amount: double.parse(amount),
|
||||
));
|
||||
} else {
|
||||
Get.defaultDialog(
|
||||
title: 'Error'.tr,
|
||||
content: Text(resMap['message']?.toString() ?? 'Failed to create invoice'.tr),
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
if (Get.isDialogOpen ?? false) Get.back();
|
||||
Get.defaultDialog(title: 'Error'.tr, content: Text(e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
timestamp = now.millisecondsSinceEpoch;
|
||||
|
||||
@@ -45,30 +45,16 @@ class RateController extends GetxController {
|
||||
confirm: MyElevatedButton(title: 'Ok', onPressed: () => Get.back()));
|
||||
} else if (Get.find<PaymentController>().isWalletChecked == true) {
|
||||
double tip = 0;
|
||||
tip = (Get.find<RideLifecycleController>().totalPassenger) *
|
||||
tip = double.parse(Get.find<RideLifecycleController>().totalPassenger.toString()) *
|
||||
(double.parse(box.read(BoxName.tipPercentage).toString()));
|
||||
|
||||
if (tip > 0) {
|
||||
var res = await CRUD().post(link: AppLink.addTips, payload: {
|
||||
'passengerID': box.read(BoxName.passengerID),
|
||||
'passengerID': box.read(BoxName.passengerID).toString(),
|
||||
'driverID': Get.find<RideLifecycleController>().driverId.toString(),
|
||||
'rideID': Get.find<RideLifecycleController>().rideId.toString(),
|
||||
'tipAmount': tip.toString(),
|
||||
});
|
||||
await Get.find<PaymentController>()
|
||||
.addPassengersWallet(((-1) * tip).toString());
|
||||
var token1 = await Get.find<PaymentController>().generateTokenDriver(
|
||||
box.read(BoxName.countryCode) == 'Egypt'
|
||||
? tip.toStringAsFixed(0)
|
||||
: (tip * 100).toString());
|
||||
await CRUD().postWallet(link: AppLink.addDriversWalletPoints, payload: {
|
||||
'driverID': Get.find<RideLifecycleController>().driverId.toString(),
|
||||
'paymentID': '${Get.find<RideLifecycleController>().rideId}tip',
|
||||
'amount': box.read(BoxName.countryCode) == 'Egypt'
|
||||
? tip.toStringAsFixed(0)
|
||||
: (tip * 100).toString(),
|
||||
'paymentMethod': 'visa-tip',
|
||||
'token': token1,
|
||||
'country_code': box.read(BoxName.countryCode).toString(),
|
||||
});
|
||||
if (res != 'failure') {
|
||||
await NotificationService.sendNotification(
|
||||
@@ -76,7 +62,7 @@ class RateController extends GetxController {
|
||||
target: Get.find<RideLifecycleController>().driverToken.toString(),
|
||||
title: 'You Have Tips'.tr,
|
||||
body:
|
||||
'${'${tip.toString()}\$${' tips\nTotal is'.tr}'} ${tip + (Get.find<RideLifecycleController>().totalPassenger)}',
|
||||
'${'${tip.toString()}\$${' tips\nTotal is'.tr}'} ${tip + double.parse(Get.find<RideLifecycleController>().totalPassenger.toString())}',
|
||||
isTopic: false, // Important: this is a token
|
||||
tone: 'ding',
|
||||
driverList: [],
|
||||
|
||||
14414
siro_rider/lib/env/env.g.dart
vendored
14414
siro_rider/lib/env/env.g.dart
vendored
File diff suppressed because it is too large
Load Diff
@@ -6,6 +6,9 @@ import 'package:siro_rider/controller/auth/login_controller.dart';
|
||||
import '../../constant/colors.dart';
|
||||
import '../../controller/auth/otp_controller.dart';
|
||||
import '../../controller/local/phone_intel/intl_phone_field.dart';
|
||||
import '../../controller/functions/country_logic.dart';
|
||||
import '../../constant/box_name.dart';
|
||||
import '../../main.dart';
|
||||
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
// SHARED DESIGN TOKENS
|
||||
@@ -485,7 +488,7 @@ class _PhoneNumberScreenState extends State<PhoneNumberScreen> {
|
||||
const BorderSide(color: Color(0xFFEF4444), width: 1.5),
|
||||
),
|
||||
),
|
||||
initialCountryCode: 'SY',
|
||||
initialCountryCode: CountryLogic.getCountryPrefix(box.read(BoxName.countryCode) ?? 'Syria'),
|
||||
onChanged: (phone) {
|
||||
_phoneController.text = phone.completeNumber;
|
||||
},
|
||||
|
||||
@@ -9,6 +9,9 @@ import 'package:get/get.dart';
|
||||
import '../../controller/local/phone_intel/intl_phone_field.dart';
|
||||
import '../../print.dart';
|
||||
import '../widgets/mycircular.dart';
|
||||
import '../../controller/functions/country_logic.dart';
|
||||
import '../../../constant/box_name.dart';
|
||||
import '../../../main.dart';
|
||||
// import 'package:intl_phone_field/intl_phone_field.dart';
|
||||
|
||||
class SmsSignupEgypt extends StatelessWidget {
|
||||
@@ -52,7 +55,7 @@ class SmsSignupEgypt extends StatelessWidget {
|
||||
borderSide: BorderSide(),
|
||||
),
|
||||
),
|
||||
initialCountryCode: 'EG',
|
||||
initialCountryCode: CountryLogic.getCountryPrefix(box.read(BoxName.countryCode) ?? 'Syria'),
|
||||
onChanged: (phone) {
|
||||
// Properly concatenate country code and number
|
||||
registerController.phoneController.text =
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:siro_rider/constant/currency.dart';
|
||||
import 'package:siro_rider/constant/colors.dart';
|
||||
import 'package:siro_rider/constant/links.dart';
|
||||
import 'package:siro_rider/constant/style.dart';
|
||||
@@ -188,7 +189,7 @@ class ApplyOrderWidget extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'SYP'.tr,
|
||||
CurrencyHelper.currency,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
||||
@@ -551,7 +551,7 @@ class Details extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
Text(
|
||||
'Cost for passenger ${controller.totalPassenger.toStringAsFixed(2)} ',
|
||||
'Cost for passenger ${double.parse(controller.totalPassenger.toString()).toStringAsFixed(2)} ',
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
import 'package:siro_rider/constant/currency.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:siro_rider/controller/home/map/map_engine_controller.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:siro_rider/constant/box_name.dart';
|
||||
import 'package:siro_rider/constant/colors.dart';
|
||||
@@ -245,7 +247,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: Text(
|
||||
'${_getPassengerPriceText(carTypes[controller.selectedIndex], controller)} ${'SYP'.tr}',
|
||||
'${_getPassengerPriceText(carTypes[controller.selectedIndex], controller)} ${CurrencyHelper.currency}',
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 13,
|
||||
@@ -413,7 +415,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
),
|
||||
child: FittedBox(
|
||||
child: Text(
|
||||
'${_getPassengerPriceText(carType, controller)} ${'SYP'.tr}',
|
||||
'${_getPassengerPriceText(carType, controller)} ${CurrencyHelper.currency}',
|
||||
style: TextStyle(
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w700,
|
||||
@@ -537,7 +539,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(
|
||||
'${'You have a negative balance of'.tr} ${passengerWallet.toStringAsFixed(2)} ${'SYP'.tr}.',
|
||||
'${'You have a negative balance of'.tr} ${passengerWallet.toStringAsFixed(2)} ${CurrencyHelper.currency}.',
|
||||
style: TextStyle(
|
||||
color: Colors.red.shade800,
|
||||
fontWeight: FontWeight.w600,
|
||||
@@ -557,7 +559,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
// ═══════════════════════════════════════════════════════════════════════════
|
||||
String _getPassengerPriceText(
|
||||
CarType carType, RideLifecycleController mapPassengerController) {
|
||||
double rawPrice;
|
||||
String rawPrice;
|
||||
switch (carType.carType) {
|
||||
case 'Comfort':
|
||||
rawPrice = mapPassengerController.totalPassengerComfort;
|
||||
@@ -587,9 +589,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
default:
|
||||
return '...';
|
||||
}
|
||||
final int roundedPrice = rawPrice.round();
|
||||
final formatter = NumberFormat.decimalPattern();
|
||||
return formatter.format(roundedPrice);
|
||||
return rawPrice;
|
||||
}
|
||||
|
||||
// ═══════════════════════════════════════════════════════════════════════════
|
||||
@@ -743,7 +743,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: Text(
|
||||
'${_getPassengerPriceText(carType, mapPassengerController)} ${'SYP'.tr}',
|
||||
'${_getPassengerPriceText(carType, mapPassengerController)} ${CurrencyHelper.currency}',
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w800,
|
||||
@@ -931,7 +931,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
double _getOriginalPrice(
|
||||
String _getOriginalPrice(
|
||||
CarType carType, RideLifecycleController mapPassengerController) {
|
||||
switch (carType.carType) {
|
||||
case 'Comfort':
|
||||
@@ -947,15 +947,11 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
case 'Lady':
|
||||
return mapPassengerController.totalPassengerLady;
|
||||
default:
|
||||
return 0.0;
|
||||
return '0';
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildRayehGaiOption(
|
||||
BuildContext context,
|
||||
RideLifecycleController mapPassengerController,
|
||||
String carTypeName,
|
||||
double price) {
|
||||
Widget _buildRayehGaiOption(BuildContext context, RideLifecycleController mapPassengerController, String carTypeName, String price) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
Navigator.of(context).pop();
|
||||
@@ -969,7 +965,7 @@ class CarDetailsTypeToChoose extends StatelessWidget {
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(children: [
|
||||
Text(carTypeName.tr),
|
||||
Text(price.toStringAsFixed(0))
|
||||
Text(double.parse(price).toStringAsFixed(0))
|
||||
])),
|
||||
);
|
||||
}
|
||||
@@ -1031,7 +1027,7 @@ class BurcMoney extends StatelessWidget {
|
||||
),
|
||||
TextSpan(
|
||||
text:
|
||||
'${'You have a balance of'.tr} ${passengerWallet.toStringAsFixed(2)} ${box.read(BoxName.countryCode) == 'Egypt' ? 'LE'.tr : 'SYP'.tr} ${'due to a previous trip.'.tr}',
|
||||
'${'You have a balance of'.tr} ${passengerWallet.toStringAsFixed(2)} ${box.read(BoxName.countryCode) == 'Egypt' ? 'LE'.tr : CurrencyHelper.currency} ${'due to a previous trip.'.tr}',
|
||||
style: AppStyle.subtitle.copyWith(
|
||||
color: Colors.white,
|
||||
),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:siro_rider/constant/currency.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:siro_rider/constant/box_name.dart';
|
||||
@@ -80,7 +81,7 @@ class CashConfirmPageShown extends StatelessWidget {
|
||||
icon: Icons.account_balance_wallet_outlined,
|
||||
title: '${AppInformation.appName} Balance'.tr,
|
||||
subtitle:
|
||||
'${'Balance:'.tr} ${box.read(BoxName.passengerWalletTotal) ?? '0.0'} ${'SYP'.tr}',
|
||||
'${'Balance:'.tr} ${box.read(BoxName.passengerWalletTotal) ?? '0.0'} ${CurrencyHelper.currency}',
|
||||
isSelected: paymentCtrl.isWalletChecked,
|
||||
selectedColor: selectedColor,
|
||||
onTap: () =>
|
||||
@@ -107,7 +108,7 @@ class CashConfirmPageShown extends StatelessWidget {
|
||||
final bool isWalletSufficient = (double.tryParse(
|
||||
box.read(BoxName.passengerWalletTotal) ?? '0') ??
|
||||
0) >=
|
||||
controller.totalPassenger;
|
||||
double.parse(controller.totalPassenger.toString());
|
||||
|
||||
// إذا تم اختيار المحفظة والرصيد غير كافٍ
|
||||
if (paymentCtrl.isWalletChecked && !isWalletSufficient) {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:siro_rider/constant/currency.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -7,7 +8,7 @@ import 'package:intl/intl.dart';
|
||||
import '../../../constant/box_name.dart';
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/links.dart';
|
||||
import '../../../constant/style.dart';
|
||||
import 'package:siro_rider/controller/functions/country_logic.dart';
|
||||
import '../../../controller/functions/audio_record1.dart';
|
||||
import '../../../controller/functions/launch.dart';
|
||||
import '../../../controller/functions/toast.dart';
|
||||
@@ -17,6 +18,7 @@ import '../../../controller/home/map/ride_state.dart';
|
||||
import '../../../controller/profile/profile_controller.dart';
|
||||
import '../../../main.dart';
|
||||
import '../../../views/home/profile/complaint_page.dart';
|
||||
import '../../../controller/functions/country_logic.dart';
|
||||
|
||||
class RideBeginPassenger extends StatelessWidget {
|
||||
const RideBeginPassenger({super.key});
|
||||
@@ -115,7 +117,8 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
border: Border.all(
|
||||
color: AppColor.primaryColor.withValues(alpha: 0.5), width: 1.5),
|
||||
color: AppColor.primaryColor.withValues(alpha: 0.5),
|
||||
width: 1.5),
|
||||
),
|
||||
child: CircleAvatar(
|
||||
radius: 24,
|
||||
@@ -207,7 +210,7 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
color: AppColor.primaryColor,
|
||||
),
|
||||
),
|
||||
Text('SYP',
|
||||
Text(CurrencyHelper.currency,
|
||||
style: TextStyle(fontSize: 9, color: AppColor.grayColor)),
|
||||
],
|
||||
),
|
||||
@@ -240,7 +243,8 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
box.write(BoxName.sosPhonePassenger,
|
||||
profileController.prfoileData['sosPhone']);
|
||||
} else {
|
||||
makePhoneCall('112');
|
||||
makePhoneCall(CountryLogic.getEmergencyNumber(
|
||||
box.read(BoxName.countryCode) ?? 'Syria'));
|
||||
}
|
||||
},
|
||||
),
|
||||
@@ -255,13 +259,12 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
// لا يوجد رقم طوارئ — نعرض الديالوج لإدخاله
|
||||
await uiController.shareTripWithFamily();
|
||||
} else {
|
||||
final formattedPhone = uiController.formatSyrianPhoneNumber(
|
||||
phone.toString());
|
||||
final formattedPhone =
|
||||
CountryLogic.formatCurrentCountryPhone(phone.toString());
|
||||
uiController.sendWhatsapp(formattedPhone);
|
||||
}
|
||||
},
|
||||
),
|
||||
|
||||
_compactBtn(
|
||||
icon: Icons.share,
|
||||
label: 'Share'.tr,
|
||||
@@ -287,12 +290,14 @@ class RideBeginPassenger extends StatelessWidget {
|
||||
if (!audioCtx.isRecording) {
|
||||
await audioCtx.startRecording(rideId: controller.rideId);
|
||||
if (context.mounted) {
|
||||
Toast.show(context, 'Start Record'.tr, AppColor.greenColor);
|
||||
Toast.show(
|
||||
context, 'Start Record'.tr, AppColor.greenColor);
|
||||
}
|
||||
} else {
|
||||
await audioCtx.stopRecording();
|
||||
if (context.mounted) {
|
||||
Toast.show(context, 'Record saved'.tr, AppColor.greenColor);
|
||||
Toast.show(
|
||||
context, 'Record saved'.tr, AppColor.greenColor);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import 'package:siro_rider/constant/currency.dart';
|
||||
import 'package:siro_rider/controller/functions/launch.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_font_icons/flutter_font_icons.dart';
|
||||
import 'package:get/get.dart';
|
||||
import '../../../controller/functions/country_logic.dart';
|
||||
|
||||
// ... استيراد ملفاتك الأخرى ...
|
||||
import '../../../constant/box_name.dart';
|
||||
@@ -38,7 +40,7 @@ class RideFromStartApp extends StatelessWidget {
|
||||
final driverName = rideData['driverName'] ?? 'Captain'.tr;
|
||||
final driverRate = controller.driverRate;
|
||||
final carType = rideData['carType'] ?? 'Car'.tr;
|
||||
final carModel = controller.model ?? '';
|
||||
final carModel = controller.model;
|
||||
final arrivalTime = box.read(BoxName.arrivalTime) ?? '--:--';
|
||||
|
||||
// تحديد البيانات للعرض
|
||||
@@ -177,7 +179,7 @@ class RideFromStartApp extends StatelessWidget {
|
||||
"Distance".tr),
|
||||
_buildVerticalDivider(),
|
||||
_buildInfoColumn(
|
||||
Icons.attach_money, "$displayPrice SYP", "Price".tr),
|
||||
Icons.attach_money, "$displayPrice ${CurrencyHelper.currency}", "Price".tr),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -213,7 +215,7 @@ class RideFromStartApp extends StatelessWidget {
|
||||
flex: 1,
|
||||
child: ElevatedButton.icon(
|
||||
onPressed: () =>
|
||||
makePhoneCall(box.read(BoxName.sosPhonePassenger)),
|
||||
makePhoneCall(CountryLogic.getEmergencyNumber(box.read(BoxName.countryCode) ?? 'Syria')),
|
||||
icon: const Icon(Icons.sos, color: Colors.white),
|
||||
label: Text("SOS".tr,
|
||||
style: const TextStyle(color: Colors.white)),
|
||||
|
||||
@@ -14,6 +14,7 @@ import '../../../controller/functions/launch.dart';
|
||||
import '../../../controller/functions/toast.dart';
|
||||
import '../../../controller/home/map/ride_lifecycle_controller.dart';
|
||||
import '../../../controller/home/map/ui_interactions_controller.dart';
|
||||
import '../../../controller/functions/country_logic.dart';
|
||||
|
||||
class VipRideBeginPassenger extends StatelessWidget {
|
||||
const VipRideBeginPassenger({
|
||||
@@ -196,7 +197,7 @@ class VipRideBeginPassenger extends StatelessWidget {
|
||||
profileController.prfoileData['sosPhone']);
|
||||
}
|
||||
} else {
|
||||
makePhoneCall('122');
|
||||
makePhoneCall(CountryLogic.getEmergencyNumber(box.read(BoxName.countryCode) ?? 'Syria'));
|
||||
// box.read(BoxName.sosPhonePassenger));
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:siro_rider/constant/currency.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -153,7 +154,7 @@ class PassengerWallet extends StatelessWidget {
|
||||
.copyWith(color: Colors.white.withOpacity(0.7)),
|
||||
),
|
||||
Text(
|
||||
'${box.read(BoxName.passengerWalletTotal) ?? '0.0'} ${'SYP'.tr}',
|
||||
'${box.read(BoxName.passengerWalletTotal) ?? '0.0'} ${CurrencyHelper.currency}',
|
||||
style: AppStyle.headTitle2.copyWith(
|
||||
color: Colors.white,
|
||||
fontSize: 28,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:siro_rider/constant/currency.dart';
|
||||
import 'package:siro_rider/print.dart';
|
||||
import 'package:siro_rider/constant/style.dart';
|
||||
import 'package:siro_rider/controller/functions/encrypt_decrypt.dart';
|
||||
// import 'package:siro_rider/controller/functions/encrypt_decrypt.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
@@ -42,7 +43,7 @@ class PassengerWalletDialog extends StatelessWidget {
|
||||
child: Text(
|
||||
box.read(BoxName.countryCode) == 'Syria'
|
||||
? '10000 ${'LE'.tr}'
|
||||
: '10 ${'SYP'.tr}',
|
||||
: '10 ${CurrencyHelper.currency}',
|
||||
),
|
||||
),
|
||||
CupertinoActionSheetAction(
|
||||
@@ -55,7 +56,7 @@ class PassengerWalletDialog extends StatelessWidget {
|
||||
child: Text(
|
||||
box.read(BoxName.countryCode) == 'Syria'
|
||||
? '20000 ${'LE'.tr} = 2050 ${'LE'.tr}'
|
||||
: '20 ${'SYP'.tr}',
|
||||
: '20 ${CurrencyHelper.currency}',
|
||||
),
|
||||
),
|
||||
CupertinoActionSheetAction(
|
||||
@@ -68,7 +69,7 @@ class PassengerWalletDialog extends StatelessWidget {
|
||||
child: Text(
|
||||
box.read(BoxName.countryCode) == 'Syria'
|
||||
? '40000 ${'LE'.tr} = 4150 ${'LE'.tr}'
|
||||
: '40 ${'SYP'.tr}',
|
||||
: '40 ${CurrencyHelper.currency}',
|
||||
),
|
||||
),
|
||||
CupertinoActionSheetAction(
|
||||
@@ -81,7 +82,7 @@ class PassengerWalletDialog extends StatelessWidget {
|
||||
child: Text(
|
||||
box.read(BoxName.countryCode) == 'Syria'
|
||||
? '100000 ${'LE'.tr} = 11000 ${'LE'.tr}'
|
||||
: '50 ${'SYP'.tr}',
|
||||
: '50 ${CurrencyHelper.currency}',
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -130,10 +131,10 @@ void showPaymentBottomSheet(BuildContext context) {
|
||||
borderRadius: BorderRadius.vertical(top: Radius.circular(15.0)),
|
||||
),
|
||||
builder: (BuildContext context) {
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
return PopScope(
|
||||
canPop: true,
|
||||
onPopInvokedWithResult: (didPop, result) async {
|
||||
Get.back();
|
||||
return false;
|
||||
},
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
@@ -154,7 +155,7 @@ void showPaymentBottomSheet(BuildContext context) {
|
||||
controller: controller,
|
||||
amount: 500,
|
||||
bonusAmount: 30,
|
||||
currency: 'SYP'.tr,
|
||||
currency: CurrencyHelper.currency,
|
||||
),
|
||||
|
||||
const SizedBox(height: 8.0),
|
||||
@@ -163,7 +164,7 @@ void showPaymentBottomSheet(BuildContext context) {
|
||||
controller: controller,
|
||||
amount: 1000,
|
||||
bonusAmount: 70,
|
||||
currency: 'SYP'.tr,
|
||||
currency: CurrencyHelper.currency,
|
||||
),
|
||||
|
||||
const SizedBox(height: 8.0),
|
||||
@@ -172,7 +173,7 @@ void showPaymentBottomSheet(BuildContext context) {
|
||||
controller: controller,
|
||||
amount: 2000,
|
||||
bonusAmount: 180,
|
||||
currency: 'SYP'.tr,
|
||||
currency: CurrencyHelper.currency,
|
||||
),
|
||||
|
||||
const SizedBox(height: 8.0),
|
||||
@@ -181,7 +182,7 @@ void showPaymentBottomSheet(BuildContext context) {
|
||||
controller: controller,
|
||||
amount: 5000,
|
||||
bonusAmount: 700,
|
||||
currency: 'SYP'.tr,
|
||||
currency: CurrencyHelper.currency,
|
||||
),
|
||||
|
||||
const SizedBox(height: 16.0),
|
||||
@@ -266,7 +267,7 @@ void showPaymentOptions(BuildContext context, PaymentController controller) {
|
||||
// controller.payWithMTNWallet(
|
||||
// context,
|
||||
// controller.selectedAmount.toString(),
|
||||
// 'SYP',
|
||||
// CurrencyHelper.currency,
|
||||
// );
|
||||
// await controller.getPassengerWallet();
|
||||
// controller.isLoading = false;
|
||||
@@ -331,148 +332,215 @@ void showPaymentOptions(BuildContext context, PaymentController controller) {
|
||||
// Get.back();
|
||||
// Get.defaultDialog(
|
||||
// barrierDismissible: false,
|
||||
// title: 'Insert Wallet phone number'.tr,
|
||||
// content: Form(
|
||||
// key: controller.formKey,
|
||||
// child: MyTextForm(
|
||||
// controller: controller.walletphoneController,
|
||||
// label: 'Insert Wallet phone number'.tr,
|
||||
// hint: '963941234567',
|
||||
// type: TextInputType.phone)),
|
||||
// confirm: MyElevatedButton(
|
||||
// title: 'OK'.tr,
|
||||
// onPressed: () async {
|
||||
// Get.back();
|
||||
// if (controller.formKey.currentState!.validate()) {
|
||||
// if (controller.selectedAmount != 0) {
|
||||
// controller.isLoading = true;
|
||||
// controller.update();
|
||||
// box.write(BoxName.phoneWallet,
|
||||
// (controller.walletphoneController.text));
|
||||
// Get.back();
|
||||
// await controller.payWithMTNWallet(
|
||||
// context,
|
||||
// controller.selectedAmount.toString(),
|
||||
// 'SYP',
|
||||
// );
|
||||
// await controller.getPassengerWallet();
|
||||
|
||||
// controller.isLoading = false;
|
||||
// controller.update();
|
||||
// } else {
|
||||
// Toast.show(
|
||||
// context,
|
||||
// '⚠️ You need to choose an amount!'.tr,
|
||||
// AppColor.redColor,
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
// }));
|
||||
// },
|
||||
// child: Padding(
|
||||
// padding: const EdgeInsets.all(8.0),
|
||||
// child: Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// Text(
|
||||
// 'Pay by MTN Wallet'.tr,
|
||||
// style: AppStyle.title,
|
||||
// ),
|
||||
// const SizedBox(width: 10),
|
||||
// Image.asset(
|
||||
// 'assets/images/cashMTN.png',
|
||||
// width: 70,
|
||||
// height: 70,
|
||||
// fit: BoxFit.contain,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// )),
|
||||
if (box.read(BoxName.countryCode) == 'Syria')
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
Get.back();
|
||||
Get.defaultDialog(
|
||||
barrierDismissible: false,
|
||||
title: 'Insert Wallet phone number'.tr,
|
||||
content: Form(
|
||||
key: controller.formKey,
|
||||
child: MyTextForm(
|
||||
controller: controller.walletphoneController,
|
||||
label: 'Insert Wallet phone number'.tr,
|
||||
hint: '963941234567',
|
||||
type: TextInputType.phone)),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'OK'.tr,
|
||||
onPressed: () async {
|
||||
Get.back();
|
||||
if (controller.formKey.currentState!.validate()) {
|
||||
if (controller.selectedAmount != 0) {
|
||||
controller.isLoading = true;
|
||||
controller.update();
|
||||
box.write(BoxName.phoneWallet,
|
||||
(controller.walletphoneController.text));
|
||||
await controller.payWithMTNWallet(
|
||||
context,
|
||||
controller.selectedAmount.toString(),
|
||||
CurrencyHelper.currency,
|
||||
);
|
||||
await controller.getPassengerWallet();
|
||||
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
Get.back();
|
||||
Get.defaultDialog(
|
||||
barrierDismissible: false,
|
||||
title: 'Insert Wallet phone number'.tr,
|
||||
content: Form(
|
||||
key: controller.formKey,
|
||||
child: MyTextForm(
|
||||
controller: controller.walletphoneController,
|
||||
label: 'Insert Wallet phone number'.tr,
|
||||
hint: '963941234567',
|
||||
type: TextInputType.phone)),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'OK'.tr,
|
||||
onPressed: () async {
|
||||
Get.back();
|
||||
if (controller.formKey.currentState!.validate()) {
|
||||
box.write(BoxName.phoneWallet,
|
||||
controller.walletphoneController.text);
|
||||
await controller.payWithSyriaTelWallet(
|
||||
controller.selectedAmount.toString(), 'SYP');
|
||||
}
|
||||
}));
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Pay by Syriatel Wallet'.tr,
|
||||
controller.isLoading = false;
|
||||
controller.update();
|
||||
} else {
|
||||
Toast.show(
|
||||
context,
|
||||
'⚠️ You need to choose an amount!'.tr,
|
||||
AppColor.redColor,
|
||||
);
|
||||
}
|
||||
}
|
||||
}));
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Pay by MTN Wallet'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Image.asset(
|
||||
'assets/images/cashMTN.png',
|
||||
width: 70,
|
||||
height: 70,
|
||||
fit: BoxFit.contain,
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
|
||||
if (box.read(BoxName.countryCode) == 'Jordan')
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
Get.back();
|
||||
Get.defaultDialog(
|
||||
barrierDismissible: false,
|
||||
title: 'Insert Wallet phone number'.tr,
|
||||
content: Form(
|
||||
key: controller.formKey,
|
||||
child: MyTextForm(
|
||||
controller: controller.walletphoneController,
|
||||
label: 'Insert Wallet phone number'.tr,
|
||||
hint: '962791234567',
|
||||
type: TextInputType.phone)),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'OK'.tr,
|
||||
onPressed: () async {
|
||||
Get.back();
|
||||
if (controller.formKey.currentState!.validate()) {
|
||||
if (controller.selectedAmount != 0) {
|
||||
controller.isLoading = true;
|
||||
controller.update();
|
||||
box.write(BoxName.phoneWallet,
|
||||
(controller.walletphoneController.text));
|
||||
await controller.payWithClickWallet(
|
||||
context,
|
||||
controller.selectedAmount.toString(),
|
||||
CurrencyHelper.currency,
|
||||
);
|
||||
await controller.getPassengerWallet();
|
||||
|
||||
controller.isLoading = false;
|
||||
controller.update();
|
||||
} else {
|
||||
Toast.show(
|
||||
context,
|
||||
'⚠️ You need to choose an amount!'.tr,
|
||||
AppColor.redColor,
|
||||
);
|
||||
}
|
||||
}
|
||||
}));
|
||||
},
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(top: 10),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
color: Colors.transparent,
|
||||
),
|
||||
child: ListTile(
|
||||
title: Text(
|
||||
'Pay by Cliq'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Image.asset(
|
||||
'assets/images/syriatel.png',
|
||||
width: 70,
|
||||
height: 70,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
// التحقق بالبصمة قبل أي شيء
|
||||
bool isAuthSupported =
|
||||
await LocalAuthentication().isDeviceSupported();
|
||||
trailing: const Icon(Icons.payment, size: 40, color: Colors.green),
|
||||
),
|
||||
)), if (box.read(BoxName.countryCode) == 'Syria')
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
Get.back();
|
||||
Get.defaultDialog(
|
||||
barrierDismissible: false,
|
||||
title: 'Insert Wallet phone number'.tr,
|
||||
content: Form(
|
||||
key: controller.formKey,
|
||||
child: MyTextForm(
|
||||
controller: controller.walletphoneController,
|
||||
label: 'Insert Wallet phone number'.tr,
|
||||
hint: '963941234567',
|
||||
type: TextInputType.phone)),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'OK'.tr,
|
||||
onPressed: () async {
|
||||
Get.back();
|
||||
if (controller.formKey.currentState!.validate()) {
|
||||
box.write(BoxName.phoneWallet,
|
||||
controller.walletphoneController.text);
|
||||
await controller.payWithSyriaTelWallet(
|
||||
controller.selectedAmount.toString(),
|
||||
CurrencyHelper.currency);
|
||||
}
|
||||
}));
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Pay by Syriatel Wallet'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Image.asset(
|
||||
'assets/images/syriatel.png',
|
||||
width: 70,
|
||||
height: 70,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
if (box.read(BoxName.countryCode) == 'Syria')
|
||||
GestureDetector(
|
||||
onTap: () async {
|
||||
// التحقق بالبصمة قبل أي شيء
|
||||
bool isAuthSupported =
|
||||
await LocalAuthentication().isDeviceSupported();
|
||||
|
||||
if (isAuthSupported) {
|
||||
bool didAuthenticate = await LocalAuthentication().authenticate(
|
||||
localizedReason: 'استخدم بصمة الإصبع أو الوجه لتأكيد الدفع',
|
||||
);
|
||||
if (isAuthSupported) {
|
||||
bool didAuthenticate =
|
||||
await LocalAuthentication().authenticate(
|
||||
localizedReason: 'استخدم بصمة الإصبع أو الوجه لتأكيد الدفع',
|
||||
);
|
||||
|
||||
if (!didAuthenticate) {
|
||||
Log.print("❌ User did not authenticate with biometrics");
|
||||
return;
|
||||
if (!didAuthenticate) {
|
||||
Log.print("❌ User did not authenticate with biometrics");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// الانتقال مباشرة لإنشاء الفاتورة بعد النجاح بالبصمة
|
||||
Get.to(() => PaymentScreenSmsProvider(
|
||||
amount: double.parse(controller.selectedAmount.toString())));
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Pay by Sham Cash'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Image.asset(
|
||||
'assets/images/shamCash.png',
|
||||
width: 70,
|
||||
height: 70,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
// الانتقال مباشرة لإنشاء الفاتورة بعد النجاح بالبصمة
|
||||
Get.to(() => PaymentScreenSmsProvider(
|
||||
amount:
|
||||
double.parse(controller.selectedAmount.toString())));
|
||||
},
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Pay by Sham Cash'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Image.asset(
|
||||
'assets/images/shamCash.png',
|
||||
width: 70,
|
||||
height: 70,
|
||||
fit: BoxFit.fill,
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
],
|
||||
cancelButton: CupertinoActionSheetAction(
|
||||
child: Text('Cancel'.tr),
|
||||
@@ -483,4 +551,4 @@ void showPaymentOptions(BuildContext context, PaymentController controller) {
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
208
siro_rider/lib/views/home/my_wallet/payment_screen_cliq.dart
Normal file
208
siro_rider/lib/views/home/my_wallet/payment_screen_cliq.dart
Normal file
@@ -0,0 +1,208 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import '../../../constant/links.dart';
|
||||
import '../../../controller/functions/crud.dart';
|
||||
|
||||
class PaymentScreenCliq extends StatefulWidget {
|
||||
final double amount;
|
||||
final String invoiceNumber;
|
||||
final String cliqAlias;
|
||||
|
||||
const PaymentScreenCliq({
|
||||
Key? key,
|
||||
required this.amount,
|
||||
required this.invoiceNumber,
|
||||
required this.cliqAlias,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<PaymentScreenCliq> createState() => _PaymentScreenCliqState();
|
||||
}
|
||||
|
||||
class _PaymentScreenCliqState extends State<PaymentScreenCliq> with SingleTickerProviderStateMixin {
|
||||
Timer? _pollingTimer;
|
||||
String _status = 'waiting'; // waiting, uploading, verifying, success, error
|
||||
final TextEditingController _proofController = TextEditingController();
|
||||
|
||||
late AnimationController _blinkController;
|
||||
late Animation<Color?> _colorAnimation;
|
||||
late Animation<double> _shadowAnimation;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_blinkController = AnimationController(duration: const Duration(milliseconds: 800), vsync: this)..repeat(reverse: true);
|
||||
_colorAnimation = ColorTween(begin: Colors.red.shade700, end: Colors.red.shade100).animate(_blinkController);
|
||||
_shadowAnimation = Tween<double>(begin: 2.0, end: 15.0).animate(CurvedAnimation(parent: _blinkController, curve: Curves.easeInOut));
|
||||
|
||||
_startPolling();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_pollingTimer?.cancel();
|
||||
_blinkController.dispose();
|
||||
_proofController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void _startPolling() {
|
||||
_pollingTimer = Timer.periodic(const Duration(seconds: 5), (timer) async {
|
||||
if (_status == 'success' || _status == 'verifying') return;
|
||||
try {
|
||||
final res = await CRUD().postWallet(link: AppLink.checkCliqStatus, payload: {'invoice_number': widget.invoiceNumber});
|
||||
if (res != 'failure' && res['status'] == 'success' && res['invoice_status'] == 'completed') {
|
||||
timer.cancel();
|
||||
if (mounted) setState(() => _status = 'success');
|
||||
}
|
||||
} catch (_) {}
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _submitProof() async {
|
||||
if (_proofController.text.trim().isEmpty) {
|
||||
Get.snackbar('Error'.tr, 'Please paste the transfer message'.tr, backgroundColor: Colors.red);
|
||||
return;
|
||||
}
|
||||
setState(() => _status = 'verifying');
|
||||
|
||||
try {
|
||||
final res = await CRUD().postWallet(link: AppLink.uploadCliqProof, payload: {
|
||||
'invoice_number': widget.invoiceNumber,
|
||||
'proof_text': _proofController.text.trim(),
|
||||
});
|
||||
|
||||
if (res != 'failure' && res['status'] == 'success') {
|
||||
if (mounted) setState(() => _status = 'success');
|
||||
} else {
|
||||
if (mounted) setState(() => _status = 'error');
|
||||
Get.defaultDialog(title: 'Failed'.tr, content: Text(res['message']?.toString() ?? 'Verification failed'));
|
||||
}
|
||||
} catch (e) {
|
||||
if (mounted) setState(() => _status = 'error');
|
||||
Get.defaultDialog(title: 'Error'.tr, content: Text('Error uploading proof'.tr));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.grey[50],
|
||||
appBar: AppBar(title: const Text("Cliq Payment"), centerTitle: true, backgroundColor: Colors.white, foregroundColor: Colors.black),
|
||||
body: SafeArea(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
child: _status == 'success' ? _buildSuccessUI() : _buildWaitingUI(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildWaitingUI() {
|
||||
final currencyFormat = NumberFormat.decimalPattern('ar_SY');
|
||||
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 15),
|
||||
decoration: BoxDecoration(gradient: LinearGradient(colors: [Colors.blue.shade800, Colors.blue.shade600]), borderRadius: BorderRadius.circular(16)),
|
||||
child: Column(
|
||||
children: [
|
||||
const Text("المبلغ المطلوب", style: TextStyle(color: Colors.white70, fontSize: 14)),
|
||||
const SizedBox(height: 5),
|
||||
Text("${currencyFormat.format(widget.amount)} ل.س", style: const TextStyle(color: Colors.white, fontSize: 28, fontWeight: FontWeight.bold)),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 25),
|
||||
|
||||
AnimatedBuilder(
|
||||
animation: _blinkController,
|
||||
builder: (context, child) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(16), border: Border.all(color: _colorAnimation.value ?? Colors.red, width: 3.0), boxShadow: [BoxShadow(color: (_colorAnimation.value ?? Colors.red).withOpacity(0.4), blurRadius: _shadowAnimation.value, spreadRadius: 2)]),
|
||||
child: Column(
|
||||
children: [
|
||||
const Text("يرجى تحويل المبلغ إلى الاسم المستعار التالي (Alias):", textAlign: TextAlign.center, style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 15),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Clipboard.setData(ClipboardData(text: widget.cliqAlias));
|
||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: const Text("تم نسخ الاسم ✅", textAlign: TextAlign.center), backgroundColor: Colors.green.shade600));
|
||||
},
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(15),
|
||||
decoration: BoxDecoration(color: Colors.blue.shade50, borderRadius: BorderRadius.circular(12), border: Border.all(color: Colors.blue.shade200)),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(widget.cliqAlias, style: const TextStyle(fontSize: 24, fontWeight: FontWeight.bold, letterSpacing: 2.0)),
|
||||
const Icon(Icons.copy, color: Colors.blue),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
const SizedBox(height: 30),
|
||||
const Text("بعد إتمام التحويل، يرجى نسخ رسالة البنك النصية ولصقها هنا للتحقق التلقائي:", textAlign: TextAlign.center, style: TextStyle(fontSize: 14)),
|
||||
const SizedBox(height: 10),
|
||||
TextField(
|
||||
controller: _proofController,
|
||||
maxLines: 4,
|
||||
decoration: InputDecoration(
|
||||
hintText: "قم بلصق نص رسالة التحويل هنا...",
|
||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12)),
|
||||
filled: true,
|
||||
fillColor: Colors.white,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
height: 50,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(backgroundColor: Colors.blue.shade800, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12))),
|
||||
onPressed: _status == 'verifying' ? null : _submitProof,
|
||||
child: _status == 'verifying'
|
||||
? const CircularProgressIndicator(color: Colors.white)
|
||||
: const Text("تحقق من الدفع", style: TextStyle(fontSize: 18, color: Colors.white, fontWeight: FontWeight.bold)),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
const Text("جاري فحص الفاتورة تلقائياً كل 5 ثوانٍ...", style: TextStyle(color: Colors.grey, fontSize: 12)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSuccessUI() {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(Icons.verified_rounded, color: Colors.green, size: 100),
|
||||
const SizedBox(height: 20),
|
||||
const Text("تم الدفع بنجاح!", style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 40),
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(backgroundColor: Colors.green, foregroundColor: Colors.white, padding: const EdgeInsets.symmetric(vertical: 16)),
|
||||
onPressed: () { Get.back(); Get.back(); },
|
||||
child: const Text("متابعة", style: TextStyle(fontSize: 18)),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
208
siro_rider/lib/views/home/my_wallet/payment_screen_mtn.dart
Normal file
208
siro_rider/lib/views/home/my_wallet/payment_screen_mtn.dart
Normal file
@@ -0,0 +1,208 @@
|
||||
import 'dart:async';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import '../../../constant/links.dart';
|
||||
import '../../../controller/functions/crud.dart';
|
||||
|
||||
class PaymentScreenMtn extends StatefulWidget {
|
||||
final double amount;
|
||||
final String invoiceNumber;
|
||||
final String mtnNumber;
|
||||
|
||||
const PaymentScreenMtn({
|
||||
Key? key,
|
||||
required this.amount,
|
||||
required this.invoiceNumber,
|
||||
required this.mtnNumber,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
State<PaymentScreenMtn> createState() => _PaymentScreenMtnState();
|
||||
}
|
||||
|
||||
class _PaymentScreenMtnState extends State<PaymentScreenMtn> with SingleTickerProviderStateMixin {
|
||||
Timer? _pollingTimer;
|
||||
String _status = 'waiting'; // waiting, uploading, verifying, success, error
|
||||
final TextEditingController _proofController = TextEditingController();
|
||||
|
||||
late AnimationController _blinkController;
|
||||
late Animation<Color?> _colorAnimation;
|
||||
late Animation<double> _shadowAnimation;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_blinkController = AnimationController(duration: const Duration(milliseconds: 800), vsync: this)..repeat(reverse: true);
|
||||
_colorAnimation = ColorTween(begin: Colors.red.shade700, end: Colors.red.shade100).animate(_blinkController);
|
||||
_shadowAnimation = Tween<double>(begin: 2.0, end: 15.0).animate(CurvedAnimation(parent: _blinkController, curve: Curves.easeInOut));
|
||||
|
||||
_startPolling();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_pollingTimer?.cancel();
|
||||
_blinkController.dispose();
|
||||
_proofController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
void _startPolling() {
|
||||
_pollingTimer = Timer.periodic(const Duration(seconds: 5), (timer) async {
|
||||
if (_status == 'success' || _status == 'verifying') return;
|
||||
try {
|
||||
final res = await CRUD().postWallet(link: AppLink.checkMtnStatus, payload: {'invoice_number': widget.invoiceNumber});
|
||||
if (res != 'failure' && res['status'] == 'success' && res['invoice_status'] == 'completed') {
|
||||
timer.cancel();
|
||||
if (mounted) setState(() => _status = 'success');
|
||||
}
|
||||
} catch (_) {}
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _submitProof() async {
|
||||
if (_proofController.text.trim().isEmpty) {
|
||||
Get.snackbar('Error'.tr, 'Please paste the transfer message'.tr, backgroundColor: Colors.red);
|
||||
return;
|
||||
}
|
||||
setState(() => _status = 'verifying');
|
||||
|
||||
try {
|
||||
final res = await CRUD().postWallet(link: AppLink.uploadMtnProof, payload: {
|
||||
'invoice_number': widget.invoiceNumber,
|
||||
'proof_text': _proofController.text.trim(),
|
||||
});
|
||||
|
||||
if (res != 'failure' && res['status'] == 'success') {
|
||||
if (mounted) setState(() => _status = 'success');
|
||||
} else {
|
||||
if (mounted) setState(() => _status = 'error');
|
||||
Get.defaultDialog(title: 'Failed'.tr, content: Text(res['message']?.toString() ?? 'Verification failed'));
|
||||
}
|
||||
} catch (e) {
|
||||
if (mounted) setState(() => _status = 'error');
|
||||
Get.defaultDialog(title: 'Error'.tr, content: Text('Error uploading proof'.tr));
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: Colors.grey[50],
|
||||
appBar: AppBar(title: const Text("MTN Payment"), centerTitle: true, backgroundColor: Colors.white, foregroundColor: Colors.black),
|
||||
body: SafeArea(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
child: _status == 'success' ? _buildSuccessUI() : _buildWaitingUI(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildWaitingUI() {
|
||||
final currencyFormat = NumberFormat.decimalPattern('ar_SY');
|
||||
|
||||
return SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 15),
|
||||
decoration: BoxDecoration(gradient: LinearGradient(colors: [Colors.blue.shade800, Colors.blue.shade600]), borderRadius: BorderRadius.circular(16)),
|
||||
child: Column(
|
||||
children: [
|
||||
const Text("المبلغ المطلوب", style: TextStyle(color: Colors.white70, fontSize: 14)),
|
||||
const SizedBox(height: 5),
|
||||
Text("${currencyFormat.format(widget.amount)} ل.س", style: const TextStyle(color: Colors.white, fontSize: 28, fontWeight: FontWeight.bold)),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 25),
|
||||
|
||||
AnimatedBuilder(
|
||||
animation: _blinkController,
|
||||
builder: (context, child) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(16), border: Border.all(color: _colorAnimation.value ?? Colors.red, width: 3.0), boxShadow: [BoxShadow(color: (_colorAnimation.value ?? Colors.red).withOpacity(0.4), blurRadius: _shadowAnimation.value, spreadRadius: 2)]),
|
||||
child: Column(
|
||||
children: [
|
||||
const Text("يرجى تحويل المبلغ إلى الرقم التالي:", textAlign: TextAlign.center, style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 15),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
Clipboard.setData(ClipboardData(text: widget.mtnNumber));
|
||||
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: const Text("تم نسخ الرقم ✅", textAlign: TextAlign.center), backgroundColor: Colors.green.shade600));
|
||||
},
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(15),
|
||||
decoration: BoxDecoration(color: Colors.blue.shade50, borderRadius: BorderRadius.circular(12), border: Border.all(color: Colors.blue.shade200)),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(widget.mtnNumber, style: const TextStyle(fontSize: 24, fontWeight: FontWeight.bold, letterSpacing: 2.0)),
|
||||
const Icon(Icons.copy, color: Colors.blue),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
|
||||
const SizedBox(height: 30),
|
||||
const Text("بعد إتمام التحويل، يرجى نسخ رسالة البنك النصية ولصقها هنا للتحقق التلقائي:", textAlign: TextAlign.center, style: TextStyle(fontSize: 14)),
|
||||
const SizedBox(height: 10),
|
||||
TextField(
|
||||
controller: _proofController,
|
||||
maxLines: 4,
|
||||
decoration: InputDecoration(
|
||||
hintText: "قم بلصق نص رسالة التحويل هنا...",
|
||||
border: OutlineInputBorder(borderRadius: BorderRadius.circular(12)),
|
||||
filled: true,
|
||||
fillColor: Colors.white,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 15),
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
height: 50,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(backgroundColor: Colors.blue.shade800, shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12))),
|
||||
onPressed: _status == 'verifying' ? null : _submitProof,
|
||||
child: _status == 'verifying'
|
||||
? const CircularProgressIndicator(color: Colors.white)
|
||||
: const Text("تحقق من الدفع", style: TextStyle(fontSize: 18, color: Colors.white, fontWeight: FontWeight.bold)),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
const Text("جاري فحص الفاتورة تلقائياً كل 5 ثوانٍ...", style: TextStyle(color: Colors.grey, fontSize: 12)),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSuccessUI() {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
const Icon(Icons.verified_rounded, color: Colors.green, size: 100),
|
||||
const SizedBox(height: 20),
|
||||
const Text("تم الدفع بنجاح!", style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold)),
|
||||
const SizedBox(height: 40),
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
child: ElevatedButton(
|
||||
style: ElevatedButton.styleFrom(backgroundColor: Colors.green, foregroundColor: Colors.white, padding: const EdgeInsets.symmetric(vertical: 16)),
|
||||
onPressed: () { Get.back(); Get.back(); },
|
||||
child: const Text("متابعة", style: TextStyle(fontSize: 18)),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:siro_rider/constant/currency.dart';
|
||||
import 'dart:math' as math;
|
||||
import 'dart:typed_data';
|
||||
|
||||
@@ -191,7 +192,7 @@ class _HistoryCard extends StatelessWidget {
|
||||
Text('Total Price'.tr,
|
||||
style: AppStyle.title.copyWith(fontSize: 15)),
|
||||
Text(
|
||||
'${ride['price']} ${'SYP'.tr}',
|
||||
'${ride['price']} ${CurrencyHelper.currency}',
|
||||
style: AppStyle.headTitle.copyWith(
|
||||
fontSize: 20, color: AppColor.primaryColor),
|
||||
),
|
||||
@@ -559,7 +560,7 @@ class _RideDetailSheetState extends State<_RideDetailSheet> {
|
||||
color:
|
||||
AppColor.writeColor.withOpacity(0.55))),
|
||||
const SizedBox(height: 2),
|
||||
Text('${ride['price']} ${'SYP'.tr}',
|
||||
Text('${ride['price']} ${CurrencyHelper.currency}',
|
||||
style: AppStyle.headTitle.copyWith(
|
||||
fontSize: 22, color: AppColor.primaryColor)),
|
||||
],
|
||||
|
||||
@@ -1,119 +0,0 @@
|
||||
basicAuthCredentials=wqnmqqsjyvwjv:nqrYJP@1737XrXlBl
|
||||
basicCompareFaces=zjujluqfpj:nqrYjp@1737XrXlBl
|
||||
basicCompareFacesURL='https://face-detect-f6924392c4c7.herokuapp.com/compare_faces'
|
||||
accountSIDTwillo=QFx0qy456juj383n9xuy2194q629q1fj0y7XrXlBl
|
||||
serverAPI=QQQQobSrrFi:QVQ87xU7zwCvmZzZdaxuS2f23Y4mz7MzyOzr8od2br6KYyeFaTVLG3K3hx5ZaUyx7eYvAYpAVdKk-286NTRi3zs9iSOnXtXRIxswg3KecBmsl3VxJ9wO-vIpwu4Pv7dkHkXniuxMSDgWXrXlBl
|
||||
mapAPIKEY=AIzaSyCFsWBqvkXzk1Gb-bCGxwqTwJQKIeHjH64
|
||||
email=@intaleqapp.com
|
||||
getapiKey=zg-4C26q4SYgBKQeHZDqkWowC9XrxgUEfUy9JRw2rm6Q2adb3kjwXrXlBl
|
||||
mapAPIKEYIOS=AIzaSyDzGO9a-1IDMLD2FxhmOO9ONL1gMssFa9g
|
||||
twilloRecoveryCode=CAU79DHPH1BjE9PUH4ETXTSXZXrXlBl
|
||||
apiKeyHere=g_WNUb5L-tripz7-F8omHpUmgIzH7ETeH9xZ8RwGG9_G8zX9A
|
||||
authTokenTwillo=70u98ju0214oxx4q0u74028u021u4qu65XrXlBl
|
||||
chatGPTkey=zg-4C26q4SYgBKQeHZDqkWowC9XrxgUEfUy9JRw2rm6Q2adb3kjwXrXlBl
|
||||
transactionCloude=Qhcwuilomqcoib:QVO_JNYED2XWA26YXKC2TP:YK1DVH6SJB31N3PE1UXrXlBl
|
||||
visionApi=3pALsqSSYTvzp69Q5FMIgbzjG6Z1zktJXrXlBl
|
||||
chatGPTkeySefer=zg-IiR3i4ooza3Yvhvb9rZk1C9XrxgUE0l8jRRZrHj3Qe5QXPlqVXrXlBl
|
||||
chatGPTkeySeferNew=zg-Z4oAJcAROgNXjgrEIU8fKC9XrxgUE4Qtrrlq1yiux0jL3dITSXrXlBl
|
||||
secretKey=zg_ropj_57Iiv6pMFCBFq3C2n6IXlmjykpxDmW93SW3vvXh68UA9T5FORTWgWsT37StKsOPdwDdsy8qR9srMUluahs3nPHvgBa33tGk90vV5XrXlBl
|
||||
stripe_publishableKe=vg_propj_57Iiv6MFCBFq3C2n6kNJnZByV6nuDtXe9IjEPOfhmpDtWmt3MLR0gQpiHcQmAFMUPrZc3QiCDjxBZLbxDC3efxWxz33bWH1ZgrsXrXlBl
|
||||
llamaKey=RR-EuyoFDUvfRDBoj46fZKAtKJ3voM8Mt768cPeJV7GNdAkPTKdY8Odm9n4ggGqI5GyoXrXlBl
|
||||
serverPHP=https://api.sefer.live/sefer
|
||||
seferAlexandriaServer=https://seferalexandria.site/sefer
|
||||
seferPaymentServer=https://seferpw.shop/sefer
|
||||
# seferCairoServer=https://sefer.click/sefer
|
||||
seferCairoServer=https://server.sefer.live/sefer.click/sefer
|
||||
seferGizaServer=https://gizasefer.online/sefer
|
||||
whatappID=3699397362811879
|
||||
whatsapp=EAAOtbZBSUK74BOzW9yb74EgApQYtI88nYtE9jQi9QnLGpw3FQpc5dxIlDgVJzcMywEBqNYf3s8pkk6cZB5Q0tkKuSOZBsOvMZA3Tcth0IlBHSaMVtcRZCsaTKNSUpfLRGRb0rhLezNFllpYBgmnfbhUazSZBYXdr40nmN4QEgweK2eqYQnTTNuryTOyBkKZB1MXMw6U7QnTRQDxHbUVlqgIRTrhaooZD
|
||||
cohere=Aulwd8y5SPWos0hJhlG0toUf8gOhUUrpf5Q2TPmVGXrXlBl
|
||||
claudeAiAPI=zg-qbc-qvo39l-xWOxIGwWTOzCFBnIYSKKhfyz_KVAvrH-6_4ZEJL68G_QBH26oeTOMMoQug9KuOjjKSP_A4S3SUDlbxR9duVzoQ-MkX_UQQQXrXlBl
|
||||
payPalClientId=QALymlfNI5Tzt4s-ysoz6vD4_nqX0SUtkC_qYV-Ugk5gaM_8Z-kg4L53k8Uux_4jEWXDkNpXGSWPpIzDFXrXlBl
|
||||
payPalClientIdLive=QZFkjAoZfGtngNserll6r3cC56Xl1sVLQkn5dMbyebhzJY59EQ3hz7YxaEqEDYPTUFcQWqvePaQ5UJJVRXrXlBl
|
||||
payPalSecret=JBAAvqJQGUsKD0Zjh4KjeczxfBFx-38SdlbIS56VRM8NDfe6mjMeZJhNLJek5XgQCqKCHtRf6MjRy-f8XrXlBl
|
||||
payPalSecretLive=JQDATqkknDfiFpEAN60KB4pGpDaJjyqBAd9jxMBPpzWU1P1k3H1jZhQjn73EHsKQna74P8p98hgOnMaWPWXrXlBl
|
||||
geminiApi=QOmqZsQYm08vlOqjI7klVJfvP4WBFEoemjgy396iXrXlBl
|
||||
geminiApiMasa=QOmqZsQIpdM4BRsKmaDJOP7dZp5-c6NWfch7PAlQXrXlBl
|
||||
agoraAppId=71880f2j636o509j24y5294480y30u848XrXlBl
|
||||
agoraAppCertificate=j17q944u49390jhq758u1649448q2y6xfuXrXlBl
|
||||
usernamePayMob=37319104052XrXlBl
|
||||
passwordPayMob='g@nkD2#99k!hD_.wXrXlBl'
|
||||
integrationIdPayMob=0237630XrXlBl
|
||||
payMobApikey='MDrGqKEWS1rVqhjggHvEPDvPjJ7vZDBExrO7S3BEBgrlfUwTA3i5RnP5ZnvoL3M2S9rEBgrlNTdexH5pTPf7NJrvy1reZJv1Tn7zf7vTIDywjHg1C7Ley38HTDyNA3v7TPfdxJrax1rwPmPtMJyzqKEYZeghq3MuLUrFH3A1AgHcH15CZ9UaZTLOxnw0BTdzHHrBArisZerUMUUzZ1BnBeEijHvNjYLnS1BUICMhSmPhA15ifHyVqKEMHWyKLbyuIPvcH9UeL3vZyDf=cvcXrXlBlbbbbb'
|
||||
integrationIdPayMobWallet=0277739XrXlBl
|
||||
ocpApimSubscriptionKey=0f5dacccdbce4131b1a5f952996302e3
|
||||
smsPasswordEgypt="J)Vh=qb/@MXrXlBl"
|
||||
chatGPTkeySeferNew4=zg-vlie-2l1ZlpximLJ6wQOvbb4TnC9XrxgUEyVQIu6TID4qP4FUUqoS5XrXlBl
|
||||
anthropicAIkeySeferNew=zg-qbc-qvo39-mn4VdMQ5nuJeIYhMN4PDYr7qox3-t2i1Lh7aNTDfYF-Gf8whUJZCs47EeelKn8_UcmUMmiSLaf0UJg0DvUlQrDt-76CRrkQQXrXlBl
|
||||
llama3Key=kzg_uTXy3e9DBbCQ1FnMGmxYwTKysx9US1burxJj4fFwOje4LZBUFKJS1XrXlBl
|
||||
payMobOutClientSecrret='xyjjRlkahJM0Xc38WjApCOh8bvgL9slFpNdM9YeCu9AhLqboKMPtmSvc2N9O4tXxFLV2JAV6stBSTAGFGCVubGe6MNpc7MzJnZ3SiT6GpavBoCLWkUvVbdSDaM0zHvuBOXrXlBl'
|
||||
payMobOutClient_id='Z05ut48dVkkS2gI2zenFFcKsfDKfHAU0WELqKyJ0LXrXlBl'
|
||||
payMobOutPassword='D2zJFxkE#LNk3vz38z2dYxpNfWXrXlBl'
|
||||
payMobOutUserName='zjujl_qvo_fwkjfgjlXrXlBl'
|
||||
keyOfApp=balsev@7696tabnaazesmeheregzpfjoXrXrBr
|
||||
initializationVector=qxfyjukwoegrnbivXrXrBr
|
||||
privateKeyFCM=WZSHwLUNI/wlyLUyIZHYf/pgOo6JZplTQqKK2HJmuSJ+r4Iygz/W+03uFPFS4iLv4AIuZ5+wFBDU9gf240fgjhjJgq1bwiW4TrlTh4YhEtHjiPTBCielwIcYFrhrlD4xLTHQC8feSZuZ4t3wZISRfqjuIyu58yhG5H64RifbD5efjzE6KJCivhIpXcK5k1t32lMnlLKzPkSqW2znCXYhRNOQEL+sAllmQNpHVy7LAgr829Jl5AoEuHmYeeCLOIzV5oMdHpQGDDAaG+bo9Yda4n3S1NXNAwU3h8uWsXaAHS1mkgb49+gTJQLfhrxdj2jOHB2HaUA7IyypVXTDuEZzYrYs/+yK2HvmFld/Fqt7ndWqenfl4Qu6+r/JUEHhaGMFNkiChvtVHjLHDOBw7Zrtm5kDzwrvybCVZSrZAwJvudT7eZjRlYrdm2s+v5Q4wVayBslBW02KT/VrXJsuPJKtI7l2jHzIV6M0vmMXU8rlah2gSVl9ZX8mLxcQm7iWbLyWX0S4hixngw3N+j7wltAxYodfkCdJj0BdeH0ZCCKlbANs+lQf5hIzjkC7RcSc2xRnMn1mcyqUlK0BiniSgBSixD3JdpG8UTEYU5nfTVdgsx+fcvje5Dloo6zblKbIVje8vh5MSFjM2yr4nOpbQu95vOW/jSYUjm2WGppCmpBVyWYglp4AlnwDNFL01p3jq+1YixPTZjnp4Bm4XGiGIUnmjBeC18CQ53rg+aWvE7UlOMsoirgU1Y+tAxzbx74xtYfgNjavyD+GtUWkOZPtKSTeR+0uBrfTehFK24QypP5OT3dRbAwRVneySDJOpcQA9xReYpJgoW29GzNLNNoEW+65HIqYQ7WkVj0Z16YOma/WhR4MSHWpOmqxVAYOsGpZw9QnSrY/CFN8uKhYPC4RGONHmk5CP0rTNA0syrBS0XPFsJ8vhgJmB2wjUs46IDX5tFreS7q4axsOSxZMWSQlRHcxSdwFVAepBIfoGWHSUmE0sxpsz+ewCdYtZrWYE0jwEqiTiKR1M4hpn9P1mI0CHri6uRUY2Im86kuEGA5GE9U287rOubVCfC+IxU4vOnNi05fN4lJutdXjweHN7L1ZJ4H0AsFfs8Q3HSHKbn5MTJUlF2rlhNomMlLJnRrDzYiSJ6wIbBXzT8h23WXPMNrTkbh8WkPugEPrp0LTyJI2wurEhhPIlqJwFcpjVVsDmFKmTqMegJsj9C8kHixQ/kyT0AtQ3qTVxgHP/9nxyuglVzdezqlB09yOjVnq/xU+nnTx2RX90Lpf192D23rSvtvfG4LAs2vloKljKG0yIGntFJbikCsv1bQfXwa4cXb6niks4v7irCjLzEtyIDzjYaaSJc0gs69tyumG0bc7AjJa4AvrDtFchN2m9PXGFoOHC0eDMqfANc2VztcYlFEMH0Fp/VsIuiTOSI9Tsb8wjRlrew13EqWUXN48srVHaFfyXUCbSpeelnqCe21EwGOpfgqgUcu/5WdtYH+e7F0Z3xtV6lZNqV7mWYuyyf9C9PviFh0ZECKXivg6vrP4pqDSvuu79ZkR0aTf43NPvGRIIR6Hbjt+Msi3CKsRlLrN8sslxFfB4ZYpQcGmDxTd0vvnarfu0ezz5GU4AXA3Eb4rYdaoB3MRxvbRF/2NMdqb+M5iPTVgRZ7vmDsIogu4O4kgpYNjPE2B66Qz/CbRI6CYFAnF3usKjnNl9k5bFL8d6x+EOZaXm2bZhML5K//tB2TsGl5Bw7sNggC56KqOEOg6WnDIoy4NzzImd8IEamuZdkiaaRl8+/P3Mz+b325kZzAj2e/5feXoup8V/H4edIsIGeIjHNuU+otJ8LQ9EnMFGaZfkiboH7feG1W/n8sZAlusmwcpeISNbskCmQKO44oI8G0WWBpLNo4/5NN1V4XuPGVoIhxQSObLDBHoRttmMNHp3dWv+R9SMxOuswXZYsLUJD5vLD3i9ZzBuLrBdiKgFk7rVFvTrz1CIiBDKeFtvMiEfEtSSQkI5nnh1dHSxRRBrmGa/UME/dCdRGlvTZuHGnq+PgJFlhC3oYLBhOJcw65asHKm94tgLeGeWZ9UytEfuvuL2gIAUUql0sLjgnWBoz84XCkNVMP2fB0Ci6NAbRfE1zJh8PVHezFvvEOl8KvVkLqFtzRqgTvkLV/cjG8bvJsTaHklejY14iv+pG0gYZ4Gkia5jvSzGa3IZEqhOG5hXmEBLcBcfp7ApQ5Ezopt9EJVm4+kRW5nWB6YPiqbzfz8Ab7/uV6GIWSJoG7f0kW1keUtL9SS2n2OxG3S0XWJrYoN9udVviFdl5GqDqTfc4odY9v4fdV3bMgU009S9y6dNRhi3RUTaNIcZHAVbEL0VXzXOi/r4ICjMFXvWVF8xY8RdJPedu9HIbCTq+TPzOgpHoANzm8Rjm2i6J5TLUfqdS7NIHig8M5lni80PlOlnmgvjf5s6PwatrbN6QKMxk8bg6LoI2yGy5ICJ5dncvcR/GgTxHEpz3aknTdMqJMfyST7CmIpTOULEO4zmiKrWYvvlEmaax7j1fJoz4Y1Z29Zm7+mG9lGrCUnsU9CZoAr/d+flJnSWwdwhL/RXhu+pbkdu2gTmg9ar4mwoGYp9GoaefgCIupiL4T3JekNS/MvmZFbiGxl4TVVobj5MsYHawLs5C9AdzjEuK6ktqAr0o1ycBwfj66kuqSnU7KQedmlDs3XmlAqdGk6V2BEs7/b+bfuUJw1FcYf9MVXMQnN1pbDKJVtb+Zrf+AYQ9etUPpsoDxom2NJRgjjdsLkLIPxEZ6HJRAEcnHx49ER+zbdL+7MKolBRzlW4mZHLYkscfx7bqWZsH5PtjDp9Ed1xbHpmwFbv7XV2mYfST6Nu8dLYk/6wkyZybv8hNe1Wj/4o+iMRnOsCUasT9GKF2ezoej1RPzN3GjqR0gfrndn40fXFn4E2n8HP8SKeChiNf++HEzbzd9a7djXE3Xon8/baEaTUBKZUoIZ9OFypU+Ueo0CJpI9CzEipfXp3lGImVhsdQJ2AwRnY6HkXS74sd840HyYzDGL0B8mVvgQwYJQyC+xHRmNUFO9ugmhOmXQjVnkST9XqJpm/vwTAY28C/Al1iKmMjFqWBBNkyRJd6lTus87niZr+tpzBPLW6PZDaAcS5aTPS/dv01W5gLeEhA==
|
||||
sss_pass=wqnmqqsjyvwv:nqrmYJP@17378XrXlBl
|
||||
sss_encryptionSalt=zg-vklie-2l1ZlpxiLJ6wQOvbb4TnC9XrxgUEyVQIu6TID4qP4FUUqoS5XrXlBl
|
||||
addd=BlBlNl
|
||||
getLocationAreaLinks =https://api.tripz-egypt.com/tripz/ride/location/get_location_area_links.php
|
||||
anthropicAIkeySeferNewHamzaayedpython=zg-qbc-qvo39-vCB-WnzEwFNArO0YlTapvfhtmguKWsXJSKqg_NZSjHBYVXMZK1yUK88SobdckV0KuPaBh0c_WHtGsRO_439PBk-e2QqgkQQXrXlBl
|
||||
emailService=seferservice@gmail.com
|
||||
allowed=Tripz:
|
||||
allowedWallet=TripzWallet:
|
||||
passnpassenger=hbgbitbXrXrBr
|
||||
ALLOWED_ADMIN_PHONES=962798583052,962790849027,962787021927
|
||||
newId=new
|
||||
a=q
|
||||
b=x
|
||||
c=f
|
||||
d=y
|
||||
e=j
|
||||
f=u
|
||||
g=k
|
||||
h=w
|
||||
i=o
|
||||
j=e
|
||||
k=g
|
||||
l=r
|
||||
m=n
|
||||
n=b
|
||||
o=i
|
||||
p=v
|
||||
q=a
|
||||
r=l
|
||||
s=z
|
||||
t=c
|
||||
u=h
|
||||
v=p
|
||||
w=t
|
||||
x=d
|
||||
y=s
|
||||
z=m
|
||||
|
||||
A=Q
|
||||
B=X
|
||||
C=F
|
||||
D=Y
|
||||
E=J
|
||||
F=U
|
||||
G=K
|
||||
H=W
|
||||
I=O
|
||||
J=E
|
||||
K=G
|
||||
L=R
|
||||
M=N
|
||||
N=B
|
||||
O=I
|
||||
P=V
|
||||
Q=A
|
||||
R=L
|
||||
S=Z
|
||||
T=C
|
||||
U=H
|
||||
V=P
|
||||
W=T
|
||||
X=D
|
||||
Y=S
|
||||
Z=M
|
||||
5
siro_service/.gitignore
vendored
5
siro_service/.gitignore
vendored
@@ -43,3 +43,8 @@ app.*.map.json
|
||||
/android/app/debug
|
||||
/android/app/profile
|
||||
/android/app/release
|
||||
|
||||
# Sensitive keys & environment files
|
||||
key.properties
|
||||
*.env
|
||||
**/lib/env/env.g.dart
|
||||
|
||||
2137
siro_service/lib/env/env.g.dart
vendored
2137
siro_service/lib/env/env.g.dart
vendored
File diff suppressed because it is too large
Load Diff
55
transform_links.dart
Normal file
55
transform_links.dart
Normal file
@@ -0,0 +1,55 @@
|
||||
import 'dart:io';
|
||||
|
||||
void main(List<String> args) {
|
||||
if (args.isEmpty) {
|
||||
print('Usage: dart transform_links.dart <path_to_links.dart>');
|
||||
return;
|
||||
}
|
||||
|
||||
File file = File(args[0]);
|
||||
if (!file.existsSync()) {
|
||||
print('File not found: ${args[0]}');
|
||||
return;
|
||||
}
|
||||
|
||||
List<String> lines = file.readAsLinesSync();
|
||||
List<String> newLines = [];
|
||||
|
||||
for (String line in lines) {
|
||||
// We only want to transform static String declarations inside the class.
|
||||
if (line.trim().startsWith('static String ') || line.trim().startsWith('static final String ') || line.trim().startsWith('static const String ')) {
|
||||
// Don't transform appDomain or if it's already a getter
|
||||
if (line.contains(' get ') || line.contains('appDomain')) {
|
||||
newLines.add(line);
|
||||
continue;
|
||||
}
|
||||
|
||||
String modified = line;
|
||||
// Remove 'final ' and 'const ' since getters can't be final/const
|
||||
modified = modified.replaceAll('static final String ', 'static String ');
|
||||
modified = modified.replaceAll('static const String ', 'static String ');
|
||||
|
||||
// Replace '=' with '=>' and remove ';' to add it later?
|
||||
// Actually, it's easier: `static String X = Y;` -> `static String get X => Y;`
|
||||
int eqIndex = modified.indexOf('=');
|
||||
if (eqIndex != -1) {
|
||||
String beforeEq = modified.substring(0, eqIndex).trimRight(); // e.g. "static String paymentServer"
|
||||
String afterEq = modified.substring(eqIndex + 1); // e.g. " 'https://...';"
|
||||
|
||||
// Insert 'get ' before the variable name
|
||||
List<String> parts = beforeEq.split(' ');
|
||||
String varName = parts.last;
|
||||
parts.removeLast();
|
||||
beforeEq = parts.join(' ') + ' get ' + varName;
|
||||
|
||||
modified = beforeEq + ' =>' + afterEq;
|
||||
}
|
||||
newLines.add(modified);
|
||||
} else {
|
||||
newLines.add(line);
|
||||
}
|
||||
}
|
||||
|
||||
file.writeAsStringSync(newLines.join('\n'));
|
||||
print('Transformed ${args[0]}');
|
||||
}
|
||||
47
transform_links.py
Normal file
47
transform_links.py
Normal file
@@ -0,0 +1,47 @@
|
||||
import sys
|
||||
import os
|
||||
|
||||
def transform(filepath):
|
||||
if not os.path.exists(filepath):
|
||||
print(f"File not found: {filepath}")
|
||||
return
|
||||
|
||||
with open(filepath, 'r') as f:
|
||||
lines = f.readlines()
|
||||
|
||||
new_lines = []
|
||||
for line in lines:
|
||||
stripped = line.strip()
|
||||
if stripped.startswith('static String ') or stripped.startswith('static final String ') or stripped.startswith('static const String '):
|
||||
if ' get ' in line or 'appDomain' in line:
|
||||
new_lines.append(line)
|
||||
continue
|
||||
|
||||
modified = line.replace('static final String ', 'static String ')
|
||||
modified = modified.replace('static const String ', 'static String ')
|
||||
|
||||
eq_index = modified.find('=')
|
||||
if eq_index != -1:
|
||||
before_eq = modified[:eq_index].rstrip()
|
||||
after_eq = modified[eq_index+1:]
|
||||
|
||||
parts = before_eq.split()
|
||||
var_name = parts[-1]
|
||||
parts.pop()
|
||||
|
||||
before_eq = ' '.join(parts) + ' get ' + var_name
|
||||
modified = before_eq + ' =>' + after_eq
|
||||
new_lines.append(modified)
|
||||
else:
|
||||
new_lines.append(line)
|
||||
|
||||
with open(filepath, 'w') as f:
|
||||
f.writelines(new_lines)
|
||||
print(f"Transformed {filepath}")
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) < 2:
|
||||
print("Usage: python3 transform_links.py <file>")
|
||||
else:
|
||||
for f in sys.argv[1:]:
|
||||
transform(f)
|
||||
292
walletintaleq.intaleq.xyz/mtnpayment.html
Executable file
292
walletintaleq.intaleq.xyz/mtnpayment.html
Executable file
@@ -0,0 +1,292 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ar" dir="rtl">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>الدليل التفاعلي للتكامل بين Intaleq و MTN</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
body { font-family: 'Tajawal', sans-serif; scroll-behavior: smooth; }
|
||||
.code-block { background-color: #1e293b; color: #e2e8f0; padding: 1rem; border-radius: 0.5rem; direction: ltr; text-align: left; font-family: 'Courier New', Courier, monospace; }
|
||||
.tab-active { border-color: #3b82f6; color: #3b82f6; background-color: #eff6ff; }
|
||||
.tab-inactive { border-color: transparent; color: #4b5563; }
|
||||
.endpoint-section { display: none; }
|
||||
.endpoint-section.active { display: block; }
|
||||
.flow-step { position: relative; padding-right: 40px; }
|
||||
.flow-step:not(:last-child)::before { content: ''; position: absolute; right: 15px; top: 40px; bottom: -20px; width: 2px; background-color: #d1d5db; }
|
||||
.flow-number { position: absolute; right: 0; top: 0; width: 32px; height: 32px; }
|
||||
</style>
|
||||
</head>
|
||||
<body class="bg-slate-50 text-slate-800">
|
||||
<div class="max-w-6xl mx-auto p-4 md:p-8">
|
||||
|
||||
<header class="text-center mb-12">
|
||||
<div class="inline-block bg-blue-600 text-white p-4 rounded-full shadow-lg mb-4">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-10 w-10" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" /></svg>
|
||||
</div>
|
||||
<h1 class="text-4xl font-extrabold text-slate-900">الدليل التفاعلي للتكامل بين Intaleq و MTN</h1>
|
||||
<p class="mt-4 text-lg text-slate-600 max-w-3xl mx-auto">دليلك الكامل لفهم واختبار آلية الدفع عبر MTN. تم تصميم هذا الدليل لتسهيل عملية التطوير وضمان تكامل سلس وفعال.</p>
|
||||
</header>
|
||||
|
||||
<div class="bg-white p-8 rounded-2xl shadow-lg border border-slate-200">
|
||||
|
||||
<!-- Flow Section -->
|
||||
<section id="flow" class="mb-12">
|
||||
<h2 class="text-2xl font-bold mb-6 border-r-4 border-blue-500 pr-4">آلية عمل دورة الدفع</h2>
|
||||
<div class="space-y-8">
|
||||
<div class="flow-step">
|
||||
<div class="flow-number flex items-center justify-center bg-slate-200 text-slate-600 rounded-full font-bold text-lg">1</div>
|
||||
<h3 class="font-bold text-lg text-slate-800">إنشاء الفاتورة</h3>
|
||||
<p class="text-slate-600">يبدأ المستخدم (سائق/راكب) عملية الدفع من تطبيق Intaleq، فيقوم نظامنا بإنشاء فاتورة داخلية بحالة "انتظار".</p>
|
||||
</div>
|
||||
<div class="flow-step">
|
||||
<div class="flow-number flex items-center justify-center bg-slate-200 text-slate-600 rounded-full font-bold text-lg">2</div>
|
||||
<h3 class="font-bold text-lg text-slate-800">استعلام MTN</h3>
|
||||
<p class="text-slate-600">عندما يقوم المستخدم بفتح تطبيق MTN Cash Mobile للدفع، يقوم سيرفر MTN بإرسال طلب استعلام إلى سيرفرنا باستخدام رقم هاتف المستخدم للتحقق من وجود فاتورة معلقة وقيمتها.</p>
|
||||
</div>
|
||||
<div class="flow-step">
|
||||
<div class="flow-number flex items-center justify-center bg-slate-200 text-slate-600 rounded-full font-bold text-lg">3</div>
|
||||
<h3 class="font-bold text-lg text-slate-800">تأكيد الدفع</h3>
|
||||
<p class="text-slate-600">بعد أن يكمل المستخدم عملية الدفع بنجاح في تطبيق MTN، يقوم سيرفر MTN بإرسال طلب تأكيد (Webhook) إلى سيرفرنا يحتوي على تفاصيل العملية الناجحة.</p>
|
||||
</div>
|
||||
<div class="flow-step">
|
||||
<div class="flow-number flex items-center justify-center bg-green-500 text-white rounded-full font-bold text-lg">4</div>
|
||||
<h3 class="font-bold text-lg text-slate-800">إتمام العملية</h3>
|
||||
<p class="text-slate-600">يتحقق سيرفرنا من صحة طلب التأكيد، ويقوم بتحديث حالة الفاتورة إلى "مكتملة"، ثم يضيف الرصيد تلقائياً إلى محفظة المستخدم في تطبيق Intaleq.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- Security Section -->
|
||||
<section id="security" class="mb-12 p-6 bg-slate-100 rounded-xl">
|
||||
<h2 class="text-2xl font-bold mb-4 border-r-4 border-blue-500 pr-4">آلية الحماية والتوثيق</h2>
|
||||
<p class="text-slate-700 mb-4">لضمان أن جميع الطلبات تأتي من مصدر موثوق (سيرفرات MTN حصراً)، نعتمد على آلية المفتاح السري المشترك (Shared Secret Key). يجب على سيرفراتكم إرسال هذا المفتاح في كل طلب يتم إرساله إلى نقاط النهاية الخاصة بنا.</p>
|
||||
<div class="bg-white p-4 rounded-lg shadow-sm">
|
||||
<p class="font-semibold">الهيدر المطلوب: <code class="text-red-600">X-AUTH-TOKEN</code></p>
|
||||
<div class="bg-orange-50 border border-orange-200 p-3 rounded-md mt-2">
|
||||
<p class="text-sm text-orange-800 font-medium">سيتم تزويدكم بالمفتاح السري (Secret Key) بشكل آمن عبر قنوات التواصل الرسمية.</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- IP Whitelisting Section -->
|
||||
<section id="ip-whitelisting" class="mb-12 p-6 bg-yellow-50 border border-yellow-300 rounded-xl">
|
||||
<div class="flex items-start">
|
||||
<div class="flex-shrink-0">
|
||||
<svg class="h-6 w-6 text-yellow-500" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/></svg>
|
||||
</div>
|
||||
<div class="mr-4">
|
||||
<h2 class="text-2xl font-bold mb-4 border-r-4 border-yellow-500 pr-4">زيادة مستوى الأمان: القائمة البيضاء (IP Whitelisting)</h2>
|
||||
<p class="text-yellow-800 mb-3">للوصول إلى أعلى مستويات الأمان وحماية التكامل، نعتمد آلية القائمة البيضاء لعناوين IP. هذه الآلية تضمن أن سيرفراتنا لن تقبل الطلبات إلا من سيرفرات MTN المصرح بها حصراً.</p>
|
||||
<div class="bg-white p-4 rounded-lg shadow-sm border border-yellow-200">
|
||||
<p class="font-bold text-slate-800">الإجراء المطلوب:</p>
|
||||
<p class="mt-2 text-slate-700">نرجو منكم تزويدنا بقائمة ثابتة وكاملة لجميع عناوين IP العامة (Public IPs) التي تستخدمونها لإرسال الطلبات إلى نقاط النهاية الخاصة بنا، ليقوم فريقنا بإضافتها إلى جدار الحماية.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
|
||||
<!-- API Endpoints Section -->
|
||||
<section id="api-endpoints">
|
||||
<h2 class="text-2xl font-bold mb-6 border-r-4 border-blue-500 pr-4">نقاط النهاية (API Endpoints)</h2>
|
||||
<div class="flex border-b border-slate-200 mb-6">
|
||||
<button class="api-tab p-4 text-lg font-semibold border-b-2 tab-active" onclick="showEndpoint('query')">1. الاستعلام عن فاتورة</button>
|
||||
<button class="api-tab p-4 text-lg font-semibold border-b-2 tab-inactive" onclick="showEndpoint('webhook')">2. تأكيد الدفع (Webhook)</button>
|
||||
</div>
|
||||
|
||||
<!-- Query Invoice Endpoint -->
|
||||
<div id="query-section" class="endpoint-section active">
|
||||
<h3 class="text-xl font-bold mb-2">نقطة النهاية: الاستعلام عن فاتورة</h3>
|
||||
<p class="mb-4 text-slate-600">تستخدمها سيرفرات MTN للتحقق من وجود فاتورة معلقة لمستخدم معين قبل عرضها له في تطبيق الدفع.</p>
|
||||
<div class="grid md:grid-cols-2 gap-6">
|
||||
<div>
|
||||
<h4 class="font-semibold mb-2">تفاصيل الطلب:</h4>
|
||||
<div class="bg-slate-50 p-4 rounded-lg border border-slate-200 space-y-3">
|
||||
<p><strong>Method:</strong> <span class="bg-sky-100 text-sky-800 font-mono text-sm font-bold mr-2 px-2.5 py-0.5 rounded">GET</span></p>
|
||||
<div>
|
||||
<p><strong>URL:</strong></p>
|
||||
<div class="flex items-center">
|
||||
<code class="text-sm break-all flex-grow" id="queryUrl">https://walletintaleq.intaleq.xyz/v1/main/ride/mtn_new/query_mtn_invoice.php</code>
|
||||
<button onclick="copyToClipboard('queryUrl')" class="text-blue-500 hover:text-blue-700 text-xs mr-2 flex-shrink-0">نسخ</button>
|
||||
</div>
|
||||
</div>
|
||||
<p><strong>Header:</strong> <code class="text-sm">X-AUTH-TOKEN: [المفتاح السري]</code></p>
|
||||
<p><strong>Query Parameter:</strong></p>
|
||||
<ul class="list-disc pr-6 text-sm">
|
||||
<li><code>phone_number</code> (إلزامي): رقم هاتف المستخدم.</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="font-semibold mb-2">جرّب الآن:</h4>
|
||||
<div class="space-y-4">
|
||||
<div>
|
||||
<label for="query-phone" class="block text-sm font-medium text-slate-700">رقم الهاتف:</label>
|
||||
<input type="text" id="query-phone" class="mt-1 block w-full px-3 py-2 bg-white border border-slate-300 rounded-md text-sm shadow-sm placeholder-slate-400 focus:outline-none focus:border-blue-500 focus:ring-1 focus:ring-blue-500" placeholder="e.g., 9639xxxxxxxx">
|
||||
</div>
|
||||
<button onclick="testQuery()" class="w-full bg-blue-600 text-white font-bold py-2 px-4 rounded-lg hover:bg-blue-700 transition duration-300">إرسال طلب استعلام</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-6">
|
||||
<h4 class="font-semibold mb-2">الاستجابات المتوقعة:</h4>
|
||||
<pre id="query-response" class="code-block min-h-[100px]"><code>// The response from the server will appear here...</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Webhook Handler Endpoint -->
|
||||
<div id="webhook-section" class="endpoint-section">
|
||||
<h3 class="text-xl font-bold mb-2">نقطة النهاية: تأكيد الدفع (Webhook)</h3>
|
||||
<p class="mb-4 text-slate-600">بعد إتمام الدفع، يجب على سيرفرات MTN إرسال طلب إلى نقطة النهاية هذه لتأكيد العملية وإضافة الرصيد للمستخدم.</p>
|
||||
<div class="grid md:grid-cols-2 gap-6">
|
||||
<div>
|
||||
<h4 class="font-semibold mb-2">تفاصيل الطلب:</h4>
|
||||
<div class="bg-slate-50 p-4 rounded-lg border border-slate-200 space-y-3">
|
||||
<p><strong>Method:</strong> <span class="bg-green-100 text-green-800 font-mono text-sm font-bold mr-2 px-2.5 py-0.5 rounded">POST</span></p>
|
||||
<div>
|
||||
<p><strong>URL:</strong></p>
|
||||
<div class="flex items-center">
|
||||
<code class="text-sm break-all flex-grow" id="webhookUrl">https://walletintaleq.intaleq.xyz/v1/main/ride/mtn_new/mtn_webhook_handler.php</code>
|
||||
<button onclick="copyToClipboard('webhookUrl')" class="text-blue-500 hover:text-blue-700 text-xs mr-2 flex-shrink-0">نسخ</button>
|
||||
</div>
|
||||
</div>
|
||||
<p><strong>Header:</strong> <code class="text-sm">X-AUTH-TOKEN: [المفتاح السري]</code></p>
|
||||
<p><strong>Body (JSON):</strong> انظر هيكل البيانات أدناه.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="font-semibold mb-2">جرّب الآن:</h4>
|
||||
<div class="space-y-4">
|
||||
<div>
|
||||
<label for="webhook-invoice" class="block text-sm font-medium text-slate-700">رقم الفاتورة:</label>
|
||||
<input type="text" id="webhook-invoice" class="mt-1 block w-full px-3 py-2 bg-white border border-slate-300 rounded-md text-sm shadow-sm" value="MTN-FAKE-12345">
|
||||
</div>
|
||||
<button onclick="testWebhook()" class="w-full bg-blue-600 text-white font-bold py-2 px-4 rounded-lg hover:bg-blue-700 transition duration-300">إرسال طلب تأكيد</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mt-6">
|
||||
<h4 class="font-semibold mb-2">هيكل JSON Body والاستجابات المتوقعة:</h4>
|
||||
<pre id="webhook-response" class="code-block min-h-[200px]"><code>// The response from the server will appear here...
|
||||
|
||||
// Example Request Body:
|
||||
{
|
||||
"invoice_number": "MTN-FAKE-12345",
|
||||
"transaction_id": "MTN_TRX_ABC123456",
|
||||
"amount_paid": 50000.00,
|
||||
"status": "success",
|
||||
"payment_timestamp": "2023-03-15T12:00:00Z"
|
||||
}</code></pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<footer class="text-center mt-8 text-sm text-slate-500">
|
||||
<p>© 2025 Intaleq. All rights reserved.</p>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function showEndpoint(endpoint) {
|
||||
document.querySelectorAll('.endpoint-section').forEach(section => {
|
||||
section.classList.remove('active');
|
||||
});
|
||||
document.getElementById(endpoint + '-section').classList.add('active');
|
||||
|
||||
document.querySelectorAll('.api-tab').forEach(tab => {
|
||||
tab.classList.remove('tab-active');
|
||||
tab.classList.add('tab-inactive');
|
||||
});
|
||||
event.currentTarget.classList.add('tab-active');
|
||||
event.currentTarget.classList.remove('tab-inactive');
|
||||
}
|
||||
|
||||
function copyToClipboard(elementId) {
|
||||
const text = document.getElementById(elementId).innerText;
|
||||
navigator.clipboard.writeText(text).then(() => {
|
||||
alert('تم نسخ: ' + text);
|
||||
}, (err) => {
|
||||
alert('فشل النسخ: ', err);
|
||||
});
|
||||
}
|
||||
|
||||
function testQuery() {
|
||||
const phone = document.getElementById('query-phone').value;
|
||||
const responseEl = document.getElementById('query-response');
|
||||
|
||||
if (!phone) {
|
||||
responseEl.innerHTML = `<code>{\n "status": "error",\n "message": "الرجاء إدخال رقم هاتف."\n}</code>`;
|
||||
return;
|
||||
}
|
||||
|
||||
responseEl.innerHTML = `<code>// Sending request...</code>`;
|
||||
|
||||
// Simulate server responses based on phone number
|
||||
setTimeout(() => {
|
||||
let response = {};
|
||||
if (phone.includes('963911111111')) { // Success case
|
||||
response = {
|
||||
status: "success",
|
||||
invoice_number: "MTN-" + Date.now(),
|
||||
amount: 50000.00,
|
||||
user_name: "محمد الأحمد",
|
||||
user_type: "driver"
|
||||
};
|
||||
} else if (phone.includes('963922222222')) { // No pending invoice
|
||||
response = {
|
||||
status: "not_found",
|
||||
message: "No pending invoice found for this user."
|
||||
};
|
||||
} else { // Generic error / user not found
|
||||
response = {
|
||||
status: "error",
|
||||
message: "User not found or invalid phone number."
|
||||
};
|
||||
}
|
||||
responseEl.innerHTML = `<code>${JSON.stringify(response, null, 4)}</code>`;
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
function testWebhook() {
|
||||
const invoice = document.getElementById('webhook-invoice').value;
|
||||
const responseEl = document.getElementById('webhook-response');
|
||||
|
||||
if (!invoice) {
|
||||
responseEl.innerHTML = `<code>{\n "status": "error",\n "message": "الرجاء إدخال رقم فاتورة."\n}</code>`;
|
||||
return;
|
||||
}
|
||||
|
||||
responseEl.innerHTML = `<code>// Sending request...</code>`;
|
||||
|
||||
setTimeout(() => {
|
||||
let response = {};
|
||||
if(invoice.includes('12345')){ // Success
|
||||
response = {
|
||||
status: "success",
|
||||
message: "Transaction finalized."
|
||||
};
|
||||
} else if (invoice.includes('67890')) { // Already processed
|
||||
response = {
|
||||
status: "error",
|
||||
message: "Invoice not found or already processed."
|
||||
};
|
||||
} else { // Generic invalid
|
||||
response = {
|
||||
status: "error",
|
||||
message: "Invalid or missing parameters."
|
||||
};
|
||||
}
|
||||
responseEl.innerHTML = `<code>${JSON.stringify(response, null, 4)}</code>`;
|
||||
}, 1000);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
12
walletintaleq.intaleq.xyz/ttt.php
Executable file
12
walletintaleq.intaleq.xyz/ttt.php
Executable file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
// token128.php — توليد توكن آمن 128 حرف (hex)
|
||||
|
||||
try {
|
||||
// 64 bytes -> 128 hex chars
|
||||
$token = bin2hex(random_bytes(64));
|
||||
echo "Token (128 chars): " . $token . PHP_EOL;
|
||||
} catch (Exception $e) {
|
||||
// random_bytes قد يرمي Exception إذا لم تتوفر مصادر عشوائية كافية
|
||||
fwrite(STDERR, "Failed to generate token: " . $e->getMessage() . PHP_EOL);
|
||||
exit(1);
|
||||
}
|
||||
12
walletintaleq.intaleq.xyz/v2/composer.json
Normal file
12
walletintaleq.intaleq.xyz/v2/composer.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"name": "root/v1",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Root\\V1\\": "src/"
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"firebase/php-jwt": "^6.11",
|
||||
"vlucas/phpdotenv": "^5.6"
|
||||
}
|
||||
}
|
||||
543
walletintaleq.intaleq.xyz/v2/composer.lock
generated
Normal file
543
walletintaleq.intaleq.xyz/v2/composer.lock
generated
Normal file
@@ -0,0 +1,543 @@
|
||||
{
|
||||
"_readme": [
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "b5ca8e9d1f3a2639d0ba6eaeb261ec12",
|
||||
"packages": [
|
||||
{
|
||||
"name": "firebase/php-jwt",
|
||||
"version": "v6.11.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/firebase/php-jwt.git",
|
||||
"reference": "d1e91ecf8c598d073d0995afa8cd5c75c6e19e66"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/firebase/php-jwt/zipball/d1e91ecf8c598d073d0995afa8cd5c75c6e19e66",
|
||||
"reference": "d1e91ecf8c598d073d0995afa8cd5c75c6e19e66",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"guzzlehttp/guzzle": "^7.4",
|
||||
"phpspec/prophecy-phpunit": "^2.0",
|
||||
"phpunit/phpunit": "^9.5",
|
||||
"psr/cache": "^2.0||^3.0",
|
||||
"psr/http-client": "^1.0",
|
||||
"psr/http-factory": "^1.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-sodium": "Support EdDSA (Ed25519) signatures",
|
||||
"paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Firebase\\JWT\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Neuman Vong",
|
||||
"email": "neuman+pear@twilio.com",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "Anant Narayanan",
|
||||
"email": "anant@php.net",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.",
|
||||
"homepage": "https://github.com/firebase/php-jwt",
|
||||
"keywords": [
|
||||
"jwt",
|
||||
"php"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/firebase/php-jwt/issues",
|
||||
"source": "https://github.com/firebase/php-jwt/tree/v6.11.1"
|
||||
},
|
||||
"time": "2025-04-09T20:32:01+00:00"
|
||||
},
|
||||
{
|
||||
"name": "graham-campbell/result-type",
|
||||
"version": "v1.1.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/GrahamCampbell/Result-Type.git",
|
||||
"reference": "3ba905c11371512af9d9bdd27d99b782216b6945"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/3ba905c11371512af9d9bdd27d99b782216b6945",
|
||||
"reference": "3ba905c11371512af9d9bdd27d99b782216b6945",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.2.5 || ^8.0",
|
||||
"phpoption/phpoption": "^1.9.3"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"GrahamCampbell\\ResultType\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Graham Campbell",
|
||||
"email": "hello@gjcampbell.co.uk",
|
||||
"homepage": "https://github.com/GrahamCampbell"
|
||||
}
|
||||
],
|
||||
"description": "An Implementation Of The Result Type",
|
||||
"keywords": [
|
||||
"Graham Campbell",
|
||||
"GrahamCampbell",
|
||||
"Result Type",
|
||||
"Result-Type",
|
||||
"result"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/GrahamCampbell/Result-Type/issues",
|
||||
"source": "https://github.com/GrahamCampbell/Result-Type/tree/v1.1.3"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/GrahamCampbell",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-07-20T21:45:45+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpoption/phpoption",
|
||||
"version": "1.9.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/schmittjoh/php-option.git",
|
||||
"reference": "e3fac8b24f56113f7cb96af14958c0dd16330f54"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/schmittjoh/php-option/zipball/e3fac8b24f56113f7cb96af14958c0dd16330f54",
|
||||
"reference": "e3fac8b24f56113f7cb96af14958c0dd16330f54",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.2.5 || ^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"bamarni/composer-bin-plugin": "^1.8.2",
|
||||
"phpunit/phpunit": "^8.5.39 || ^9.6.20 || ^10.5.28"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"bamarni-bin": {
|
||||
"bin-links": true,
|
||||
"forward-command": false
|
||||
},
|
||||
"branch-alias": {
|
||||
"dev-master": "1.9-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"PhpOption\\": "src/PhpOption/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"Apache-2.0"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Johannes M. Schmitt",
|
||||
"email": "schmittjoh@gmail.com",
|
||||
"homepage": "https://github.com/schmittjoh"
|
||||
},
|
||||
{
|
||||
"name": "Graham Campbell",
|
||||
"email": "hello@gjcampbell.co.uk",
|
||||
"homepage": "https://github.com/GrahamCampbell"
|
||||
}
|
||||
],
|
||||
"description": "Option Type for PHP",
|
||||
"keywords": [
|
||||
"language",
|
||||
"option",
|
||||
"php",
|
||||
"type"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/schmittjoh/php-option/issues",
|
||||
"source": "https://github.com/schmittjoh/php-option/tree/1.9.3"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/GrahamCampbell",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-07-20T21:41:07+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-ctype",
|
||||
"version": "v1.32.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-ctype.git",
|
||||
"reference": "a3cc8b044a6ea513310cbd48ef7333b384945638"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638",
|
||||
"reference": "a3cc8b044a6ea513310cbd48ef7333b384945638",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2"
|
||||
},
|
||||
"provide": {
|
||||
"ext-ctype": "*"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-ctype": "For best performance"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"thanks": {
|
||||
"url": "https://github.com/symfony/polyfill",
|
||||
"name": "symfony/polyfill"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Symfony\\Polyfill\\Ctype\\": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Gert de Pagter",
|
||||
"email": "BackEndTea@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony polyfill for ctype functions",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"ctype",
|
||||
"polyfill",
|
||||
"portable"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.32.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-09-09T11:45:10+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
"version": "v1.32.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493",
|
||||
"reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-iconv": "*",
|
||||
"php": ">=7.2"
|
||||
},
|
||||
"provide": {
|
||||
"ext-mbstring": "*"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-mbstring": "For best performance"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"thanks": {
|
||||
"url": "https://github.com/symfony/polyfill",
|
||||
"name": "symfony/polyfill"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Symfony\\Polyfill\\Mbstring\\": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony polyfill for the Mbstring extension",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"mbstring",
|
||||
"polyfill",
|
||||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-mbstring/tree/v1.32.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2024-12-23T08:48:59+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php80",
|
||||
"version": "v1.32.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-php80.git",
|
||||
"reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608",
|
||||
"reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.2"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"thanks": {
|
||||
"url": "https://github.com/symfony/polyfill",
|
||||
"name": "symfony/polyfill"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"Symfony\\Polyfill\\Php80\\": ""
|
||||
},
|
||||
"classmap": [
|
||||
"Resources/stubs"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Ion Bazan",
|
||||
"email": "ion.bazan@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"polyfill",
|
||||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/symfony/polyfill-php80/tree/v1.32.0"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://symfony.com/sponsor",
|
||||
"type": "custom"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/fabpot",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-01-02T08:10:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "vlucas/phpdotenv",
|
||||
"version": "v5.6.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/vlucas/phpdotenv.git",
|
||||
"reference": "24ac4c74f91ee2c193fa1aaa5c249cb0822809af"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/24ac4c74f91ee2c193fa1aaa5c249cb0822809af",
|
||||
"reference": "24ac4c74f91ee2c193fa1aaa5c249cb0822809af",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-pcre": "*",
|
||||
"graham-campbell/result-type": "^1.1.3",
|
||||
"php": "^7.2.5 || ^8.0",
|
||||
"phpoption/phpoption": "^1.9.3",
|
||||
"symfony/polyfill-ctype": "^1.24",
|
||||
"symfony/polyfill-mbstring": "^1.24",
|
||||
"symfony/polyfill-php80": "^1.24"
|
||||
},
|
||||
"require-dev": {
|
||||
"bamarni/composer-bin-plugin": "^1.8.2",
|
||||
"ext-filter": "*",
|
||||
"phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-filter": "Required to use the boolean validator."
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"bamarni-bin": {
|
||||
"bin-links": true,
|
||||
"forward-command": false
|
||||
},
|
||||
"branch-alias": {
|
||||
"dev-master": "5.6-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Dotenv\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Graham Campbell",
|
||||
"email": "hello@gjcampbell.co.uk",
|
||||
"homepage": "https://github.com/GrahamCampbell"
|
||||
},
|
||||
{
|
||||
"name": "Vance Lucas",
|
||||
"email": "vance@vancelucas.com",
|
||||
"homepage": "https://github.com/vlucas"
|
||||
}
|
||||
],
|
||||
"description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.",
|
||||
"keywords": [
|
||||
"dotenv",
|
||||
"env",
|
||||
"environment"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/vlucas/phpdotenv/issues",
|
||||
"source": "https://github.com/vlucas/phpdotenv/tree/v5.6.2"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/GrahamCampbell",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2025-04-30T23:37:27+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
"aliases": [],
|
||||
"minimum-stability": "stable",
|
||||
"stability-flags": {},
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": {},
|
||||
"platform-dev": {},
|
||||
"plugin-api-version": "2.6.0"
|
||||
}
|
||||
BIN
walletintaleq.intaleq.xyz/v2/main/.DS_Store
vendored
Executable file
BIN
walletintaleq.intaleq.xyz/v2/main/.DS_Store
vendored
Executable file
Binary file not shown.
17
walletintaleq.intaleq.xyz/v2/main/.env
Executable file
17
walletintaleq.intaleq.xyz/v2/main/.env
Executable file
@@ -0,0 +1,17 @@
|
||||
PASS=@:1F62hwYsdmju^1RpXrXlBl
|
||||
USER=seferli1_spd563608XrXlBl
|
||||
USERNAME=hamzaphFlut@g.cXrXlBl
|
||||
PASSWORD=malFlu@2101Ham
|
||||
SECRET_KEY=seferegypt
|
||||
CLAUDAISEFER=zg-qbc-qvo39-n4VdMQ5nuJeIYhMN4PDYr7qox3-t2i1Lh7aNTDfYF-Gf8whUJZCs47EeelKn8_UcmUMmiSLaf0UJg0DvUlQrDt-76CRrkQQXrXlBl
|
||||
PASSWORDPAYMOB=g@nkD2#99!hD_.wXrXlBl
|
||||
PAYMOBOUTCLIENTSECRET=xyjjRlahJM0Xc38WjApCOh8bvgL9slFpNdM9YeCu9AhLqboKMPtmSvc2N9O4tXxFLV2JAV6stBSTAGFGCVubGe6MNpc7MzJnZ3SiT6GpavBoCLWkUvVbdSDaM0zHvuBOXrXlBl
|
||||
PAYMOBOUTCLIENT_ID=Z05ut48dVkS2gI2zenFFcKsfDKfHAU0WELqKyJ0LXrXlBl
|
||||
PayPalClientIdLive=QZFjAoZfGtngNserll6r3cC56Xl1sVLQkn5dMbyebhzJY59EQ3hz7YxaEqEDYPTUFcQWqvePaQ5UJJVRXrXlBl
|
||||
SMSPASSWORDEGYPT=J)Vh=qb/@MXrXlBl
|
||||
OCP-APIM-SUBSCRIPTION-KEY=3u5yqfffyxfj0797x7q5u851882931j9XrXlBl
|
||||
visionApi=3pALsqSSYTvzp69Q5FMIgbzjG6Z1zktJXrXlBl
|
||||
payPalSecretLive=JQDATqnDfiFpEAN60KB4pGpDaJjyqBAd9jxMBPpzWU1P1k3H1jZhQjn73EHsKQna74P8p98hgOnMaWPWXrXlBl
|
||||
publishableKeyStripe=vg_ropj_57Iiv6MFCBFq3C2n6kNJnZByV6nuDtXe9IjEPOfhmpDtWmt3MLR0gQpiHcQmAFMUPrZc3QiCDjxBZLbxDC3efxWxz33bWH1ZgrsXrXlBl
|
||||
secretKeyStripe=zg_ropj_57Iiv6MFCBFq3C2n6IXlmjykpxDmW93SW3vvXh68UA9T5FORTWgWsT37StKsOPdwDdsy8qR9srMUluahs3nPHvgBa33tGk90vV5XrXlBl
|
||||
passwordnewpassenger=unknown
|
||||
6
walletintaleq.intaleq.xyz/v2/main/.htaccess
Executable file
6
walletintaleq.intaleq.xyz/v2/main/.htaccess
Executable file
@@ -0,0 +1,6 @@
|
||||
# DO NOT REMOVE OR MODIFY. CLOUDLINUX ENV VARS CONFIGURATION BEGIN
|
||||
<IfModule Litespeed>
|
||||
SetEnv appId 12994c6e707543e68d5638894d04f989
|
||||
SetEnv appCertificate e21a388f83034a159f2783889a6d7bcf
|
||||
</IfModule>
|
||||
# DO NOT REMOVE OR MODIFY. CLOUDLINUX ENV VARS CONFIGURATION END
|
||||
BIN
walletintaleq.intaleq.xyz/v2/main/Admin/.DS_Store
vendored
Normal file
BIN
walletintaleq.intaleq.xyz/v2/main/Admin/.DS_Store
vendored
Normal file
Binary file not shown.
103
walletintaleq.intaleq.xyz/v2/main/Admin/AdminCaptain/get.php
Normal file
103
walletintaleq.intaleq.xyz/v2/main/Admin/AdminCaptain/get.php
Normal file
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
include "../../connect.php";
|
||||
|
||||
$sql = "SELECT
|
||||
`driver`.`id`,
|
||||
`driver`.`phone`,
|
||||
`driver`.`email`,
|
||||
`driver`.`gender`,
|
||||
`driver`.`status`,
|
||||
`driver`.`birthdate`,
|
||||
`driver`.`site`,
|
||||
`driver`.`first_name`,
|
||||
`driver`.`last_name`,
|
||||
`driver`.`education`,
|
||||
`driver`.`employmentType`,
|
||||
`driver`.`maritalStatus`,
|
||||
`driver`.`created_at`,
|
||||
`driver`.`updated_at`,
|
||||
(
|
||||
SELECT
|
||||
COUNT(`driver`.`id`)
|
||||
FROM
|
||||
`driver`
|
||||
) AS countPassenger,
|
||||
(
|
||||
SELECT
|
||||
CAST(AVG(`rating`) AS DECIMAL(10, 2))
|
||||
FROM
|
||||
`ratingPassenger`
|
||||
WHERE
|
||||
`ratingPassenger`.`driverID` = `driver`.`id`
|
||||
) AS ratingPassenger,
|
||||
(
|
||||
SELECT
|
||||
COUNT(`ratingPassenger`.`driverID`)
|
||||
FROM
|
||||
`ratingPassenger`
|
||||
WHERE
|
||||
`ratingPassenger`.`driverID` = `driver`.`id`
|
||||
) AS countDriverRate,
|
||||
(
|
||||
SELECT
|
||||
COUNT(`canecl`.`driverID`)
|
||||
FROM
|
||||
`canecl`
|
||||
WHERE
|
||||
`canecl`.`driverID` = `driver`.`id`
|
||||
) AS countPassengerCancel,
|
||||
(
|
||||
SELECT
|
||||
CAST(
|
||||
AVG(`ratingDriver`.`rating`) AS DECIMAL(10, 2)
|
||||
)
|
||||
FROM
|
||||
`ratingDriver`
|
||||
WHERE
|
||||
`ratingDriver`.`driver_id` = `driver`.`id`
|
||||
) AS passengerAverageRating,
|
||||
(
|
||||
SELECT
|
||||
COUNT(`ratingDriver`.`driver_id`)
|
||||
FROM
|
||||
`ratingDriver`
|
||||
WHERE
|
||||
`ratingDriver`.`driver_id` = `driver`.`id`
|
||||
) AS countPassengerRate,
|
||||
(
|
||||
SELECT
|
||||
COUNT(`ride`.`driver_id`)
|
||||
FROM
|
||||
`ride`
|
||||
WHERE
|
||||
`ride`.`driver_id` = `driver`.`id`
|
||||
) AS countPassengerRide,
|
||||
(
|
||||
SELECT
|
||||
`token`
|
||||
FROM
|
||||
`driverToken`
|
||||
WHERE
|
||||
`driverToken`.`captain_id` = `driver`.`id`
|
||||
) AS passengerToken
|
||||
FROM
|
||||
`driver`
|
||||
|
||||
ORDER BY
|
||||
passengerAverageRating
|
||||
DESC
|
||||
LIMIT 10";
|
||||
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->execute();
|
||||
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($stmt->rowCount() > 0) {
|
||||
// Print all the records
|
||||
// printData($result);
|
||||
printSuccess($data = $result);
|
||||
} else {
|
||||
// Print a failure message
|
||||
printFailure($message = "No records found");
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
include "../../connect.php";
|
||||
|
||||
$driver_id = filterRequest("driver_id");
|
||||
$driverEmail = filterRequest("driverEmail");
|
||||
$driverPhone = filterRequest("driverPhone");
|
||||
|
||||
$sql = "SELECT
|
||||
`driver`.`id`,
|
||||
`driver`.`phone`,
|
||||
`driver`.`email`,
|
||||
`driver`.`gender`,
|
||||
`driver`.`status`,
|
||||
`driver`.`birthdate`,
|
||||
`driver`.`site`,
|
||||
`driver`.`first_name`,
|
||||
`driver`.`last_name`,
|
||||
`driver`.`education`,
|
||||
`driver`.`employmentType`,
|
||||
`driver`.`maritalStatus`,
|
||||
`driver`.`created_at`,
|
||||
`driver`.`updated_at`,
|
||||
(
|
||||
SELECT
|
||||
COUNT(`driver`.`id`)
|
||||
FROM
|
||||
`driver`
|
||||
) AS countPassenger,
|
||||
(
|
||||
SELECT
|
||||
CAST(AVG(`rating`) AS DECIMAL(10, 2))
|
||||
FROM
|
||||
`ratingPassenger`
|
||||
WHERE
|
||||
`ratingPassenger`.`driverID` = `driver`.`id`
|
||||
) AS ratingPassenger,
|
||||
(
|
||||
SELECT
|
||||
COUNT(`ratingPassenger`.`driverID`)
|
||||
FROM
|
||||
`ratingPassenger`
|
||||
WHERE
|
||||
`ratingPassenger`.`driverID` = `driver`.`id`
|
||||
) AS countDriverRate,
|
||||
(
|
||||
SELECT
|
||||
COUNT(`canecl`.`driverID`)
|
||||
FROM
|
||||
`canecl`
|
||||
WHERE
|
||||
`canecl`.`driverID` = `driver`.`id`
|
||||
) AS countPassengerCancel,
|
||||
(
|
||||
SELECT
|
||||
CAST(
|
||||
AVG(`ratingDriver`.`rating`) AS DECIMAL(10, 2)
|
||||
)
|
||||
FROM
|
||||
`ratingDriver`
|
||||
WHERE
|
||||
`ratingDriver`.`driver_id` = `driver`.`id`
|
||||
) AS passengerAverageRating,
|
||||
(
|
||||
SELECT
|
||||
COUNT(`ratingDriver`.`driver_id`)
|
||||
FROM
|
||||
`ratingDriver`
|
||||
WHERE
|
||||
`ratingDriver`.`driver_id` = `driver`.`id`
|
||||
) AS countPassengerRate,
|
||||
(
|
||||
SELECT
|
||||
COUNT(`ride`.`driver_id`)
|
||||
FROM
|
||||
`ride`
|
||||
WHERE
|
||||
`ride`.`driver_id` = `driver`.`id`
|
||||
) AS countPassengerRide,
|
||||
(
|
||||
SELECT
|
||||
`token`
|
||||
FROM
|
||||
`driverToken`
|
||||
WHERE
|
||||
`driverToken`.`captain_id` = `driver`.`id`
|
||||
) AS passengerToken
|
||||
FROM
|
||||
`driver`
|
||||
WHERE driver.email = '$driverEmail' OR driver.phone = '$driverPhone' OR driver.id = '$driver_id'
|
||||
|
||||
ORDER BY
|
||||
passengerAverageRating
|
||||
DESC
|
||||
LIMIT 10
|
||||
";
|
||||
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->execute();
|
||||
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($stmt->rowCount() > 0) {
|
||||
// Print all the records
|
||||
// printData($result);
|
||||
printSuccess($data = $result);
|
||||
} else {
|
||||
// Print a failure message
|
||||
printFailure($message = "No records found");
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
include "../../connect.php";
|
||||
|
||||
$driver_id = filterRequest("driver_id");
|
||||
|
||||
$sql = "SELECT
|
||||
`driver`.`id`,
|
||||
`driver`.`phone`,
|
||||
`driver`.`email`,
|
||||
`driver`.`gender`,
|
||||
`driver`.`status`,
|
||||
`driver`.`birthdate`,
|
||||
`driver`.`site`,
|
||||
`driver`.`first_name`,
|
||||
`driver`.`last_name`,
|
||||
`driver`.`education`,
|
||||
`driver`.`employmentType`,
|
||||
`driver`.`maritalStatus`,
|
||||
`driver`.`created_at`,
|
||||
`driver`.`updated_at`,
|
||||
(
|
||||
SELECT
|
||||
COUNT(`driver`.`id`)
|
||||
FROM
|
||||
`driver`
|
||||
) AS countPassenger,
|
||||
(
|
||||
SELECT
|
||||
CAST(AVG(`rating`) AS DECIMAL(10, 2))
|
||||
FROM
|
||||
`ratingPassenger`
|
||||
WHERE
|
||||
`ratingPassenger`.`driverID` = `driver`.`id`
|
||||
) AS ratingPassenger,
|
||||
(
|
||||
SELECT
|
||||
COUNT(`ratingPassenger`.`driverID`)
|
||||
FROM
|
||||
`ratingPassenger`
|
||||
WHERE
|
||||
`ratingPassenger`.`driverID` = `driver`.`id`
|
||||
) AS countDriverRate,
|
||||
(
|
||||
SELECT
|
||||
COUNT(`canecl`.`driverID`)
|
||||
FROM
|
||||
`canecl`
|
||||
WHERE
|
||||
`canecl`.`driverID` = `driver`.`id`
|
||||
) AS countPassengerCancel,
|
||||
(
|
||||
SELECT
|
||||
CAST(
|
||||
AVG(`ratingDriver`.`rating`) AS DECIMAL(10, 2)
|
||||
)
|
||||
FROM
|
||||
`ratingDriver`
|
||||
WHERE
|
||||
`ratingDriver`.`driver_id` = `driver`.`id`
|
||||
) AS passengerAverageRating,
|
||||
(
|
||||
SELECT
|
||||
COUNT(`ratingDriver`.`driver_id`)
|
||||
FROM
|
||||
`ratingDriver`
|
||||
WHERE
|
||||
`ratingDriver`.`driver_id` = `driver`.`id`
|
||||
) AS countPassengerRate,
|
||||
(
|
||||
SELECT
|
||||
COUNT(`ride`.`driver_id`)
|
||||
FROM
|
||||
`ride`
|
||||
WHERE
|
||||
`ride`.`driver_id` = `driver`.`id`
|
||||
) AS countPassengerRide,
|
||||
(
|
||||
SELECT
|
||||
`token`
|
||||
FROM
|
||||
`driverToken`
|
||||
WHERE
|
||||
`driverToken`.`captain_id` = `driver`.`id`
|
||||
) AS passengerToken
|
||||
FROM
|
||||
`driver`
|
||||
WHERE
|
||||
driver.id = '$driver_id'
|
||||
ORDER BY
|
||||
passengerAverageRating
|
||||
DESC
|
||||
LIMIT 10
|
||||
";
|
||||
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->execute();
|
||||
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($stmt->rowCount() > 0) {
|
||||
// Print all the records
|
||||
// printData($result);
|
||||
printSuccess($data = $result);
|
||||
} else {
|
||||
// Print a failure message
|
||||
printFailure($message = "No records found");
|
||||
}
|
||||
?>
|
||||
145
walletintaleq.intaleq.xyz/v2/main/Admin/AdminRide/get.php
Normal file
145
walletintaleq.intaleq.xyz/v2/main/Admin/AdminRide/get.php
Normal file
@@ -0,0 +1,145 @@
|
||||
<?php
|
||||
include "../../connect.php";
|
||||
|
||||
$sql = "SELECT
|
||||
(
|
||||
SELECT
|
||||
TIME_FORMAT(
|
||||
AVG(
|
||||
TIMESTAMPDIFF(
|
||||
SECOND,
|
||||
rideTimeStart,
|
||||
rideTimeFinish
|
||||
)
|
||||
),
|
||||
'%Hh %im'
|
||||
) AS avg_duration
|
||||
FROM
|
||||
ride
|
||||
) AS driver_avg_duration,(
|
||||
SELECT
|
||||
COUNT(*) AS total_rows
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
COUNT(driver_id)
|
||||
FROM
|
||||
ride
|
||||
GROUP BY
|
||||
driver_id
|
||||
) sub
|
||||
) AS num_Driver,
|
||||
(
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
ride
|
||||
) AS total_rides,
|
||||
(
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
ride
|
||||
WHERE
|
||||
STATUS
|
||||
= 'waiting'
|
||||
) AS ongoing_rides,
|
||||
(
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
ride
|
||||
WHERE
|
||||
STATUS
|
||||
= 'Finished'
|
||||
) AS completed_rides,
|
||||
(
|
||||
SELECT
|
||||
COUNT(*)
|
||||
FROM
|
||||
ride
|
||||
WHERE
|
||||
STATUS
|
||||
= 'cancelled'
|
||||
) AS cancelled_rides,
|
||||
(
|
||||
SELECT
|
||||
MAX(
|
||||
TIME_FORMAT(
|
||||
TIMESTAMPDIFF(
|
||||
SECOND,
|
||||
rideTimeStart,
|
||||
rideTimeFinish
|
||||
),
|
||||
'%Hh %im'
|
||||
)
|
||||
) AS duration
|
||||
FROM
|
||||
ride
|
||||
) AS longest_duration,
|
||||
(
|
||||
SELECT
|
||||
ROUND(SUM(DISTANCE),
|
||||
2)
|
||||
FROM
|
||||
ride
|
||||
) AS total_distance,
|
||||
(
|
||||
SELECT
|
||||
ROUND(AVG(DISTANCE),
|
||||
2)
|
||||
FROM
|
||||
ride
|
||||
) AS average_distance,
|
||||
(
|
||||
SELECT
|
||||
ROUND(MAX(DISTANCE),
|
||||
2)
|
||||
FROM
|
||||
ride
|
||||
) AS longest_distance,
|
||||
(
|
||||
SELECT
|
||||
SUM(price_for_driver)
|
||||
FROM
|
||||
ride
|
||||
) AS total_driver_earnings,
|
||||
(
|
||||
SELECT
|
||||
SUM(`price_for_passenger`)
|
||||
FROM
|
||||
ride
|
||||
) AS total_company_earnings,
|
||||
(
|
||||
ROUND(
|
||||
(
|
||||
SELECT
|
||||
SUM(`price_for_passenger`)
|
||||
FROM
|
||||
ride
|
||||
) /(
|
||||
SELECT
|
||||
SUM(price_for_driver)
|
||||
FROM
|
||||
ride
|
||||
),
|
||||
2
|
||||
)
|
||||
) AS companyPercent
|
||||
FROM
|
||||
ride
|
||||
LIMIT 1";
|
||||
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->execute();
|
||||
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($stmt->rowCount() > 0) {
|
||||
// Print all the records
|
||||
// printData($result);
|
||||
printSuccess($data = $result);
|
||||
} else {
|
||||
// Print a failure message
|
||||
printFailure($message = "No records found");
|
||||
}
|
||||
?>
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
include "../../connect.php";
|
||||
|
||||
$currentYear = date('Y');
|
||||
|
||||
$sql = "SELECT
|
||||
YEAR(date) AS year,
|
||||
MONTH(date) AS month,
|
||||
DAY(date) AS day,
|
||||
COUNT(*) AS rides_count,
|
||||
(SELECT COUNT(*) FROM ride WHERE MONTH(date) = MONTH(CURRENT_DATE) AND YEAR(date) = YEAR(CURRENT_DATE)) AS current_month_rides_count
|
||||
FROM
|
||||
ride
|
||||
GROUP BY
|
||||
YEAR(date),
|
||||
MONTH(date),
|
||||
DAY(date)
|
||||
ORDER BY
|
||||
YEAR(date),
|
||||
MONTH(date),
|
||||
DAY(date)";
|
||||
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->execute();
|
||||
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
if ($stmt->rowCount() > 0) {
|
||||
// Print all the records
|
||||
// printData($result);
|
||||
printSuccess($data = $result);
|
||||
} else {
|
||||
// Print a failure message
|
||||
printFailure($message = "No records found");
|
||||
}
|
||||
?>
|
||||
25
walletintaleq.intaleq.xyz/v2/main/Admin/adminUser/add.php
Normal file
25
walletintaleq.intaleq.xyz/v2/main/Admin/adminUser/add.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
include "../../connect.php";
|
||||
|
||||
$deviceNumber = filterRequest("deviceNumber"); // Assuming you'll get deviceNumber as input
|
||||
$name = filterRequest("name");
|
||||
|
||||
$sql = "INSERT INTO `adminUser`(`id`, `device_number`, `name`) VALUES (
|
||||
UUID(),
|
||||
:deviceNumber,
|
||||
:name
|
||||
)";
|
||||
|
||||
$stmt = $con->prepare($sql);
|
||||
$stmt->bindParam(':deviceNumber', $deviceNumber);
|
||||
$stmt->bindParam(':name', $name);
|
||||
$stmt->execute();
|
||||
|
||||
if ($stmt->rowCount() > 0) {
|
||||
// Print a success message
|
||||
printSuccess($message = "Admin user data saved successfully");
|
||||
} else {
|
||||
// Print a failure message
|
||||
printFailure($message = "Failed to save admin user data");
|
||||
}
|
||||
?>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user