Port all fixes from IntaleqApp (Wallet, CLIQ, OTP, Docker)
This commit is contained in:
@@ -177,8 +177,10 @@ try {
|
|||||||
$isRegistered = false;
|
$isRegistered = false;
|
||||||
$driverData = null;
|
$driverData = null;
|
||||||
|
|
||||||
$chkStmt = $con->prepare("SELECT id, first_name, last_name, email, phone FROM driver WHERE phone = ?");
|
$chkStmt = $con->prepare("SELECT id, first_name, last_name, email, phone FROM driver WHERE phone = ? OR (? IS NOT NULL AND phone_bidx = ?)");
|
||||||
$chkStmt->execute([$encryptionHelper->encryptData($phone_number)]);
|
global $blindIndex;
|
||||||
|
$phoneBidx = $blindIndex ? $blindIndex->index('driver.phone', $phone_number) : null;
|
||||||
|
$chkStmt->execute([$encryptionHelper->encryptData($phone_number), $phoneBidx, $phoneBidx]);
|
||||||
$driver = $chkStmt->fetch(PDO::FETCH_ASSOC);
|
$driver = $chkStmt->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
// Generate driverID for unregistered users (hash of phone)
|
// Generate driverID for unregistered users (hash of phone)
|
||||||
@@ -273,8 +275,10 @@ try {
|
|||||||
$passengerData = null;
|
$passengerData = null;
|
||||||
$passengerID = '';
|
$passengerID = '';
|
||||||
|
|
||||||
$chkStmt = $con->prepare("SELECT id, first_name, last_name, email, phone FROM passengers WHERE phone = ?");
|
$chkStmt = $con->prepare("SELECT id, first_name, last_name, email, phone FROM passengers WHERE phone = ? OR (? IS NOT NULL AND phone_bidx = ?)");
|
||||||
$chkStmt->execute([$encryptionHelper->encryptData($phone_number)]);
|
global $blindIndex;
|
||||||
|
$phoneBidx = $blindIndex ? $blindIndex->index('passengers.phone', $phone_number) : null;
|
||||||
|
$chkStmt->execute([$encryptionHelper->encryptData($phone_number), $phoneBidx, $phoneBidx]);
|
||||||
$passenger = $chkStmt->fetch(PDO::FETCH_ASSOC);
|
$passenger = $chkStmt->fetch(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
if ($passenger) {
|
if ($passenger) {
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ try {
|
|||||||
$firstName_encrypted = $encryptionHelper->encryptData($firstName);
|
$firstName_encrypted = $encryptionHelper->encryptData($firstName);
|
||||||
$lastName_encrypted = $encryptionHelper->encryptData($lastName);
|
$lastName_encrypted = $encryptionHelper->encryptData($lastName);
|
||||||
$email_encrypted = $encryptionHelper->encryptData($email);
|
$email_encrypted = $encryptionHelper->encryptData($email);
|
||||||
$uniqueId = substr(md5($phoneNumber), 0, 20);
|
$uniqueId = substr(md5($phoneNumber), 0, 16);
|
||||||
$password_hashed = password_hash($email . $uniqueId, PASSWORD_DEFAULT);
|
$password_hashed = password_hash($email . $uniqueId, PASSWORD_DEFAULT);
|
||||||
$unknown_encrypted = $encryptionHelper->encryptData("unknown yet");
|
$unknown_encrypted = $encryptionHelper->encryptData("unknown yet");
|
||||||
|
|
||||||
@@ -77,12 +77,13 @@ try {
|
|||||||
// (مهلة أوسع من صلاحية الرمز نفسه [5 دقائق] لإعطاء وقت كافٍ لإكمال
|
// (مهلة أوسع من صلاحية الرمز نفسه [5 دقائق] لإعطاء وقت كافٍ لإكمال
|
||||||
// نموذج التسجيل بعد التحقق مباشرة).
|
// نموذج التسجيل بعد التحقق مباشرة).
|
||||||
$step = 4.5;
|
$step = 4.5;
|
||||||
|
$otpSearchKey = otpPhoneKey($phoneNumber);
|
||||||
$verifyCheckStmt = $con->prepare(
|
$verifyCheckStmt = $con->prepare(
|
||||||
"SELECT id FROM phone_verification_passenger
|
"SELECT id FROM phone_verification_passenger
|
||||||
WHERE phone_number = ? AND verified = 1 AND created_at > DATE_SUB(NOW(), INTERVAL 30 MINUTE)
|
WHERE phone_number = ? AND verified = 1 AND created_at > DATE_SUB(NOW(), INTERVAL 30 MINUTE)
|
||||||
LIMIT 1"
|
LIMIT 1"
|
||||||
);
|
);
|
||||||
$verifyCheckStmt->execute([$phoneNumber_encrypted]);
|
$verifyCheckStmt->execute([$otpSearchKey]);
|
||||||
if ($verifyCheckStmt->rowCount() === 0) {
|
if ($verifyCheckStmt->rowCount() === 0) {
|
||||||
error_log("$logTag Step 4.5 Error: Phone number not verified via OTP.");
|
error_log("$logTag Step 4.5 Error: Phone number not verified via OTP.");
|
||||||
jsonError("Phone number must be verified before registration.");
|
jsonError("Phone number must be verified before registration.");
|
||||||
|
|||||||
@@ -30,8 +30,8 @@ services:
|
|||||||
# التقسيم لأبعد من هذا لا يضيف أداءً — نفس الصورة، نفس النواة.
|
# التقسيم لأبعد من هذا لا يضيف أداءً — نفس الصورة، نفس النواة.
|
||||||
php:
|
php:
|
||||||
build:
|
build:
|
||||||
context: ./php
|
context: ..
|
||||||
dockerfile: Dockerfile.fpm
|
dockerfile: docker/php/Dockerfile.fpm
|
||||||
args:
|
args:
|
||||||
PHP_VERSION: "${PHP_VERSION:-8.2}"
|
PHP_VERSION: "${PHP_VERSION:-8.2}"
|
||||||
volumes:
|
volumes:
|
||||||
@@ -67,7 +67,9 @@ services:
|
|||||||
# TLS على هذا المنفذ (https://…:2020) فتتجمّد المصافحة وينتهي بـ timeout.
|
# TLS على هذا المنفذ (https://…:2020) فتتجمّد المصافحة وينتهي بـ timeout.
|
||||||
# nginx على المضيف يستمع على 2020 بالشهادة ويمرّر إلى 12020 هنا.
|
# nginx على المضيف يستمع على 2020 بالشهادة ويمرّر إلى 12020 هنا.
|
||||||
# انظر nginx/siro-sockets-tls.conf
|
# انظر nginx/siro-sockets-tls.conf
|
||||||
- "127.0.0.1:12020:2020"
|
# المنفذ قابل للضبط: على سيرفر تعمل عليه أكثر من نسخة (siro/tripz/intaleq)
|
||||||
|
# يتصادم 12020 الثابت فلا تبدأ الحاوية أصلاً. اضبط DRIVER_SOCKET_PORT في .env.
|
||||||
|
- "127.0.0.1:${DRIVER_SOCKET_PORT:-12020}:2020"
|
||||||
# و2021 داخلي فقط: الباك إند يناديه عبر http://socket_driver:2021
|
# و2021 داخلي فقط: الباك إند يناديه عبر http://socket_driver:2021
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- redis
|
||||||
@@ -90,7 +92,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
# نفس منطق سوكيت السائقين: nginx على المضيف يستمع على 3030 بالشهادة
|
# نفس منطق سوكيت السائقين: nginx على المضيف يستمع على 3030 بالشهادة
|
||||||
# ويمرّر إلى 13030 هنا. و3031 داخلي فقط (http://socket_passenger:3031).
|
# ويمرّر إلى 13030 هنا. و3031 داخلي فقط (http://socket_passenger:3031).
|
||||||
- "127.0.0.1:13030:3030"
|
- "127.0.0.1:${PASSENGER_SOCKET_PORT:-13030}:3030"
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- redis
|
||||||
mem_limit: 512m
|
mem_limit: 512m
|
||||||
|
|||||||
@@ -6,4 +6,9 @@ ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/do
|
|||||||
RUN chmod +x /usr/local/bin/install-php-extensions && \
|
RUN chmod +x /usr/local/bin/install-php-extensions && \
|
||||||
install-php-extensions mysqli pdo_mysql redis opcache gd zip @composer
|
install-php-extensions mysqli pdo_mysql redis opcache gd zip @composer
|
||||||
|
|
||||||
|
# تثبيت مكتبات سيرفر المدفوعات (firebase/php-jwt وغيره)
|
||||||
|
# هذا يخبز vendor/ داخل الصورة مباشرة حتى لا يعتمد على مجلد خارجي
|
||||||
|
COPY payment_server/v2/composer.json payment_server/v2/composer.lock /var/www/v2/
|
||||||
|
RUN cd /var/www/v2 && composer install --no-dev --no-interaction --optimize-autoloader
|
||||||
|
|
||||||
WORKDIR /var/www
|
WORKDIR /var/www
|
||||||
|
|||||||
@@ -1,55 +1,63 @@
|
|||||||
<?php
|
<?php
|
||||||
// Load environment variables from .env file
|
// connect.php — نسخة الدوكر
|
||||||
require_once realpath(__DIR__ . '/../vendor/autoload.php');
|
// ─────────────────────────────────────────────────────────────
|
||||||
require_once 'load_env.php';
|
// • vendor/ مخبوز داخل الصورة في /var/www/v2/vendor (Dockerfile يشغّل composer install)
|
||||||
$envFile = '/home/intaleq-walletintaleq/env/.env';
|
// • متغيّرات البيئة تصل عبر env_file في docker-compose → getenv() يعمل مباشرةً
|
||||||
if (!file_exists($envFile)) {
|
// ─────────────────────────────────────────────────────────────
|
||||||
$envFile = __DIR__ . '/../.env';
|
|
||||||
|
// 1. Autoload — vendor مخبوز داخل الصورة
|
||||||
|
$autoload = __DIR__ . '/../vendor/autoload.php';
|
||||||
|
if (file_exists($autoload)) {
|
||||||
|
require_once $autoload;
|
||||||
}
|
}
|
||||||
loadEnvironment($envFile);
|
|
||||||
|
|
||||||
// Get environment variables (You don't need user/pass for JWT auth itself)
|
// 2. لا حاجة لتحميل .env يدوياً: Docker يحقن المتغيّرات عبر env_file
|
||||||
$secretKey = getenv('SECRET_KEY'); // Only need the secret key now
|
// نحتفظ بـ load_env.php فقط لبيئة التطوير خارج الدوكر
|
||||||
|
if (!getenv('DB_PAYMENT_HOST')) {
|
||||||
|
// نحن خارج بيئة الدوكر — جرّب تحميل .env يدوياً
|
||||||
|
if (file_exists(__DIR__ . '/load_env.php')) {
|
||||||
|
require_once 'load_env.php';
|
||||||
|
$envFile = __DIR__ . '/../.env';
|
||||||
|
if (file_exists($envFile)) loadEnvironment($envFile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// --- CORS Headers ---
|
// 3. CORS Headers
|
||||||
header("Access-Control-Allow-Origin: https://wallet.siromove.com");
|
header("Access-Control-Allow-Origin: *");
|
||||||
header("Access-Control-Allow-Methods: GET, POST, OPTIONS"); // Adjust as needed
|
header("Access-Control-Allow-Methods: GET, POST, OPTIONS");
|
||||||
header("Access-Control-Allow-Headers: Content-Type, Authorization");
|
header("Access-Control-Allow-Headers: Content-Type, Authorization");
|
||||||
header('Content-Type: application/json'); // Set content type to JSON
|
header('Content-Type: application/json');
|
||||||
|
|
||||||
// Handle preflight requests (OPTIONS)
|
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
|
||||||
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
|
|
||||||
http_response_code(200);
|
http_response_code(200);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- Database Connection (Still needed for your application logic) ---
|
// 4. Database Connection
|
||||||
try {
|
try {
|
||||||
$dbname = getenv('DB_PAYMENT_NAME') ?: (getenv('dbname') ?: 'payment');
|
$dbname = getenv('DB_PAYMENT_NAME') ?: 'paymentDB';
|
||||||
$dbHost = getenv('DB_PAYMENT_HOST') ?: (getenv('DB_HOST') ?: 'mysql');
|
$dbHost = getenv('DB_PAYMENT_HOST') ?: 'mysql';
|
||||||
|
$user = getenv('DB_PAYMENT_USER') ?: 'root';
|
||||||
|
$pass = getenv('DB_PAYMENT_PASS') ?: getenv('MYSQL_ROOT_PASSWORD') ?: '';
|
||||||
|
|
||||||
$dsn = "mysql:host=$dbHost;dbname=$dbname;charset=utf8mb4";
|
$dsn = "mysql:host=$dbHost;dbname=$dbname;charset=utf8mb4";
|
||||||
|
|
||||||
$options = [
|
$options = [
|
||||||
PDO::ATTR_EMULATE_PREPARES => false,
|
PDO::ATTR_EMULATE_PREPARES => false,
|
||||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,
|
||||||
PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES UTF8"
|
PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES UTF8",
|
||||||
];
|
];
|
||||||
$user = getenv('DB_PAYMENT_USER') ?: (getenv('USER') ?: 'root');
|
|
||||||
$pass = getenv('DB_PAYMENT_PASS') ?: (getenv('PASS') ?: getenv('MYSQL_ROOT_PASSWORD'));
|
|
||||||
$con = new PDO($dsn, $user, $pass, $options);
|
$con = new PDO($dsn, $user, $pass, $options);
|
||||||
|
|
||||||
// echo $con;
|
|
||||||
// --- JWT Authentication ---
|
|
||||||
include "functions.php"; // Include the functions file
|
|
||||||
|
|
||||||
$decodedToken = authenticateJWT(); // Call the authentication function
|
|
||||||
|
|
||||||
|
// 5. JWT Authentication
|
||||||
|
include __DIR__ . "/functions.php";
|
||||||
|
$decodedToken = authenticateJWT();
|
||||||
|
|
||||||
} catch (PDOException $e) {
|
} catch (PDOException $e) {
|
||||||
error_log($e->getMessage());
|
error_log('[WALLET] DB Error: ' . $e->getMessage());
|
||||||
http_response_code(500); // Internal Server Error
|
http_response_code(500);
|
||||||
echo json_encode(['error' => 'A database error occurred.']);
|
echo json_encode(['error' => 'A database error occurred.']);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -7,7 +7,7 @@ try {
|
|||||||
$userId = filterRequest("user_id");
|
$userId = filterRequest("user_id");
|
||||||
$userType = filterRequest("user_type");
|
$userType = filterRequest("user_type");
|
||||||
$amount = filterRequest("amount");
|
$amount = filterRequest("amount");
|
||||||
$cliqPhone = filterRequest("cliq_phone");
|
$cliqPhone = filterRequest("cliq_phone") ?: filterRequest("click_phone");
|
||||||
$phone = filterRequest("phone");
|
$phone = filterRequest("phone");
|
||||||
|
|
||||||
if (empty($userId) || empty($userType) || !is_numeric($amount) || $amount <= 0 || empty($cliqPhone)) {
|
if (empty($userId) || empty($userType) || !is_numeric($amount) || $amount <= 0 || empty($cliqPhone)) {
|
||||||
@@ -37,14 +37,12 @@ try {
|
|||||||
$upd = $con->prepare("
|
$upd = $con->prepare("
|
||||||
UPDATE cliq_invoices
|
UPDATE cliq_invoices
|
||||||
SET amount = :amount,
|
SET amount = :amount,
|
||||||
phone = :phone,
|
|
||||||
cliq_phone = :cliq_phone,
|
cliq_phone = :cliq_phone,
|
||||||
updated_at = NOW()
|
updated_at = NOW()
|
||||||
WHERE id = :id
|
WHERE id = :id
|
||||||
");
|
");
|
||||||
$upd->execute([
|
$upd->execute([
|
||||||
':amount' => $amount,
|
':amount' => $amount,
|
||||||
':phone' => $phone ?: null,
|
|
||||||
':cliq_phone' => $cliqPhone,
|
':cliq_phone' => $cliqPhone,
|
||||||
':id' => $existing['id'],
|
':id' => $existing['id'],
|
||||||
]);
|
]);
|
||||||
@@ -62,15 +60,14 @@ try {
|
|||||||
|
|
||||||
$ins = $con->prepare("
|
$ins = $con->prepare("
|
||||||
INSERT INTO cliq_invoices
|
INSERT INTO cliq_invoices
|
||||||
(invoice_number, user_id, user_type, phone, amount, cliq_phone, status, created_at, updated_at)
|
(invoice_number, user_id, user_type, amount, cliq_phone, status, created_at, updated_at)
|
||||||
VALUES
|
VALUES
|
||||||
(:invoice_number, :user_id, :user_type, :phone, :amount, :cliq_phone, 'pending', NOW(), NOW())
|
(:invoice_number, :user_id, :user_type, :amount, :cliq_phone, 'pending', NOW(), NOW())
|
||||||
");
|
");
|
||||||
$ins->execute([
|
$ins->execute([
|
||||||
':invoice_number' => $invoiceNumber,
|
':invoice_number' => $invoiceNumber,
|
||||||
':user_id' => $userId,
|
':user_id' => $userId,
|
||||||
':user_type' => $userType,
|
':user_type' => $userType,
|
||||||
':phone' => $phone ?: null,
|
|
||||||
':amount' => $amount,
|
':amount' => $amount,
|
||||||
':cliq_phone' => $cliqPhone
|
':cliq_phone' => $cliqPhone
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -3,13 +3,13 @@ include "../../connect.php";
|
|||||||
$passenger_id = filterRequest("passenger_id");
|
$passenger_id = filterRequest("passenger_id");
|
||||||
|
|
||||||
$sql = "SELECT
|
$sql = "SELECT
|
||||||
COALESCE(dummy.passenger_id, '$passenger_id') AS passenger_id,
|
COALESCE(dummy.passenger_id, :passenger_id) AS passenger_id,
|
||||||
COALESCE(SUM(pw.balance), 0) AS total, -- Adjust column to represent payments
|
COALESCE(SUM(pw.balance), 0) AS total,
|
||||||
COALESCE(p.first_name, '') AS first_name,
|
COALESCE(p.first_name, '') AS first_name,
|
||||||
COALESCE(p.last_name, '') AS last_name,
|
COALESCE(p.last_name, '') AS last_name,
|
||||||
COALESCE(p.phone, '') AS phone
|
COALESCE(p.phone, '') AS phone
|
||||||
FROM
|
FROM
|
||||||
(SELECT '$passenger_id' AS passenger_id) AS dummy
|
(SELECT :passenger_id2 AS passenger_id) AS dummy
|
||||||
LEFT JOIN `passengerWallet` pw ON pw.passenger_id = dummy.passenger_id
|
LEFT JOIN `passengerWallet` pw ON pw.passenger_id = dummy.passenger_id
|
||||||
LEFT JOIN passengers p ON p.id = dummy.passenger_id
|
LEFT JOIN passengers p ON p.id = dummy.passenger_id
|
||||||
GROUP BY
|
GROUP BY
|
||||||
@@ -17,17 +17,13 @@ GROUP BY
|
|||||||
LIMIT 0, 25;
|
LIMIT 0, 25;
|
||||||
";
|
";
|
||||||
$stmt = $con->prepare($sql);
|
$stmt = $con->prepare($sql);
|
||||||
$stmt->execute();
|
$stmt->execute(['passenger_id' => $passenger_id, 'passenger_id2' => $passenger_id]);
|
||||||
|
|
||||||
if ($stmt->rowCount() > 0) {
|
// LEFT JOIN يُرجع دائماً صفاً واحداً على الأقل (balance=0 إذا لم توجد محفظة)
|
||||||
// Fetch the record
|
$row = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||||
$row = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
if (!empty($row)) {
|
||||||
|
printSuccess($row);
|
||||||
printSuccess( $row);
|
} else {
|
||||||
|
printFailure("No wallet record found");
|
||||||
}
|
|
||||||
else{
|
|
||||||
// Print a failure message
|
|
||||||
printFailure($message = "No wallet record found");
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
@@ -97,6 +97,15 @@ class PhoneAuthHelper {
|
|||||||
// ✅ المستخدم موجود مسبقاً -> تسجيل دخول مباشر
|
// ✅ المستخدم موجود مسبقاً -> تسجيل دخول مباشر
|
||||||
await _handleSuccessfulLogin(data['message']['passenger']);
|
await _handleSuccessfulLogin(data['message']['passenger']);
|
||||||
} else {
|
} else {
|
||||||
|
// ✅ Save the new JWT token for registration before navigating
|
||||||
|
final jwtToken = data['message']?['jwt'] ??
|
||||||
|
data['message']?['token'] ??
|
||||||
|
data['message']?['access_token'];
|
||||||
|
if (jwtToken != null && jwtToken.toString().isNotEmpty) {
|
||||||
|
box.write(BoxName.jwt, c(jwtToken.toString()));
|
||||||
|
await storage.write(
|
||||||
|
key: BoxName.jwt, value: c(jwtToken.toString()));
|
||||||
|
}
|
||||||
// ✅ مستخدم جديد -> الذهاب لصفحة التسجيل
|
// ✅ مستخدم جديد -> الذهاب لصفحة التسجيل
|
||||||
mySnackbarSuccess(
|
mySnackbarSuccess(
|
||||||
'Phone verified. Please complete registration.'.tr);
|
'Phone verified. Please complete registration.'.tr);
|
||||||
@@ -144,13 +153,16 @@ class PhoneAuthHelper {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
final data = (response);
|
final data = (response);
|
||||||
if (data != 'failure') {
|
if (data != 'failure' && data is Map) {
|
||||||
// Registration successful, log user in
|
if (data['status'] == 'success') {
|
||||||
|
// Registration successful, log user in
|
||||||
await _handleSuccessfulLogin(data['message']['data']);
|
await _handleSuccessfulLogin(data['message']['data']);
|
||||||
|
} else {
|
||||||
|
mySnackbarError(
|
||||||
|
data['message']?.toString() ?? "Registration failed.".tr);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
mySnackbarError(
|
mySnackbarError("Server error or user already exists.".tr);
|
||||||
"User with this phone number or email already exists.".tr);
|
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
Log.print('e: ${e}');
|
Log.print('e: ${e}');
|
||||||
|
|||||||
@@ -53,8 +53,13 @@ class PaymentController extends GetxController {
|
|||||||
await CRUD().getWallet(
|
await CRUD().getWallet(
|
||||||
link: AppLink.getWalletByPassenger,
|
link: AppLink.getWalletByPassenger,
|
||||||
payload: {'passenger_id': box.read(BoxName.passengerID)}).then((value) {
|
payload: {'passenger_id': box.read(BoxName.passengerID)}).then((value) {
|
||||||
box.write(BoxName.passengerWalletTotal,
|
final msg = value['message'];
|
||||||
value['message'][0]['total'].toString());
|
if (msg is List && msg.isNotEmpty) {
|
||||||
|
box.write(BoxName.passengerWalletTotal,
|
||||||
|
(msg[0]['total'] ?? '0').toString());
|
||||||
|
} else {
|
||||||
|
box.write(BoxName.passengerWalletTotal, '0');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
update();
|
update();
|
||||||
|
|||||||
Reference in New Issue
Block a user