diff --git a/backend/ride/tips/add.php b/backend/ride/tips/add.php index 4acff87..f0b3c5f 100755 --- a/backend/ride/tips/add.php +++ b/backend/ride/tips/add.php @@ -9,7 +9,7 @@ $tipAmount = filterRequest("tipAmount"); $countryCode = filterRequest("country_code"); // sent from flutter // تحقق من صحة قيمة البقشيش -if (!is_numeric($tipAmount) || $tipAmount <= 0 || $tipAmount > 99999999.99) { +if (!is_numeric($tipAmount) || $tipAmount <= 0 || $tipAmount > 599.99) { echo json_encode(["status" => "failure", "message" => "Invalid tip amount."]); exit(); } diff --git a/walletintaleq.intaleq.xyz/v2/main/.DS_Store b/walletintaleq.intaleq.xyz/v2/main/.DS_Store deleted file mode 100755 index 9800318..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/.DS_Store and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/.env b/walletintaleq.intaleq.xyz/v2/main/.env deleted file mode 100755 index b6a8017..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/.env +++ /dev/null @@ -1,17 +0,0 @@ -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 \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/.htaccess b/walletintaleq.intaleq.xyz/v2/main/.htaccess deleted file mode 100755 index 9486526..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/.htaccess +++ /dev/null @@ -1,6 +0,0 @@ -# DO NOT REMOVE OR MODIFY. CLOUDLINUX ENV VARS CONFIGURATION BEGIN - -SetEnv appId 12994c6e707543e68d5638894d04f989 -SetEnv appCertificate e21a388f83034a159f2783889a6d7bcf - -# DO NOT REMOVE OR MODIFY. CLOUDLINUX ENV VARS CONFIGURATION END \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/Admin/.DS_Store b/walletintaleq.intaleq.xyz/v2/main/Admin/.DS_Store deleted file mode 100644 index fa8c467..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/Admin/.DS_Store and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/Admin/AdminCaptain/add.php b/walletintaleq.intaleq.xyz/v2/main/Admin/AdminCaptain/add.php deleted file mode 100644 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/Admin/AdminCaptain/delete.php b/walletintaleq.intaleq.xyz/v2/main/Admin/AdminCaptain/delete.php deleted file mode 100644 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/Admin/AdminCaptain/error_log b/walletintaleq.intaleq.xyz/v2/main/Admin/AdminCaptain/error_log deleted file mode 100644 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/Admin/AdminCaptain/get.php b/walletintaleq.intaleq.xyz/v2/main/Admin/AdminCaptain/get.php deleted file mode 100644 index a33db6e..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/Admin/AdminCaptain/get.php +++ /dev/null @@ -1,103 +0,0 @@ -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"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/Admin/AdminCaptain/getCaptainDetailsByEmailOrIDOrPhone.php b/walletintaleq.intaleq.xyz/v2/main/Admin/AdminCaptain/getCaptainDetailsByEmailOrIDOrPhone.php deleted file mode 100644 index 9dcd557..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/Admin/AdminCaptain/getCaptainDetailsByEmailOrIDOrPhone.php +++ /dev/null @@ -1,109 +0,0 @@ -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"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/Admin/AdminCaptain/getCaptainDetailsById.php b/walletintaleq.intaleq.xyz/v2/main/Admin/AdminCaptain/getCaptainDetailsById.php deleted file mode 100644 index cb51767..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/Admin/AdminCaptain/getCaptainDetailsById.php +++ /dev/null @@ -1,107 +0,0 @@ -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"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/Admin/AdminCaptain/update.php b/walletintaleq.intaleq.xyz/v2/main/Admin/AdminCaptain/update.php deleted file mode 100644 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/Admin/AdminRide/get.php b/walletintaleq.intaleq.xyz/v2/main/Admin/AdminRide/get.php deleted file mode 100644 index 3272b1d..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/Admin/AdminRide/get.php +++ /dev/null @@ -1,145 +0,0 @@ -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"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/Admin/AdminRide/getRidesPerMonth.php b/walletintaleq.intaleq.xyz/v2/main/Admin/AdminRide/getRidesPerMonth.php deleted file mode 100644 index a42c10c..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/Admin/AdminRide/getRidesPerMonth.php +++ /dev/null @@ -1,35 +0,0 @@ -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"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/Admin/adminUser/add.php b/walletintaleq.intaleq.xyz/v2/main/Admin/adminUser/add.php deleted file mode 100644 index 107e46f..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/Admin/adminUser/add.php +++ /dev/null @@ -1,25 +0,0 @@ -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"); -} -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/Admin/adminUser/delete.php b/walletintaleq.intaleq.xyz/v2/main/Admin/adminUser/delete.php deleted file mode 100644 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/Admin/adminUser/error_log b/walletintaleq.intaleq.xyz/v2/main/Admin/adminUser/error_log deleted file mode 100644 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/Admin/adminUser/get.php b/walletintaleq.intaleq.xyz/v2/main/Admin/adminUser/get.php deleted file mode 100644 index ec03516..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/Admin/adminUser/get.php +++ /dev/null @@ -1,24 +0,0 @@ -prepare($sql); -$stmt->execute(); -$result = $stmt->fetchAll(PDO::FETCH_ASSOC); - -if (count($result) === 1) { - // Print the first record as a success message - printSuccess( $result[0]); -} else { - // Print a failure message - printFailure($message = "Failed to retrieve Password or user name incorrect"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/Admin/adminUser/update.php b/walletintaleq.intaleq.xyz/v2/main/Admin/adminUser/update.php deleted file mode 100644 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/Admin/dashbord.php b/walletintaleq.intaleq.xyz/v2/main/Admin/dashbord.php deleted file mode 100644 index 971b639..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/Admin/dashbord.php +++ /dev/null @@ -1,404 +0,0 @@ -prepare($sql); -$stmt->execute(); - -if ($stmt->rowCount() > 0) { -$result = $stmt->fetchAll(PDO::FETCH_ASSOC); - // Print all the records - // printData($result); - printSuccess($data = $result); -} else { - // Print a failure message - printFailure($message = "No records found"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/Admin/dashbordPayment.php b/walletintaleq.intaleq.xyz/v2/main/Admin/dashbordPayment.php deleted file mode 100755 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/Admin/error_log b/walletintaleq.intaleq.xyz/v2/main/Admin/error_log deleted file mode 100644 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/Admin/getPassengerDetails.php b/walletintaleq.intaleq.xyz/v2/main/Admin/getPassengerDetails.php deleted file mode 100644 index d37d1fe..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/Admin/getPassengerDetails.php +++ /dev/null @@ -1,110 +0,0 @@ -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"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/Admin/getPassengerDetailsByPassengerID.php b/walletintaleq.intaleq.xyz/v2/main/Admin/getPassengerDetailsByPassengerID.php deleted file mode 100644 index af6c9d0..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/Admin/getPassengerDetailsByPassengerID.php +++ /dev/null @@ -1,111 +0,0 @@ -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"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/Admin/getPassengerbyEmail.php b/walletintaleq.intaleq.xyz/v2/main/Admin/getPassengerbyEmail.php deleted file mode 100644 index 52d738a..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/Admin/getPassengerbyEmail.php +++ /dev/null @@ -1,112 +0,0 @@ -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"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/Admin/getPaymentsDashboard.php b/walletintaleq.intaleq.xyz/v2/main/Admin/getPaymentsDashboard.php deleted file mode 100755 index d886418..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/Admin/getPaymentsDashboard.php +++ /dev/null @@ -1,47 +0,0 @@ -prepare($sql); -$stmt->execute(); - -if ($stmt->rowCount() > 0) { - $result = $stmt->fetchAll(PDO::FETCH_ASSOC); - - // ✅ Always log what we’re sending back - error_log('📊 Dashboard Result: ' . json_encode($result, JSON_PRETTY_PRINT)); - - printSuccess($result); -} else { - error_log('⚠️ Dashboard: No records found'); - printFailure("No records found"); -} -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/Admin/getVisaForEachDriver.php b/walletintaleq.intaleq.xyz/v2/main/Admin/getVisaForEachDriver.php deleted file mode 100644 index cf273a5..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/Admin/getVisaForEachDriver.php +++ /dev/null @@ -1,51 +0,0 @@ - 0 - AND total_amount > 100 -LIMIT 0, 25; - -"; -$stmt = $con->prepare($sql); -$stmt->execute(); - -if ($stmt->rowCount() > 0) { - // Fetch the record - $row = $stmt->fetchAll(PDO::FETCH_ASSOC); - - printSuccess( $row); - -} - else{ - // Print a failure message - printFailure($message = "No wallet record found"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/Admin/sendEmailToDrivertransaction.php b/walletintaleq.intaleq.xyz/v2/main/Admin/sendEmailToDrivertransaction.php deleted file mode 100644 index 497f96e..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/Admin/sendEmailToDrivertransaction.php +++ /dev/null @@ -1,79 +0,0 @@ - - - - - -
- -

Payment Sent - SEFER

-

Thank you for being a valued driver on the SEFER platform.

-

SEFER has sent a payment of $totalAmount to your account. Please note that it may take a few days for the bank to process this transaction.

-

We appreciate your service and hope to continue our partnership.

-

Regards,
SEFER Team

-
- -"; - -// Arabic email content -$bodyEmailAr = " - - - - -
- SEFER -

تم إرسال الدفع - سفر

-

شكراً لك على كونك سائقًا متميزًا على منصة سفر.

-

لقد أرسلت سفر دفعة قدرها $totalAmount إلى حسابك. يرجى ملاحظة أنه قد يستغرق البنك عدة أيام لمعالجة هذه المعاملة.

-

نحن نقدر خدمتك ونأمل أن نستمر في شراكتنا.

-

مع خالص التحية،
فريق سفر

-
- -"; - -// Set the email headers -$supportEmail = 'seferteam@sefer.live'; -$headers = "MIME-Version: 1.0\r\n"; -$headers .= "Content-Type: text/html; charset=UTF-8\r\n"; -$headers .= "From: $supportEmail\r\n"; - -// Send email to the driver -if (!empty($driverEmail)) { - if (mail($driverEmail, "Payment Sent - SEFER", $bodyEmail, $headers)) { - // echo "Email sent successfully to $driverEmail"; - printSuccess($message = "'Email sent successfully to ' . $driverEmail"); - - } else { - printFailure($message = "Failed to send email to ' . $driverEmail"); - - } -} else { - printFailure($message = "Invalid email address: ' . $driverEmail"); - -} - -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/Admin/v2/financial/dashboard_wallet.php b/walletintaleq.intaleq.xyz/v2/main/Admin/v2/financial/dashboard_wallet.php deleted file mode 100755 index e27f46d..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/Admin/v2/financial/dashboard_wallet.php +++ /dev/null @@ -1,28 +0,0 @@ -prepare(" - SELECT - (SELECT IFNULL(SUM(amount), 0) FROM payments WHERE status = 'completed') as payments, - (SELECT IFNULL(SUM(balance), 0) FROM driverWallet) as driverWallet, - (SELECT IFNULL(SUM(balance), 0) FROM passengerWallet) as passengerWallet, - (SELECT IFNULL(SUM(balance), 0) FROM seferWallet) as seferWallet - "); - $stmt->execute(); - $stats = $stmt->fetch(PDO::FETCH_ASSOC); - - // نعيد البيانات داخل رسالة (Array) لتطابق توقعات الفلاتر - jsonSuccess([$stats]); - -} catch (Exception $e) { - jsonError('Wallet Query failed: ' . $e->getMessage(), 500); -} -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/Admin/v2/financial/settlements.php b/walletintaleq.intaleq.xyz/v2/main/Admin/v2/financial/settlements.php deleted file mode 100644 index 83fea1e..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/Admin/v2/financial/settlements.php +++ /dev/null @@ -1,40 +0,0 @@ -prepare(" - SELECT - d.id, d.first_name, d.last_name, d.phone, - SUM(r.price_for_driver) as total_earned, - COUNT(r.id) as total_rides - FROM driver d - LEFT JOIN ride r ON d.id = r.driver_id AND r.status = 'Finished' - GROUP BY d.id - HAVING total_earned > 0 - ORDER BY total_earned DESC - LIMIT 50 - "); - $stmt->execute(); - $drivers = $stmt->fetchAll(PDO::FETCH_ASSOC); - - // فك تشفير البيانات - foreach ($drivers as &$driver) { - $driver['first_name'] = $encryptionHelper->decryptData($driver['first_name']); - $driver['last_name'] = $encryptionHelper->decryptData($driver['last_name']); - $driver['phone'] = $encryptionHelper->decryptData($driver['phone']); - } - - echo json_encode([ - 'status' => 'success', - 'data' => $drivers - ]); -} catch (Exception $e) { - http_response_code(500); - echo json_encode(['status' => 'error', 'message' => $e->getMessage()]); -} -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/Admin/v2/financial/stats.php b/walletintaleq.intaleq.xyz/v2/main/Admin/v2/financial/stats.php deleted file mode 100644 index d533d6b..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/Admin/v2/financial/stats.php +++ /dev/null @@ -1,30 +0,0 @@ -prepare(" - SELECT - SUM(price_for_passenger) as total_revenue, - SUM(price_for_driver) as total_driver_pay, - SUM(price_for_passenger - price_for_driver) as total_platform_commission, - (SELECT SUM(amount) FROM payments WHERE payment_method = 'Cash') as cash_payments, - (SELECT SUM(amount) FROM payments WHERE payment_method != 'Cash') as digital_payments - FROM ride - WHERE status = 'Finished' - "); - $stmt->execute(); - $stats = $stmt->fetch(PDO::FETCH_ASSOC); - - echo json_encode([ - 'status' => 'success', - 'data' => $stats - ]); -} catch (Exception $e) { - http_response_code(500); - echo json_encode(['status' => 'error', 'message' => $e->getMessage()]); -} -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/Agora/.DS_Store b/walletintaleq.intaleq.xyz/v2/main/Agora/.DS_Store deleted file mode 100644 index bd33bec..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/Agora/.DS_Store and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/Agora/.htaccess b/walletintaleq.intaleq.xyz/v2/main/Agora/.htaccess deleted file mode 100644 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/Agora/agora.php b/walletintaleq.intaleq.xyz/v2/main/Agora/agora.php deleted file mode 100644 index d1fca8f..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/Agora/agora.php +++ /dev/null @@ -1,52 +0,0 @@ -get('/token', function ($request, $response) use ($app, $appId, $appCertificate) { - // Get parameters - $channelName = $request->getQueryParam('channelName'); - $uid = $request->getQueryParam('uid', 0); - $role = $request->getQueryParam('role', RtcRole::SUBSCRIBER); - $expireTime = $request->getQueryParam('expireTime', 3600); - - try { - // Generate token - $token = generateToken($channelName, $uid, $role, $expireTime); - - // Respond with JSON - $response->withJson(['token' => $token]); - } catch (Exception $e) { - // Handle error - $response->withStatus(500)->withJson(['error' => $e->getMessage()]); - } -}); - -// Start server -$app->run($port); - diff --git a/walletintaleq.intaleq.xyz/v2/main/Agora/index.js b/walletintaleq.intaleq.xyz/v2/main/Agora/index.js deleted file mode 100644 index be947d5..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/Agora/index.js +++ /dev/null @@ -1,9 +0,0 @@ -var http = require('http'); -var server = http.createServer(function(req, res) { - res.writeHead(200, {'Content-Type': 'text/plain'}); - var message = 'It works!\n', - version = 'NodeJS ' + process.versions.node + '\n', - response = [message, version].join('\n'); - res.end(response); -}); -server.listen(); diff --git a/walletintaleq.intaleq.xyz/v2/main/Agora/stderr.log b/walletintaleq.intaleq.xyz/v2/main/Agora/stderr.log deleted file mode 100644 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/Agora/tmp/restart.txt b/walletintaleq.intaleq.xyz/v2/main/Agora/tmp/restart.txt deleted file mode 100644 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/EgyptDocuments/error_log b/walletintaleq.intaleq.xyz/v2/main/EgyptDocuments/error_log deleted file mode 100644 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/EgyptDocuments/uploadEgyptIdBack.php b/walletintaleq.intaleq.xyz/v2/main/EgyptDocuments/uploadEgyptIdBack.php deleted file mode 100644 index 569af02..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/EgyptDocuments/uploadEgyptIdBack.php +++ /dev/null @@ -1,60 +0,0 @@ - "Failed to save image")); ; - exit; -} - -// Store additional information (modify based on your needs) -$image_url = $target_dir . $new_filename; // Update if needed -$image_details = [ - "name" => $image_name, - "size" => $image_size, - "extension" => $image_extension, - "url" => $image_url, -]; - -// Use the image details for further processing (e.g., display, store in database) -// ... - - echo json_encode(array('status' => 'Image uploaded successfully!')); - -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/EgyptDocuments/uploadEgyptidFront.php b/walletintaleq.intaleq.xyz/v2/main/EgyptDocuments/uploadEgyptidFront.php deleted file mode 100644 index 67fadbd..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/EgyptDocuments/uploadEgyptidFront.php +++ /dev/null @@ -1,60 +0,0 @@ - "Failed to save image")); ; - exit; -} - -// Store additional information (modify based on your needs) -$image_url = $target_dir . $new_filename; // Update if needed -$image_details = [ - "name" => $image_name, - "size" => $image_size, - "extension" => $image_extension, - "url" => $image_url, -]; - -// Use the image details for further processing (e.g., display, store in database) -// ... - - echo json_encode(array('status' => 'Image uploaded successfully!')); - -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/.DS_Store b/walletintaleq.intaleq.xyz/v2/main/auth/.DS_Store deleted file mode 100644 index c52b177..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/auth/.DS_Store and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/Tester/error_log b/walletintaleq.intaleq.xyz/v2/main/auth/Tester/error_log deleted file mode 100644 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/Tester/getTesterApp.php b/walletintaleq.intaleq.xyz/v2/main/auth/Tester/getTesterApp.php deleted file mode 100644 index 5a91c63..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/Tester/getTesterApp.php +++ /dev/null @@ -1,29 +0,0 @@ -prepare($sql); -$stmt->execute(); -$result = $stmt->fetchAll(PDO::FETCH_ASSOC); - -if ($stmt->rowCount() > 0) { - // Print the retrieved data - // echo json_encode($result); - printSuccess($data = $result); -} else { - // Print a failure message - - printFailure($message = "No driver order data found"); -} - -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/Tester/updateTesterApp.php b/walletintaleq.intaleq.xyz/v2/main/auth/Tester/updateTesterApp.php deleted file mode 100644 index 2f5fd09..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/Tester/updateTesterApp.php +++ /dev/null @@ -1,23 +0,0 @@ -prepare($sql); -$stmt->execute(); - -if ($stmt->rowCount() > 0) { - // Print a success message - printSuccess($message = "Test data updated successfully"); -} else { - // Print a failure message - printFailure($message = "Failed to update driver order data"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/captin/addCriminalDocuments.php b/walletintaleq.intaleq.xyz/v2/main/auth/captin/addCriminalDocuments.php deleted file mode 100644 index d283767..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/captin/addCriminalDocuments.php +++ /dev/null @@ -1,35 +0,0 @@ -prepare($sql); - - // Bind parameters - $stmt->bindParam(':driverId', $driverId, PDO::PARAM_INT); - $stmt->bindParam(':issueDate', $issueDate, PDO::PARAM_STR); - $stmt->bindParam(':inspectionResult', $inspectionResult, PDO::PARAM_STR); - - // Execute the statement - $stmt->execute(); - - // Check if the insertion was successful - if ($stmt->rowCount() > 0) { - printSuccess("Criminal document data saved successfully"); - } else { - printFailure("Failed to save criminal document data"); - } -} catch (PDOException $e) { - // Log the error and print a generic failure message - error_log("Database Error: " . $e->getMessage()); - printFailure("An error occurred while saving the data"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/captin/deletecaptainAccounr.php b/walletintaleq.intaleq.xyz/v2/main/auth/captin/deletecaptainAccounr.php deleted file mode 100644 index b1ea012..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/captin/deletecaptainAccounr.php +++ /dev/null @@ -1,19 +0,0 @@ -prepare($sql); -$stmt->execute(); - -if ($stmt->rowCount() > 0) { - // Print a success message - printSuccess($message = "Record deleted successfully"); -} else { - // Print a failure message - printFailure($message = "Failed to delete record"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/captin/error_log b/walletintaleq.intaleq.xyz/v2/main/auth/captin/error_log deleted file mode 100644 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/captin/forgetPassword.php b/walletintaleq.intaleq.xyz/v2/main/auth/captin/forgetPassword.php deleted file mode 100644 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/captin/getAccount.php b/walletintaleq.intaleq.xyz/v2/main/auth/captin/getAccount.php deleted file mode 100644 index dc34a5b..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/captin/getAccount.php +++ /dev/null @@ -1,22 +0,0 @@ -prepare($sql); -$stmt->execute(); - -if ($stmt->rowCount() > 0) { - // Fetch the record - $row = $stmt->fetchAll(PDO::FETCH_ASSOC); - - printSuccess( $row); - -} - else{ - // Print a failure message - printFailure($message = "No wallet record found"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/captin/getPromptDriverDocumentsEgypt.php b/walletintaleq.intaleq.xyz/v2/main/auth/captin/getPromptDriverDocumentsEgypt.php deleted file mode 100644 index 44a7815..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/captin/getPromptDriverDocumentsEgypt.php +++ /dev/null @@ -1,23 +0,0 @@ -prepare($sql); -$stmt->execute(); - -if ($stmt->rowCount() > 0) { - // Fetch the record - $row = $stmt->fetchAll(PDO::FETCH_ASSOC); - - printSuccess( $row); - -} - else{ - // Print a failure message - printFailure($message = "No wallet record found"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/captin/login.php b/walletintaleq.intaleq.xyz/v2/main/auth/captin/login.php deleted file mode 100644 index 3965453..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/captin/login.php +++ /dev/null @@ -1,67 +0,0 @@ -prepare($sql); -$stmt->bindParam(':email', $email); -$stmt->bindParam(':phone', $phone); -$stmt->execute(); -$data = $stmt->fetchAll(PDO::FETCH_ASSOC); -$count = $stmt->rowCount(); - -if ($count > 0) { - $stored_password = $data[0]['password']; - if (password_verify($password, $stored_password)) { - unset($data[0]['password']); - echo json_encode([ - "status" => "success", - "count" => $count, - "data" => $data - ]); - } else { - // The password is incorrect - echo json_encode([ - "status" => "Failure", - "data" => "Incorrect password." - ]); - // printFailure("Incorrect password."); - } -} else { - // The user does not exist - echo json_encode([ - "status" => "Failure", - "data" => "User does not exist." - ]); - // printFailure("User does not exist."); -} -$conn->close(); - -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/captin/loginFromGoogle.php b/walletintaleq.intaleq.xyz/v2/main/auth/captin/loginFromGoogle.php deleted file mode 100644 index b433864..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/captin/loginFromGoogle.php +++ /dev/null @@ -1,56 +0,0 @@ -prepare($sql); -$stmt->bindParam(':email', $email); -$stmt->bindParam(':id', $driverID); -$stmt->execute(); -$data = $stmt->fetchAll(PDO::FETCH_ASSOC); -$count = $stmt->rowCount(); - -if ($count > 0) { - - echo json_encode([ - "status" => "success", - "count" => $count, - "data" => $data - ]); - -} else { - // The user does not exist - // echo json_encode([ - // "status" => "Failure", - // "data" => "User does not exist." - // ]); - printFailure("User does not exist."); -} -$stmt = null; // Close the statement -$con = null; // Close the connection -exit(); \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/captin/register.php b/walletintaleq.intaleq.xyz/v2/main/auth/captin/register.php deleted file mode 100755 index 6570c39..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/captin/register.php +++ /dev/null @@ -1,110 +0,0 @@ -prepare("SELECT * FROM driver WHERE phone = :phone OR email = :email"); - $stmt->bindParam(':phone', $inputData['phone'], PDO::PARAM_STR); - $stmt->bindParam(':email', $inputData['email'], PDO::PARAM_STR); - $stmt->execute(); - - if ($stmt->rowCount() > 0) { - printFailure("The email or phone number is already registered."); - } - - // Prepare SQL for inserting new driver - $sql = " - INSERT INTO `driver` ( - `id`, `phone`, `email`, `password`, `gender`, `license_type`, `national_number`, - `name_arabic`, `name_english`, `issue_date`, `expiry_date`, `license_categories`, - `address`, `card_id`, `occupation`, `licenseIssueDate`, `religion`, `status`, - `birthdate`, `site`, `first_name`, `last_name`, `education`, - `employmentType`, `maritalStatus`, `created_at`, `updated_at` - ) VALUES ( - :id, :phone, :email, :hashedPassword, :gender, :license_type, :national_number, - :name_arabic, :name_english, :issue_date, :expiry_date, :license_categories, - :address, :card_id, :occupation, :licenseIssueDate, :religion, :status, - :birthdate, :site, :first_name, :last_name, :education, - :employmentType, :maritalStatus, NOW(), NOW() - ) - "; - - $stmt = $con->prepare($sql); - if (!$stmt) { - throw new Exception("Failed to prepare statement: " . $con->error); - } - - // Bind parameters - $paramsToBind = [ - 'id', 'phone', 'email', 'hashedPassword', 'gender', 'license_type', 'national_number', - 'name_arabic', 'name_english', 'issue_date', 'expiry_date', 'license_categories', - 'address', 'card_id', 'occupation', 'licenseIssueDate', 'religion', 'status', - 'birthdate', 'site', 'first_name', 'last_name', 'education', - 'employmentType', 'maritalStatus' - ]; - - foreach ($paramsToBind as $param) { - if (isset($inputData[$param])) { - $stmt->bindValue(":$param", $inputData[$param], PDO::PARAM_STR); - } else { - $stmt->bindValue(":$param", null, PDO::PARAM_STR); - } - } - - // Log SQL and parameters for debugging - error_log("SQL: " . $sql); - error_log("Params: " . print_r($inputData, true)); - - // Execute the statement - if (!$stmt->execute()) { - throw new Exception("Failed to execute statement: " . $stmt->errorInfo()[2]); - } - - // Check if the record was successfully saved - if ($stmt->rowCount() > 0) { - printSuccess($inputData['id']); - } else { - printFailure("Failed to save driver data"); - } - -} catch (PDOException $e) { - error_log("Database error: " . $e->getMessage()); - printFailure("A database error occurred: " . $e->getMessage()); -} catch (Exception $e) { - error_log("An error occurred: " . $e->getMessage()); - printFailure("An error occurred: " . $e->getMessage()); -} \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/captin/removeAccount.php b/walletintaleq.intaleq.xyz/v2/main/auth/captin/removeAccount.php deleted file mode 100644 index 187aeec..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/captin/removeAccount.php +++ /dev/null @@ -1,19 +0,0 @@ -prepare($sql); -$stmt->execute(); - -if ($stmt->rowCount() > 0) { - // Print a success message - printSuccess($message = "Record deleted successfully"); -} else { - // Print a failure message - printFailure($message = "Failed to delete record"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/captin/sendOtpMessageDriver.php b/walletintaleq.intaleq.xyz/v2/main/auth/captin/sendOtpMessageDriver.php deleted file mode 100644 index 53a1312..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/captin/sendOtpMessageDriver.php +++ /dev/null @@ -1,44 +0,0 @@ -prepare($sql); -$stmt->execute(); - -$rowCount = $stmt->rowCount(); - -if ($rowCount > 0) { - // The phone number already exists, so update the data - $sql = "UPDATE `phone_verification` SET `token_code` = '$token_code', `expiration_time` = DATE_ADD(NOW(), INTERVAL 5 MINUTE) WHERE `phone_number` = '$phone_number'"; - $stmt = $con->prepare($sql); - $stmt->execute(); - - if ($stmt->rowCount() > 0) { - // The update was successful - printSuccess($message = "Phone verification data updated successfully"); - } else { - // The update was unsuccessful - printFailure($message = "Failed to update phone verification data"); - } -} else { - // The phone number does not exist, so insert the data - $sql = "INSERT INTO `phone_verification` (`phone_number`, `driverId` ,`email`,`token_code`, `expiration_time`, `is_verified`, `created_at`) VALUES ('$phone_number','$driverId','$email', '$token_code', DATE_ADD(NOW(), INTERVAL 5 MINUTE), 0, NOW())"; - $stmt = $con->prepare($sql); - $stmt->execute(); - - if ($stmt->rowCount() > 0) { - // The insertion was successful - printSuccess($message = "Phone verification data saved successfully"); - } else { - // The insertion was unsuccessful - printFailure($message = "Failed to save phone verification data"); - } -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/captin/updateAccountBank.php b/walletintaleq.intaleq.xyz/v2/main/auth/captin/updateAccountBank.php deleted file mode 100644 index bac2dd7..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/captin/updateAccountBank.php +++ /dev/null @@ -1,111 +0,0 @@ -prepare($sql); -$stmt->execute(); - -if ($stmt->rowCount() > 0) { - // Print success message - printSuccess($message = "Driver data updated successfully"); -} else { - // Print failure message - printFailure($message = "Failed to update driver data"); -} -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/captin/verifyEmail.php b/walletintaleq.intaleq.xyz/v2/main/auth/captin/verifyEmail.php deleted file mode 100644 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/captin/verifyOtpDriver.php b/walletintaleq.intaleq.xyz/v2/main/auth/captin/verifyOtpDriver.php deleted file mode 100644 index 84cfad3..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/captin/verifyOtpDriver.php +++ /dev/null @@ -1,33 +0,0 @@ - NOW()"; -$stmt = $con->prepare($sql); -$stmt->execute(); -$result = $stmt->fetch(); - -if ($result) { - // $id = $result["id"]; - $sql = "UPDATE `phone_verification` SET `is_verified` = 1 WHERE `phone_number` = $phone_number"; - $stmt = $con->prepare($sql); - $stmt->execute(); - - printSuccess($message = "Your phone number has been verified."); -} else { - printFailure($message = "Your phone number could not be verified. Please try again."); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/checkPhoneNumberISVerfiedDriver.php b/walletintaleq.intaleq.xyz/v2/main/auth/checkPhoneNumberISVerfiedDriver.php deleted file mode 100644 index e8bf5d7..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/checkPhoneNumberISVerfiedDriver.php +++ /dev/null @@ -1,27 +0,0 @@ -prepare($sql); -$stmt->execute(); - -if ($stmt->rowCount() > 0) { - // Fetch the records - $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); - - printSuccess($rows); - -} else { - // Print a failure message - printFailure($message = "No Phone verified yet found"); -} - -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/checkPhoneNumberISVerfiedPassenger.php b/walletintaleq.intaleq.xyz/v2/main/auth/checkPhoneNumberISVerfiedPassenger.php deleted file mode 100644 index d90941c..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/checkPhoneNumberISVerfiedPassenger.php +++ /dev/null @@ -1,27 +0,0 @@ -prepare($sql); -$stmt->execute(); - -if ($stmt->rowCount() > 0) { - // Fetch the records - $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); - - printSuccess($rows); - -} else { - // Print a failure message - printFailure($message = "No Phone verified yet found"); -} - -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/cnMap.php b/walletintaleq.intaleq.xyz/v2/main/auth/cnMap.php deleted file mode 100644 index ddd726a..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/cnMap.php +++ /dev/null @@ -1,23 +0,0 @@ - "3", - "1" => "7", - "2" => "1", - "3" => "9", - "4" => "0", - "5" => "5", - "6" => "2", - "7" => "6", - "8" => "4", - "9" => "8" -); - -// Convert the map to a JSON string with JSON_FORCE_OBJECT option -$jsonString = json_encode($cn, JSON_FORCE_OBJECT); - -// Send the JSON string to the Flutter app -echo $jsonString; -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/cn_map.json b/walletintaleq.intaleq.xyz/v2/main/auth/cn_map.json deleted file mode 100644 index c398c06..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/cn_map.json +++ /dev/null @@ -1 +0,0 @@ -["3","7","1","9","0","5","2","6","4","8"] \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/driver/add.php b/walletintaleq.intaleq.xyz/v2/main/auth/driver/add.php deleted file mode 100644 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/driver/delete.php b/walletintaleq.intaleq.xyz/v2/main/auth/driver/delete.php deleted file mode 100644 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/driver/get.php b/walletintaleq.intaleq.xyz/v2/main/auth/driver/get.php deleted file mode 100644 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/driver/update.php b/walletintaleq.intaleq.xyz/v2/main/auth/driver/update.php deleted file mode 100644 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/error_log b/walletintaleq.intaleq.xyz/v2/main/auth/error_log deleted file mode 100644 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/login.php b/walletintaleq.intaleq.xyz/v2/main/auth/login.php deleted file mode 100644 index 350c256..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/login.php +++ /dev/null @@ -1,67 +0,0 @@ -prepare($sql); -$stmt->bindParam(':email', $email); -$stmt->bindParam(':phone', $phone); -$stmt->execute(); -$data = $stmt->fetchAll(PDO::FETCH_ASSOC); -$count = $stmt->rowCount(); - -if ($count > 0) { - $stored_password = $data[0]['password']; - if (password_verify($password, $stored_password)) { - unset($data[0]['password']); - echo json_encode([ - "status" => "success", - "count" => $count, - "data" => $data - ]); - } else { - // The password is incorrect - echo json_encode([ - "status" => "Failure", - "data" => "Incorrect password." - ]); - // printFailure("Incorrect password."); - } -} else { - // The user does not exist - echo json_encode([ - "status" => "Failure", - "data" => "User does not exist." - ]); - // printFailure("User does not exist."); -} -$conn->close(); - -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/loginFromGooglePassenger.php b/walletintaleq.intaleq.xyz/v2/main/auth/loginFromGooglePassenger.php deleted file mode 100644 index e09acfa..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/loginFromGooglePassenger.php +++ /dev/null @@ -1,41 +0,0 @@ -prepare($sql); -$stmt->bindParam(':email', $email); -$stmt->bindParam(':id', $id); -$stmt->execute(); -$data = $stmt->fetchAll(PDO::FETCH_ASSOC); -$count = $stmt->rowCount(); - -header('Content-Type: application/json'); // Ensure the response is JSON - -if ($count > 0) { - echo json_encode([ - "status" => "success", - "count" => $count, - "data" => $data - ]); -} else { - echo json_encode([ - "status" => "Failure", - "data" => "User does not exist." - ]); -} - -$stmt = null; // Close the statement -$con = null; // Close the connection -exit(); // Ensure no further output diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/otpmessage.php b/walletintaleq.intaleq.xyz/v2/main/auth/otpmessage.php deleted file mode 100644 index e107805..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/otpmessage.php +++ /dev/null @@ -1,42 +0,0 @@ -prepare($sql); -$stmt->execute(); - -$rowCount = $stmt->rowCount(); - -if ($rowCount > 0) { - // The phone number already exists, so update the data - $sql = "UPDATE `phone_verification_passenger` SET `token` = '$token_code', `expiration_time` = DATE_ADD(NOW(), INTERVAL 5 MINUTE) WHERE `phone_number` = '$phone_number'"; - $stmt = $con->prepare($sql); - $stmt->execute(); - - if ($stmt->rowCount() > 0) { - // The update was successful - printSuccess($message = "Phone verification data updated successfully"); - } else { - // The update was unsuccessful - printFailure($message = "Failed to update phone verification data"); - } -} else { - // The phone number does not exist, so insert the data - $sql = "INSERT INTO `phone_verification_passenger` (`phone_number`, `token`, `expiration_time`, `verified`, `created_at`) VALUES ('$phone_number', '$token_code', DATE_ADD(NOW(), INTERVAL 5 MINUTE), 0, NOW())"; - $stmt = $con->prepare($sql); - $stmt->execute(); - - if ($stmt->rowCount() > 0) { - // The insertion was successful - printSuccess($message = "Phone verification data saved successfully"); - } else { - // The insertion was unsuccessful - printFailure($message = "Failed to save phone verification data"); - } -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/packageInfo.php b/walletintaleq.intaleq.xyz/v2/main/auth/packageInfo.php deleted file mode 100644 index ce50ff1..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/packageInfo.php +++ /dev/null @@ -1,30 +0,0 @@ -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"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/passengerOTP/sendOtpPassenger.php b/walletintaleq.intaleq.xyz/v2/main/auth/passengerOTP/sendOtpPassenger.php deleted file mode 100644 index 53585b4..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/passengerOTP/sendOtpPassenger.php +++ /dev/null @@ -1,42 +0,0 @@ -prepare($sql); -$stmt->execute(); - -$rowCount = $stmt->rowCount(); - -if ($rowCount > 0) { - // The phone number already exists, so update the data - $sql = "UPDATE `phone_verification_passenger` SET `token_code` = '$token_code', `expiration_time` = DATE_ADD(NOW(), INTERVAL 5 MINUTE) WHERE `phone_number` = '$phone_number'"; - $stmt = $con->prepare($sql); - $stmt->execute(); - - if ($stmt->rowCount() > 0) { - // The update was successful - printSuccess($message = "Phone verification data updated successfully"); - } else { - // The update was unsuccessful - printFailure($message = "Failed to update phone verification data"); - } -} else { - // The phone number does not exist, so insert the data - $sql = "INSERT INTO `phone_verification_passenger` (`phone_number`, `token_code`, `expiration_time`, `is_verified`, `created_at`) VALUES ('$phone_number', '$token_code', DATE_ADD(NOW(), INTERVAL 5 MINUTE), 0, NOW())"; - $stmt = $con->prepare($sql); - $stmt->execute(); - - if ($stmt->rowCount() > 0) { - // The insertion was successful - printSuccess($message = "Phone verification data saved successfully"); - } else { - // The insertion was unsuccessful - printFailure($message = "Failed to save phone verification data"); - } -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/passengerOTP/verifyOtpPassenger.php b/walletintaleq.intaleq.xyz/v2/main/auth/passengerOTP/verifyOtpPassenger.php deleted file mode 100644 index 925d2ca..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/passengerOTP/verifyOtpPassenger.php +++ /dev/null @@ -1,23 +0,0 @@ - NOW()"; -$stmt = $con->prepare($sql); -$stmt->execute(); -$result = $stmt->fetch(); - -if ($result) { - // $id = $result["id"]; - $sql = "UPDATE `phone_verification_passenger` SET `is_verified` = 1 WHERE `phone_number` = $phone_number"; - $stmt = $con->prepare($sql); - $stmt->execute(); - - printSuccess($message = "Your phone number has been verified."); -} else { - printFailure($message = "Your phone number could not be verified. Please try again."); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/passengerRemovedAccountEmail.php b/walletintaleq.intaleq.xyz/v2/main/auth/passengerRemovedAccountEmail.php deleted file mode 100644 index 9e09ed5..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/passengerRemovedAccountEmail.php +++ /dev/null @@ -1,30 +0,0 @@ - \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/resetPassword.php b/walletintaleq.intaleq.xyz/v2/main/auth/resetPassword.php deleted file mode 100644 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/sendEmail.php b/walletintaleq.intaleq.xyz/v2/main/auth/sendEmail.php deleted file mode 100644 index 4fc8ebf..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/sendEmail.php +++ /dev/null @@ -1,34 +0,0 @@ - - -Verify your email address - - -

Hi [$email],

- -

We recently received a request to verify your email address for your account on Ride App.

- -

To verify your email address, please write this to app .

-$token - -

If you did not request to verify your email address, please ignore this email.

- -

Thank you,

-SEFER Team. - - -"; - -mail($email, $subject, $bodyEmail, $headers); \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/sendVerifyEmail.php b/walletintaleq.intaleq.xyz/v2/main/auth/sendVerifyEmail.php deleted file mode 100644 index 57ba8d0..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/sendVerifyEmail.php +++ /dev/null @@ -1,72 +0,0 @@ -prepare($sql); -$stmt->execute(); - -$rowCount = $stmt->rowCount(); - -$admin='support@mobile-app.store'; -$headers = "MIME-Version: 1.0" . "\r\n"; -$headers .= "Content-type: text/html; charset=UTF-8" . "\r\n"; -$headers .= "From: $admin" . "\r\n"; - -$subject = "Verify your email address"; -$bodyEmail = " - - -Verify your email address - - -

Hi [$email],

- -

We recently received a request to verify your email address for your account on SEFER App.

- -

To verify your email address, please write this to app .

-$token - -

If you did not request to verify your email address, please ignore this email.

- -

Thank you,

-SEFER Team. - - -"; - - - -if ($rowCount > 0) { - // The email already exists, so update the data - $sql = "UPDATE `email_verifications` SET `token` = '$token' WHERE `email` = '$email'"; - $stmt = $con->prepare($sql); - $stmt->execute(); - - if ($stmt->rowCount() > 0) { - // The update was successful - printSuccess($message = "Email verification data updated successfully"); - mail($email, $subject, $bodyEmail, $headers); - } else { - // The update was unsuccessful - printFailure($message = "Failed to update email verification data"); - } -} else { - // The email does not exist, so insert the data - $sql = "INSERT INTO `email_verifications` (`email`, `token`) VALUES ('$email', '$token')"; - $stmt = $con->prepare($sql); - $stmt->execute(); - - if ($stmt->rowCount() > 0) { - // The insertion was successful - printSuccess($message = "Email verification data saved successfully"); - mail($email, $subject, $bodyEmail, $headers); - } else { - // The insertion was unsuccessful - printFailure($message = "Failed to save email verification data"); - } -} -?> - diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/signup.php b/walletintaleq.intaleq.xyz/v2/main/auth/signup.php deleted file mode 100644 index 19175db..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/signup.php +++ /dev/null @@ -1,64 +0,0 @@ -prepare($sql); -$stmt->execute(); -$results = $stmt->fetchAll(); - -if (count($results) > 0) { - // The phone number or email address already exists in the database - // Print a message and exit - printFailure($message="The email or phone number is already registered."); - exit; -} else { - // The phone number or email address does not exist in the database - // Insert a new record - $sql = "INSERT INTO `passengers` ( - `id`, - `phone`, - `email`, - `password`, - `gender`, - `birthdate`, - `site`, - `first_name`, - `last_name` - ) VALUES ( - '$id', - '$phone', - '$email', - '$hashedPassword', - '$gender', - '$birthdate', - '$site', - '$first_name', - '$last_name' - )"; - - $stmt = $con->prepare($sql); - $stmt->execute(); -} - -// Check if the record was successfully saved -if ($stmt->rowCount() > 0) { - // Print a success message - printSuccess($message = "success to save passenger data"); -} else { - // Print a failure message - printFailure($message = "Failed to save passenger data"); -} - -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/sms/getSender.php b/walletintaleq.intaleq.xyz/v2/main/auth/sms/getSender.php deleted file mode 100644 index 0d311d8..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/sms/getSender.php +++ /dev/null @@ -1,28 +0,0 @@ -prepare($sql); -$stmt->execute(); -$result = $stmt->fetchAll(PDO::FETCH_ASSOC); - -if ($stmt->rowCount() > 0) { - - printSuccess($data = $result); -} else { - - - printFailure($message = "No driver order data found"); -} - -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/sms/updatePhoneInvalidSMS.php b/walletintaleq.intaleq.xyz/v2/main/auth/sms/updatePhoneInvalidSMS.php deleted file mode 100644 index bb31134..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/sms/updatePhoneInvalidSMS.php +++ /dev/null @@ -1,33 +0,0 @@ -prepare($sql); - -// Bind the phone number parameter -$stmt->bindParam(":phone_number", $phone_number); - -// Execute the query -$stmt->execute(); - -// Get the number of affected rows -$affectedRows = $stmt->rowCount(); - -// Check if the update was successful -if ($affectedRows > 0) { - // Return a success response - printSuccess($data = ["message" => "Phone number verified successfully"]); -} else { - // Return a failure response - printFailure($message = "No phone number found or verification failed"); -} - -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/sms/updatePhoneInvalidSMSPassenger.php b/walletintaleq.intaleq.xyz/v2/main/auth/sms/updatePhoneInvalidSMSPassenger.php deleted file mode 100644 index 49541e7..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/sms/updatePhoneInvalidSMSPassenger.php +++ /dev/null @@ -1,33 +0,0 @@ -prepare($sql); - -// Bind the phone number parameter -$stmt->bindParam(":phone_number", $phone_number); - -// Execute the query -$stmt->execute(); - -// Get the number of affected rows -$affectedRows = $stmt->rowCount(); - -// Check if the update was successful -if ($affectedRows > 0) { - // Return a success response - printSuccess($data = ["message" => "Phone number verified successfully"]); -} else { - // Return a failure response - printFailure($message = "No phone number found or verification failed"); -} - -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/token/update_driver_auth.php b/walletintaleq.intaleq.xyz/v2/main/auth/token/update_driver_auth.php deleted file mode 100755 index d621ee8..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/token/update_driver_auth.php +++ /dev/null @@ -1,39 +0,0 @@ - "failure", - "message" => "Missing required fields" - ]); - exit; -} - -try { - // بدون أي تشفير: خزّن التوكن كما هو - $tokenPlain = $newToken; - - $stmt = $con->prepare("UPDATE driverToken SET token = ?, fingerPrint = ?, updated_at = NOW() WHERE captain_id = ?"); - $ok = $stmt->execute([$tokenPlain, $fingerPrint, $captainId]); - - if ($ok && $stmt->rowCount() > 0) { - echo json_encode([ - "status" => "success", - "message" => "Driver token updated successfully" - ]); - } else { - echo json_encode([ - "status" => "failure", - "message" => "Captain not found or no update performed" - ]); - } -} catch (PDOException $e) { - echo json_encode([ - "status" => "failure", - "message" => "Database error: " . $e->getMessage() - ]); -} \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/token/update_passenger_token.php b/walletintaleq.intaleq.xyz/v2/main/auth/token/update_passenger_token.php deleted file mode 100755 index 44de069..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/token/update_passenger_token.php +++ /dev/null @@ -1,46 +0,0 @@ - "failure", - "message" => "Missing required fields" - ]); - exit; -} - -try { - // تشفير التوكن قبل التخزين - // $tokenEncrypted = $encryptionHelper->encryptData($newToken); - - // تحديث سجل الراكب - $stmt = $con->prepare(" - UPDATE tokens - SET token = ?, fingerPrint = ? - WHERE passengerID = ? - "); - $ok = $stmt->execute([$newToken, $fingerPrint, $passengerId]); - - if ($ok && $stmt->rowCount() > 0) { - echo json_encode([ - "status" => "success", - "message" => "Passenger token updated successfully" - ]); - } else { - echo json_encode([ - "status" => "failure", - "message" => "Passenger not found or no update performed" - ]); - } -} catch (PDOException $e) { - echo json_encode([ - "status" => "failure", - "message" => "Database error: " . $e->getMessage() - ]); -} \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/verifyEmail.php b/walletintaleq.intaleq.xyz/v2/main/auth/verifyEmail.php deleted file mode 100644 index d59a414..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/verifyEmail.php +++ /dev/null @@ -1,39 +0,0 @@ -prepare($sql); -$stmt->execute(); -$result = $stmt->fetch(); - -if ($result) { - $id = $result["id"]; - $sql = "UPDATE `email_verifications` SET `verified` = 1 WHERE `id` = $id"; - $stmt = $con->prepare($sql); - $stmt->execute(); - - $admin='support@sefer.com'; - $headers = "MIME-Version: 1.0" . "\r\n"; - $headers .= "Content-type: text/html; charset=UTF-8" . "\r\n"; - $headers .= "From: $admin" . "\r\n"; - - $subject = " Verify your email address"; - $bodyEmail="Subject: Verify your email address - -Hi [$email], - -Your email address has been verified. - -Thank you, -SEFER Team"; - - mail($email, $subject, $bodyEmail, $headers); - - printSuccess($message = "Your email address has been verified."); -} else { - printFailure($message ="Your email address could not be verified. Please try again."); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/auth/verifyOtpMessage.php b/walletintaleq.intaleq.xyz/v2/main/auth/verifyOtpMessage.php deleted file mode 100644 index 4ca5836..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/auth/verifyOtpMessage.php +++ /dev/null @@ -1,33 +0,0 @@ - NOW()"; -$stmt = $con->prepare($sql); -$stmt->execute(); -$result = $stmt->fetch(); - -if ($result) { - // $id = $result["id"]; - $sql = "UPDATE `phone_verification_passenger` SET `verified` = 1 WHERE `phone_number` = $phone_number"; - $stmt = $con->prepare($sql); - $stmt->execute(); - - printSuccess($message = "Your phone number has been verified."); -} else { - printFailure($message = "Your phone number could not be verified. Please try again."); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/.jpg deleted file mode 100644 index e9bc083..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/FrontId-dbb338c62a5f0542807f3df4b6f7d7c92c7974e5143f19f8c1c4f1d165dd6cfe.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/FrontId-dbb338c62a5f0542807f3df4b6f7d7c92c7974e5143f19f8c1c4f1d165dd6cfe.jpg deleted file mode 100644 index 2fc0962..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/FrontId-dbb338c62a5f0542807f3df4b6f7d7c92c7974e5143f19f8c1c4f1d165dd6cfe.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-103636732989395685955.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-103636732989395685955.jpg deleted file mode 100644 index 56dcc91..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-103636732989395685955.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-105796073393555164903.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-105796073393555164903.jpg deleted file mode 100644 index 16b2f6b..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-105796073393555164903.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-106807014360965967789.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-106807014360965967789.jpg deleted file mode 100644 index 92e7002..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-106807014360965967789.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-110145232844940167393.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-110145232844940167393.jpg deleted file mode 100644 index ab01dae..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-110145232844940167393.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-111153173075619094972.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-111153173075619094972.jpg deleted file mode 100644 index 5a8a74a..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-111153173075619094972.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-111622841750200390472.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-111622841750200390472.jpg deleted file mode 100644 index 7e5bd58..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-111622841750200390472.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-112094777489552396128.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-112094777489552396128.jpg deleted file mode 100644 index ef1f9fa..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-112094777489552396128.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-113172279072358305645.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-113172279072358305645.jpg deleted file mode 100644 index 51854b4..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-113172279072358305645.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-114243034311436865474.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-114243034311436865474.jpg deleted file mode 100644 index f368ba5..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-114243034311436865474.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-115586550860574261102.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-115586550860574261102.jpg deleted file mode 100644 index ae89566..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/car_back-115586550860574261102.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-103636732989395685955.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-103636732989395685955.jpg deleted file mode 100644 index f698feb..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-103636732989395685955.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-105796073393555164903.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-105796073393555164903.jpg deleted file mode 100644 index 1bc2675..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-105796073393555164903.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-106807014360965967789.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-106807014360965967789.jpg deleted file mode 100644 index 6acdb4a..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-106807014360965967789.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-110145232844940167393.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-110145232844940167393.jpg deleted file mode 100644 index 93664ec..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-110145232844940167393.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-111153173075619094972.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-111153173075619094972.jpg deleted file mode 100644 index 3ed7b98..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-111153173075619094972.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-111622841750200390472.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-111622841750200390472.jpg deleted file mode 100644 index 7b687fb..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-111622841750200390472.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-112094777489552396128.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-112094777489552396128.jpg deleted file mode 100644 index b1fdb4c..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-112094777489552396128.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-113172279072358305645.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-113172279072358305645.jpg deleted file mode 100644 index 2edff75..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-113172279072358305645.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-114243034311436865474.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-114243034311436865474.jpg deleted file mode 100644 index c085da3..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-114243034311436865474.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-115586550860574261102.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-115586550860574261102.jpg deleted file mode 100644 index 93a72c0..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/car_front-115586550860574261102.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/criminalRecord-113172279072358305645.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/criminalRecord-113172279072358305645.jpg deleted file mode 100644 index 2e4679a..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/criminalRecord-113172279072358305645.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/criminalRecord-114243034311436865474.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/criminalRecord-114243034311436865474.jpg deleted file mode 100644 index e78fd8f..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/criminalRecord-114243034311436865474.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/dbb338c62a5f0542807f3df4b6f7d7c92c7974e5143f19f8c1c4f1d165dd6cfe.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/dbb338c62a5f0542807f3df4b6f7d7c92c7974e5143f19f8c1c4f1d165dd6cfe.jpg deleted file mode 100644 index 2fc0962..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/dbb338c62a5f0542807f3df4b6f7d7c92c7974e5143f19f8c1c4f1d165dd6cfe.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-100393163265770158312.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-100393163265770158312.jpg deleted file mode 100644 index c61b4c2..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-100393163265770158312.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-100967353904608230043.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-100967353904608230043.jpg deleted file mode 100644 index 04d2d48..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-100967353904608230043.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-102179124404514879816.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-102179124404514879816.jpg deleted file mode 100644 index 34401c2..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-102179124404514879816.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-103636732989395685955.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-103636732989395685955.jpg deleted file mode 100644 index 5c66074..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-103636732989395685955.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-105796073393555164903.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-105796073393555164903.jpg deleted file mode 100644 index 71ff638..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-105796073393555164903.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-106807014360965967789.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-106807014360965967789.jpg deleted file mode 100644 index f45f399..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-106807014360965967789.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-110145232844940167393.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-110145232844940167393.jpg deleted file mode 100644 index 65556c2..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-110145232844940167393.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-111153173075619094972.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-111153173075619094972.jpg deleted file mode 100644 index eb9d050..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-111153173075619094972.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-111622841750200390472.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-111622841750200390472.jpg deleted file mode 100644 index a0e3649..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-111622841750200390472.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-112094777489552396128.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-112094777489552396128.jpg deleted file mode 100644 index a7e78be..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-112094777489552396128.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-113172279072358305645.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-113172279072358305645.jpg deleted file mode 100644 index eb227fb..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-113172279072358305645.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-114243034311436865474.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-114243034311436865474.jpg deleted file mode 100644 index 7196e72..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-114243034311436865474.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-115586550860574261102.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-115586550860574261102.jpg deleted file mode 100644 index 6c780f1..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/driver_license-115586550860574261102.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/idFront-103920024153704554418.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/idFront-103920024153704554418.jpg deleted file mode 100644 index 1cd6781..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/idFront-103920024153704554418.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/idFront-110605074695183976275.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/idFront-110605074695183976275.jpg deleted file mode 100644 index 770dbe7..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/idFront-110605074695183976275.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/idFront-114243034311436865474.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/idFront-114243034311436865474.jpg deleted file mode 100644 index 16fd57e..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/idFront-114243034311436865474.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/idFront-dbb338c62a5f0542807f3df4b6f7d7c92c7974e5143f19f8c1c4f1d165dd6cfe.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/idFront-dbb338c62a5f0542807f3df4b6f7d7c92c7974e5143f19f8c1c4f1d165dd6cfe.jpg deleted file mode 100644 index 3efb110..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/idFront-dbb338c62a5f0542807f3df4b6f7d7c92c7974e5143f19f8c1c4f1d165dd6cfe.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/id_back-103636732989395685955.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/id_back-103636732989395685955.jpg deleted file mode 100644 index 046aced..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/id_back-103636732989395685955.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/id_back-106807014360965967789.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/id_back-106807014360965967789.jpg deleted file mode 100644 index ab9dec9..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/id_back-106807014360965967789.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/id_back-110145232844940167393.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/id_back-110145232844940167393.jpg deleted file mode 100644 index b4d88a3..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/id_back-110145232844940167393.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/id_back-111153173075619094972.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/id_back-111153173075619094972.jpg deleted file mode 100644 index b66aac6..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/id_back-111153173075619094972.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/id_back-111622841750200390472.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/id_back-111622841750200390472.jpg deleted file mode 100644 index 06fe69d..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/id_back-111622841750200390472.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/id_back-112094777489552396128.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/id_back-112094777489552396128.jpg deleted file mode 100644 index a60935d..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/id_back-112094777489552396128.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/id_back-113172279072358305645.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/id_back-113172279072358305645.jpg deleted file mode 100644 index 8cbd8d5..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/id_back-113172279072358305645.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/id_back-114243034311436865474.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/id_back-114243034311436865474.jpg deleted file mode 100644 index 1f13d76..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/id_back-114243034311436865474.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/id_back-115586550860574261102.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/id_back-115586550860574261102.jpg deleted file mode 100644 index 956e60b..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/id_back-115586550860574261102.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/id_front-103636732989395685955.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/id_front-103636732989395685955.jpg deleted file mode 100644 index 2ce4ad0..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/id_front-103636732989395685955.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/id_front-106807014360965967789.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/id_front-106807014360965967789.jpg deleted file mode 100644 index 611d7a3..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/id_front-106807014360965967789.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/id_front-110145232844940167393.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/id_front-110145232844940167393.jpg deleted file mode 100644 index d081407..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/id_front-110145232844940167393.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/id_front-111153173075619094972.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/id_front-111153173075619094972.jpg deleted file mode 100644 index ccb85c6..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/id_front-111153173075619094972.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/id_front-111622841750200390472.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/id_front-111622841750200390472.jpg deleted file mode 100644 index 1b4d70f..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/id_front-111622841750200390472.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/id_front-112094777489552396128.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/id_front-112094777489552396128.jpg deleted file mode 100644 index 300b0c1..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/id_front-112094777489552396128.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/id_front-113172279072358305645.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/id_front-113172279072358305645.jpg deleted file mode 100644 index 853a645..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/id_front-113172279072358305645.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/id_front-114243034311436865474.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/id_front-114243034311436865474.jpg deleted file mode 100644 index 4a3dc9d..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/id_front-114243034311436865474.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/card_image/id_front-115586550860574261102.jpg b/walletintaleq.intaleq.xyz/v2/main/card_image/id_front-115586550860574261102.jpg deleted file mode 100644 index b6a2122..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/card_image/id_front-115586550860574261102.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/cccc.php b/walletintaleq.intaleq.xyz/v2/main/cccc.php deleted file mode 100755 index af5d10f..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/cccc.php +++ /dev/null @@ -1,5 +0,0 @@ - \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/composer.json b/walletintaleq.intaleq.xyz/v2/main/composer.json deleted file mode 100755 index d7c6bb7..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/composer.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "require": { - "vlucas/phpdotenv": "^5.6" - } -} diff --git a/walletintaleq.intaleq.xyz/v2/main/composer.lock b/walletintaleq.intaleq.xyz/v2/main/composer.lock deleted file mode 100755 index 0b8b027..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/composer.lock +++ /dev/null @@ -1,479 +0,0 @@ -{ - "_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": "108be68e4e2b97fed51d36a10eed0849", - "packages": [ - { - "name": "graham-campbell/result-type", - "version": "v1.1.2", - "source": { - "type": "git", - "url": "https://github.com/GrahamCampbell/Result-Type.git", - "reference": "fbd48bce38f73f8a4ec8583362e732e4095e5862" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/GrahamCampbell/Result-Type/zipball/fbd48bce38f73f8a4ec8583362e732e4095e5862", - "reference": "fbd48bce38f73f8a4ec8583362e732e4095e5862", - "shasum": "" - }, - "require": { - "php": "^7.2.5 || ^8.0", - "phpoption/phpoption": "^1.9.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2" - }, - "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.2" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/graham-campbell/result-type", - "type": "tidelift" - } - ], - "time": "2023-11-12T22:16:48+00:00" - }, - { - "name": "phpoption/phpoption", - "version": "1.9.2", - "source": { - "type": "git", - "url": "https://github.com/schmittjoh/php-option.git", - "reference": "80735db690fe4fc5c76dfa7f9b770634285fa820" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-option/zipball/80735db690fe4fc5c76dfa7f9b770634285fa820", - "reference": "80735db690fe4fc5c76dfa7f9b770634285fa820", - "shasum": "" - }, - "require": { - "php": "^7.2.5 || ^8.0" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.34 || ^9.6.13 || ^10.4.2" - }, - "type": "library", - "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": true - }, - "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.2" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpoption/phpoption", - "type": "tidelift" - } - ], - "time": "2023-11-12T21:59:55+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.29.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/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.29.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-01-29T20:11:03+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.29.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9773676c8a1bb1f8d4340a62efe641cf76eda7ec", - "reference": "9773676c8a1bb1f8d4340a62efe641cf76eda7ec", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/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.29.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-01-29T20:11:03+00:00" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.29.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", - "reference": "87b68208d5c1188808dd7839ee1e6c8ec3b02f1b", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/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.29.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-01-29T20:11:03+00:00" - }, - { - "name": "vlucas/phpdotenv", - "version": "v5.6.0", - "source": { - "type": "git", - "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "2cf9fb6054c2bb1d59d1f3817706ecdb9d2934c4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/2cf9fb6054c2bb1d59d1f3817706ecdb9d2934c4", - "reference": "2cf9fb6054c2bb1d59d1f3817706ecdb9d2934c4", - "shasum": "" - }, - "require": { - "ext-pcre": "*", - "graham-campbell/result-type": "^1.1.2", - "php": "^7.2.5 || ^8.0", - "phpoption/phpoption": "^1.9.2", - "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": true - }, - "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.0" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv", - "type": "tidelift" - } - ], - "time": "2023-11-12T22:43:29+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" -} diff --git a/walletintaleq.intaleq.xyz/v2/main/config.ini b/walletintaleq.intaleq.xyz/v2/main/config.ini deleted file mode 100755 index 84882f7..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/config.ini +++ /dev/null @@ -1,4 +0,0 @@ -username = ddd -password = ddd -user = ddd -pass = ddd \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/config.ini.enc b/walletintaleq.intaleq.xyz/v2/main/config.ini.enc deleted file mode 100755 index 05240d4..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/config.ini.enc +++ /dev/null @@ -1 +0,0 @@ -RETNde5YRYJBhCigSLK3/UpuMzgrZkh3WkpvT1FRNWNKdkxJR3J6VlgxV0twWFhMMVNOWDVjWWowL1lqZU8vQmtOWlJLVVM3WW9RbHlPNFg2OEhvbHk1VFRqQmF2Y2E0TDNtOVBRNkdxSlh5Znc1Q0VFZll5Ym5ETnFJUi9PUXRKVXkvZGRNQlpXR0xKWWJ0 \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/egypt/.DS_Store b/walletintaleq.intaleq.xyz/v2/main/egypt/.DS_Store deleted file mode 100644 index a25d83d..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/egypt/.DS_Store and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/en.php b/walletintaleq.intaleq.xyz/v2/main/en.php deleted file mode 100755 index ada54b8..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/en.php +++ /dev/null @@ -1,97 +0,0 @@ -key = $key; - $this->iv = $iv; - } - - private function addPadding($data, $blockSize = 16) { - $pad = $blockSize - (strlen($data) % $blockSize); - return $data . str_repeat(chr($pad), $pad); - } - - private function removePadding($data) { - $pad = ord($data[strlen($data) - 1]); - return substr($data, 0, -$pad); - } - - public function encryptData($plainText) { - $plainText = mb_convert_encoding($plainText, 'UTF-8'); - $paddedText = $this->addPadding($plainText); - $encrypted = openssl_encrypt($paddedText, 'AES-256-CBC', $this->key, OPENSSL_RAW_DATA, $this->iv); - return base64_encode($encrypted); - } - - public function decryptData($encryptedText) { - $decoded = base64_decode($encryptedText); - $decrypted = openssl_decrypt($decoded, 'AES-256-CBC', $this->key, OPENSSL_RAW_DATA, $this->iv); - return $this->removePadding($decrypted); - } -} - -$key = getenv('keyOfApp'); -$iv = getenv('initializationVector'); - -echo "Key Length: " . strlen($key) . PHP_EOL; -echo "IV Length: " . strlen($iv) . PHP_EOL; - -$encryptionHelper = new EncryptionHelper($key, $iv); -$storedHash = '$2y$10$cM9AJ.EJyX1zj8zReTw8CO.Rcr6XW.8njmHeezEqsv4OlEWyHHA4S'; -$userProvidedPassword = 'unknown'; // This would come from the user input - -if (password_verify($userProvidedPassword, $storedHash)) { - echo "🔹 password_verify: Password is correct." . PHP_EOL; -} else { - echo "🔹 password_verify: Incorrect password." . PHP_EOL; -} - -$plainText = "unknown"; -$encryptedText = $encryptionHelper->encryptData($plainText); -$decryptedText = $encryptionHelper->decryptData($encryptedText); - -echo "🔹 Original Text: $plainText" . PHP_EOL; -echo "🔹 Encrypted Text: $encryptedText" . PHP_EOL; -echo "🔹 Decrypted Text: $decryptedText" . PHP_EOL; \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/error_log b/walletintaleq.intaleq.xyz/v2/main/error_log deleted file mode 100755 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/imageForUsingApp/order_page.jpg b/walletintaleq.intaleq.xyz/v2/main/imageForUsingApp/order_page.jpg deleted file mode 100644 index c8c6a3d..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/imageForUsingApp/order_page.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/index.php b/walletintaleq.intaleq.xyz/v2/main/index.php deleted file mode 100755 index 1cfc57a..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/index.php +++ /dev/null @@ -1,3 +0,0 @@ - - - - - Delete Account - - - - - - App logo - -

Delete Account

- - - -

To delete your account, please open the app and go to the Profile page. Then, tap on - the "Delete My Account" button and follow the instructions.

- - -

- © - All rights reserved by SEFER -

- - - - - \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/instructions_web/logo.png b/walletintaleq.intaleq.xyz/v2/main/instructions_web/logo.png deleted file mode 100644 index 3e0026b..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/instructions_web/logo.png and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/logs/mtn_payment.log b/walletintaleq.intaleq.xyz/v2/main/logs/mtn_payment.log deleted file mode 100644 index 0e954e4..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/logs/mtn_payment.log +++ /dev/null @@ -1,17 +0,0 @@ -🚀 MTN Payment Log Started -[23-Jul-2025 01:12:38] 🚦 START | passengerId: ba2d55d383eca49e4e11a1c2723bf3f2 | phone: 0999999999 | amount: 100000 -[23-Jul-2025 01:12:38] 🧾 Generated Invoice: MTN_ba2d55d383eca49e4e11a1c2723bf3f2_1753222358 -[23-Jul-2025 01:12:38] 🧭 Generated GUID: mtn_68800cd65385e -[23-Jul-2025 01:12:38] 📦 Create Invoice Body: {"Amount":10000000,"Invoice":"MTN_ba2d55d383eca49e4e11a1c2723bf3f2_1753222358","Session":0,"TTL":15} -[23-Jul-2025 01:12:38] 🔐 Signature for pos_web/invoice/create: -[23-Jul-2025 01:12:38] 📤 Sent JSON: {"Amount":10000000,"Invoice":"MTN_ba2d55d383eca49e4e11a1c2723bf3f2_1753222358","Session":0,"TTL":15} -[23-Jul-2025 01:12:38] 📥 Create Invoice Response: {"Errno":500,"Error":"Internal error"} -[23-Jul-2025 01:12:38] ❌ Failed to create invoice. Error: {"Errno":500,"Error":"Internal error"} -[23-Jul-2025 01:14:23] 🚦 START | passengerId: ba2d55d383eca49e4e11a1c2723bf3f2 | phone: 0999999999 | amount: 100000 -[23-Jul-2025 01:14:23] 🧾 Generated Invoice: MTN_ba2d55d383eca49e4e11a1c2723bf3f2_1753222463 -[23-Jul-2025 01:14:23] 🧭 Generated GUID: mtn_68800d3f5211b -[23-Jul-2025 01:14:23] 📦 Create Invoice Body: {"Amount":10000000,"Invoice":"MTN_ba2d55d383eca49e4e11a1c2723bf3f2_1753222463","Session":0,"TTL":15} -[23-Jul-2025 01:14:23] 🔐 Signature for pos_web/invoice/create: wUNJWaIJicn/qIQdvRV2vXLhs15JUuj3tGmPi9xInfQl+PqqF+j808aVj4UXJio+c2GqouMd2xiR8mJRo73uZ77nzf4Kr1skcXxtRwKDD0sCJBc7l1xHrvawEejkYL+J4Y2sJqXxCUQiC7aFc8I7deMHTLFUi2NcsnWg4w1HVnA= -[23-Jul-2025 01:14:23] 📤 Sent JSON: {"Amount":10000000,"Invoice":"MTN_ba2d55d383eca49e4e11a1c2723bf3f2_1753222463","Session":0,"TTL":15} -[23-Jul-2025 01:14:23] 📥 Create Invoice Response: {"Reply":"pos_web\/invoice\/create","Subject":"9001000000060863","ReqId":"d8c850eb-90e5-432b-923f-7f146a85ee2f","Errno":401,"Error":"Incorrect request signature"} -[23-Jul-2025 01:14:23] ❌ Failed to create invoice. Error: {"Reply":"pos_web\/invoice\/create","Subject":"9001000000060863","ReqId":"d8c850eb-90e5-432b-923f-7f146a85ee2f","Errno":401,"Error":"Incorrect request signature"} diff --git a/walletintaleq.intaleq.xyz/v2/main/otpmessage.php b/walletintaleq.intaleq.xyz/v2/main/otpmessage.php deleted file mode 100755 index 065b11e..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/otpmessage.php +++ /dev/null @@ -1,18 +0,0 @@ -verify->v2->services - ->create("My Verify Service"); - -print($service->sid); \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/paymob.php b/walletintaleq.intaleq.xyz/v2/main/paymob.php deleted file mode 100755 index 4e45898..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/paymob.php +++ /dev/null @@ -1,28 +0,0 @@ - 'Pipedream is the fastest way to connect APIs. Build and run workflows with code-level control when you need it — and no code when you don\'t.', - 'event_id' => $_GET['event_id'], - 'workflow_id' => $_GET['workflow_id'], - 'owner_id' => $_GET['owner_id'], - 'deployment_id' => $_GET['deployment_id'], - 'timestamp' => $_GET['timestamp'], - 'inspect' => 'https://pipedream.com/@/' . $_GET['workflow_id'], - 'quickstart' => 'https://pipedream.com/quickstart/', -]; - -// Send the response -http_response_code(200); - -foreach ($headers as $key => $value) { - header("$key: $value"); -} - -echo json_encode($body); -echo json_decode($body); - -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/.jpeg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/.jpeg deleted file mode 100644 index 8d71b98..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/.jpeg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/.jpg deleted file mode 100644 index 6dd008f..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/09ea0050dcd9624b984bd415c5e1d4711527232f.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/09ea0050dcd9624b984bd415c5e1d4711527232f.jpg deleted file mode 100644 index 532d871..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/09ea0050dcd9624b984bd415c5e1d4711527232f.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/0be40911b805c7ead3d90d11037c25b4bbb5167f.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/0be40911b805c7ead3d90d11037c25b4bbb5167f.jpg deleted file mode 100644 index 62129d8..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/0be40911b805c7ead3d90d11037c25b4bbb5167f.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/100640451635187114399.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/100640451635187114399.jpg deleted file mode 100644 index 2764aca..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/100640451635187114399.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/100709698456521168412.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/100709698456521168412.jpg deleted file mode 100644 index feb6e59..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/100709698456521168412.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/100863856454829613444.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/100863856454829613444.jpg deleted file mode 100644 index 561e7c8..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/100863856454829613444.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/101801548636069777753.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/101801548636069777753.jpg deleted file mode 100644 index 0f4549a..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/101801548636069777753.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/101889020480896624794.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/101889020480896624794.jpg deleted file mode 100644 index 4de3dec..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/101889020480896624794.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/102125246521055808022.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/102125246521055808022.jpg deleted file mode 100644 index ef99141..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/102125246521055808022.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/102522864607223898218.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/102522864607223898218.jpg deleted file mode 100644 index 5a79256..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/102522864607223898218.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/102529380798796762788.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/102529380798796762788.jpg deleted file mode 100644 index 194143f..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/102529380798796762788.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/102879069039926260064.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/102879069039926260064.jpg deleted file mode 100644 index 679a953..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/102879069039926260064.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/103189680831826460789.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/103189680831826460789.jpg deleted file mode 100644 index 8b63769..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/103189680831826460789.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/103624573245566437609.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/103624573245566437609.jpg deleted file mode 100644 index 2c8bb05..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/103624573245566437609.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/103826557563952759324.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/103826557563952759324.jpg deleted file mode 100644 index 1056ebd..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/103826557563952759324.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/103900675080620462886.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/103900675080620462886.jpg deleted file mode 100644 index 3f9dc9c..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/103900675080620462886.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/104564626474544059670.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/104564626474544059670.jpg deleted file mode 100644 index dc378b0..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/104564626474544059670.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/104618005199546155267.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/104618005199546155267.jpg deleted file mode 100644 index d0c75fc..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/104618005199546155267.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/104830497380358979291.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/104830497380358979291.jpg deleted file mode 100644 index a8eb612..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/104830497380358979291.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/105216412271230904068.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/105216412271230904068.jpg deleted file mode 100644 index ad21c39..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/105216412271230904068.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/105290325813346300822.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/105290325813346300822.jpg deleted file mode 100644 index b10baae..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/105290325813346300822.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/105543283537757397531.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/105543283537757397531.jpg deleted file mode 100644 index a4b511f..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/105543283537757397531.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/105692687966420771965.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/105692687966420771965.jpg deleted file mode 100644 index 13a1ede..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/105692687966420771965.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/105723478348494770717.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/105723478348494770717.jpg deleted file mode 100644 index 09c287a..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/105723478348494770717.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/105782765640070783647.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/105782765640070783647.jpg deleted file mode 100644 index fbc2413..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/105782765640070783647.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/105967173309588012199.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/105967173309588012199.jpg deleted file mode 100644 index d256bdf..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/105967173309588012199.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/106111169026592926063.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/106111169026592926063.jpg deleted file mode 100644 index c4b855a..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/106111169026592926063.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/106198683972987021838.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/106198683972987021838.jpg deleted file mode 100644 index a1c1d5b..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/106198683972987021838.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/106257242807178778033.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/106257242807178778033.jpg deleted file mode 100644 index 7487186..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/106257242807178778033.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/106461731648120198140.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/106461731648120198140.jpg deleted file mode 100644 index 6085ab7..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/106461731648120198140.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/106475888047535730912.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/106475888047535730912.jpg deleted file mode 100644 index 8ccee07..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/106475888047535730912.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/106577903237157200001.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/106577903237157200001.jpg deleted file mode 100644 index 8a6d0a9..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/106577903237157200001.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/106748548377954265141.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/106748548377954265141.jpg deleted file mode 100644 index 07e0d6d..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/106748548377954265141.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/107266209587634662826.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/107266209587634662826.jpg deleted file mode 100644 index 5741978..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/107266209587634662826.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/107553147426555427650.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/107553147426555427650.jpg deleted file mode 100644 index e86f8b2..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/107553147426555427650.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/107759815919208956625.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/107759815919208956625.jpg deleted file mode 100644 index 355d1ba..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/107759815919208956625.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/107759856930007751532.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/107759856930007751532.jpg deleted file mode 100644 index b707938..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/107759856930007751532.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/107799830903247121409.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/107799830903247121409.jpg deleted file mode 100644 index 6bc9113..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/107799830903247121409.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/107906993541141391497.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/107906993541141391497.jpg deleted file mode 100644 index 50d8037..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/107906993541141391497.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/108097044067900621866.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/108097044067900621866.jpg deleted file mode 100644 index 1830310..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/108097044067900621866.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/108273415769505130902.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/108273415769505130902.jpg deleted file mode 100644 index 09202b0..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/108273415769505130902.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/108515276700373718313.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/108515276700373718313.jpg deleted file mode 100644 index 8372059..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/108515276700373718313.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/108584555851561644050.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/108584555851561644050.jpg deleted file mode 100644 index 6d07dd8..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/108584555851561644050.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/108663582199261664667.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/108663582199261664667.jpg deleted file mode 100644 index e41eeef..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/108663582199261664667.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/108708708585533568694.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/108708708585533568694.jpg deleted file mode 100644 index f6428a6..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/108708708585533568694.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/109053960515045947611.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/109053960515045947611.jpg deleted file mode 100644 index 4d157ce..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/109053960515045947611.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/109271510704360623699.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/109271510704360623699.jpg deleted file mode 100644 index eb5fe67..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/109271510704360623699.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/109905590760990573566.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/109905590760990573566.jpg deleted file mode 100644 index e4f3513..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/109905590760990573566.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/109957052549748306756.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/109957052549748306756.jpg deleted file mode 100644 index fbc7dff..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/109957052549748306756.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/110150066383672287382.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/110150066383672287382.jpg deleted file mode 100644 index edbfa7c..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/110150066383672287382.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/110605074695183976275.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/110605074695183976275.jpg deleted file mode 100644 index 945fa6c..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/110605074695183976275.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/110964111936155642289.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/110964111936155642289.jpg deleted file mode 100644 index 1a67285..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/110964111936155642289.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/111960639186747286079.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/111960639186747286079.jpg deleted file mode 100644 index 1504a7c..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/111960639186747286079.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/111976894569752691383.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/111976894569752691383.jpg deleted file mode 100644 index 5378929..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/111976894569752691383.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/112526642579117146751.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/112526642579117146751.jpg deleted file mode 100644 index cd873f4..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/112526642579117146751.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/112765263168949450880.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/112765263168949450880.jpg deleted file mode 100644 index 2742909..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/112765263168949450880.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/112991014353953989940.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/112991014353953989940.jpg deleted file mode 100644 index b90a059..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/112991014353953989940.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/113132572949319796386.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/113132572949319796386.jpg deleted file mode 100644 index e10d797..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/113132572949319796386.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/113172279072358305645.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/113172279072358305645.jpg deleted file mode 100644 index f26135e..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/113172279072358305645.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/113386724468603821666.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/113386724468603821666.jpg deleted file mode 100644 index 2332317..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/113386724468603821666.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/113691677403170451168.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/113691677403170451168.jpg deleted file mode 100644 index fd18cbd..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/113691677403170451168.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/114007097502103968011.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/114007097502103968011.jpg deleted file mode 100644 index 1b77d2b..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/114007097502103968011.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/114243034311436865474.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/114243034311436865474.jpg deleted file mode 100644 index 35b2991..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/114243034311436865474.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/114250903363463998871.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/114250903363463998871.jpg deleted file mode 100644 index 55b7be0..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/114250903363463998871.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/115405648336253331829.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/115405648336253331829.jpg deleted file mode 100644 index 7533c36..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/115405648336253331829.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/115437547204749173370.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/115437547204749173370.jpg deleted file mode 100644 index e971ba7..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/115437547204749173370.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/115683640435899067251.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/115683640435899067251.jpg deleted file mode 100644 index bd2e660..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/115683640435899067251.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/116497803852388207272.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/116497803852388207272.jpg deleted file mode 100644 index f20e0aa..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/116497803852388207272.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/116996152991737817437.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/116996152991737817437.jpg deleted file mode 100644 index 9503857..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/116996152991737817437.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/117714284189065236931.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/117714284189065236931.jpg deleted file mode 100644 index b72d78e..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/117714284189065236931.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/117717190217675884772.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/117717190217675884772.jpg deleted file mode 100644 index b5a7310..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/117717190217675884772.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/117799226761624300570.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/117799226761624300570.jpg deleted file mode 100644 index b55ce27..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/117799226761624300570.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/117987020727914246593.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/117987020727914246593.jpg deleted file mode 100644 index 0fc9f94..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/117987020727914246593.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/117988195341881264057.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/117988195341881264057.jpg deleted file mode 100644 index ee4eafc..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/117988195341881264057.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/118426682305752856096.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/118426682305752856096.jpg deleted file mode 100644 index ba64f65..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/118426682305752856096.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/164220be26cc303991f591a2f2c00f2a3b94a36f.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/164220be26cc303991f591a2f2c00f2a3b94a36f.jpg deleted file mode 100644 index cd602ea..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/164220be26cc303991f591a2f2c00f2a3b94a36f.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/5fa87bcf5d98dafaada4cdbc4812cf6f788600a6.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/5fa87bcf5d98dafaada4cdbc4812cf6f788600a6.jpg deleted file mode 100644 index f160de1..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/5fa87bcf5d98dafaada4cdbc4812cf6f788600a6.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/ba94ef0df65fd90a122ac13c96090661b19d80e6.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/ba94ef0df65fd90a122ac13c96090661b19d80e6.jpg deleted file mode 100644 index a2926ce..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/ba94ef0df65fd90a122ac13c96090661b19d80e6.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/dbb338c62a5f0542807f3df4b6f7d7c92c7974e5143f19f8c1c4f1d165dd6cfe.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/dbb338c62a5f0542807f3df4b6f7d7c92c7974e5143f19f8c1c4f1d165dd6cfe.jpg deleted file mode 100644 index 5003bd0..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/dbb338c62a5f0542807f3df4b6f7d7c92c7974e5143f19f8c1c4f1d165dd6cfe.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/ffc1cda68f1763e0e1604f58db16741e52ed005e.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/ffc1cda68f1763e0e1604f58db16741e52ed005e.jpg deleted file mode 100644 index 28e99e4..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/ffc1cda68f1763e0e1604f58db16741e52ed005e.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/j6p0SxoUmiY5NDhZa79inYhIW6f2.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/j6p0SxoUmiY5NDhZa79inYhIW6f2.jpg deleted file mode 100644 index 57a14d8..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/j6p0SxoUmiY5NDhZa79inYhIW6f2.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/oUtCcLEmpUbJA8e34EB3ZPA0qH23.jpg b/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/oUtCcLEmpUbJA8e34EB3ZPA0qH23.jpg deleted file mode 100644 index deaa0b7..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/portrate_captain_image/oUtCcLEmpUbJA8e34EB3ZPA0qH23.jpg and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/privacy_policy.php b/walletintaleq.intaleq.xyz/v2/main/privacy_policy.php deleted file mode 100755 index 863ce19..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/privacy_policy.php +++ /dev/null @@ -1,56 +0,0 @@ - - -
-
PRIVACY POLICY

Last updated December 06, 2023



This privacy notice for Mobile-App ("we," "us," or "our"), describes how and why we might collect, store, use, and/or share ("process") your information when you use our services ("Services"), such as when you:
Questions or concerns? Reading this privacy notice will help you understand your privacy rights and choices. If you do not agree with our policies and practices, please do not use our Services. If you still have any questions or concerns, please contact us at hamzaayed@mobile-app.store.


SUMMARY OF KEY POINTS

This summary provides key points from our privacy notice, but you can find out more details about any of these topics by clicking the link following each key point or by using our table of contents below to find the section you are looking for.

What personal information do we process? When you visit, use, or navigate our Services, we may process personal information depending on how you interact with us and the Services, the choices you make, and the products and features you use. Learn more about personal information you disclose to us.

Do we process any sensitive personal information? We may process sensitive personal information when necessary with your consent or as otherwise permitted by applicable law. Learn more about sensitive information we process.

Do we receive any information from third parties? We do not receive any information from third parties.

How do we process your information? We process your information to provide, improve, and administer our Services, communicate with you, for security and fraud prevention, and to comply with law. We may also process your information for other purposes with your consent. We process your information only when we have a valid legal reason to do so. Learn more about how we process your information.

In what situations and with which parties do we share personal information? We may share information in specific situations and with specific third parties. Learn more about when and with whom we share your personal information.

How do we keep your information safe? We have organizational and technical processes and procedures in place to protect your personal information. However, no electronic transmission over the internet or information storage technology can be guaranteed to be 100% secure, so we cannot promise or guarantee that hackers, cybercriminals, or other unauthorized third parties will not be able to defeat our security and improperly collect, access, steal, or modify your information. Learn more about how we keep your information safe.

What are your rights? Depending on where you are located geographically, the applicable privacy law may mean you have certain rights regarding your personal information. Learn more about your privacy rights.

How do you exercise your rights? The easiest way to exercise your rights is by visiting __________, or by contacting us. We will consider and act upon any request in accordance with applicable data protection laws.

Want to learn more about what we do with any information we collect? Review the privacy notice in full.


TABLE OF CONTENTS

1. WHAT INFORMATION DO WE COLLECT?
2. HOW DO WE PROCESS YOUR INFORMATION?
3. WHEN AND WITH WHOM DO WE SHARE YOUR PERSONAL INFORMATION?
4. HOW DO WE HANDLE YOUR SOCIAL LOGINS?
5. HOW LONG DO WE KEEP YOUR INFORMATION?
6. HOW DO WE KEEP YOUR INFORMATION SAFE?
7. DO WE COLLECT INFORMATION FROM MINORS?
8. WHAT ARE YOUR PRIVACY RIGHTS?
9. CONTROLS FOR DO-NOT-TRACK FEATURES
10. DO UNITED STATES RESIDENTS HAVE SPECIFIC PRIVACY RIGHTS?
11. DO WE MAKE UPDATES TO THIS NOTICE?
12. HOW CAN YOU CONTACT US ABOUT THIS NOTICE?
13. HOW CAN YOU REVIEW, UPDATE, OR DELETE THE DATA WE COLLECT FROM YOU?


1. WHAT INFORMATION DO WE COLLECT?

Personal information you disclose to us

In Short: We collect personal information that you provide to us.

We collect personal information that you voluntarily provide to us when you register on the Services, express an interest in obtaining information about us or our products and Services, when you participate in activities on the Services, or otherwise when you contact us.

Personal Information Provided by You. The personal information that we collect depends on the context of your interactions with us and the Services, the choices you make, and the products and features you use. The personal information we collect may include the following:
Sensitive Information. When necessary, with your consent or as otherwise permitted by applicable law, we process the following categories of sensitive information:
Payment Data. We may collect data necessary to process your payment if you make purchases, such as your payment instrument number, and the security code associated with your payment instrument. All payment data is stored by __________. You may find their privacy notice link(s) here: __________.

Social Media Login Data. We may provide you with the option to register with us using your existing social media account details, like your Facebook, Twitter, or other social media account. If you choose to register in this way, we will collect the information described in the section called "HOW DO WE HANDLE YOUR SOCIAL LOGINS?" below.

Application Data. If you use our application(s), we also may collect the following information if you choose to provide us with access or permission:
  • Mobile Device Data. We automatically collect device information (such as your mobile device ID, model, and manufacturer), operating system, version information and system configuration information, device and application identification numbers, browser type and version, hardware model Internet service provider and/or mobile carrier, and Internet Protocol (IP) address (or proxy server). If you are using our application(s), we may also collect information about the phone network associated with your mobile device, your mobile device’s operating system or platform, the type of mobile device you use, your mobile device’s unique device ID, and information about the features of our application(s) you accessed.
This information is primarily needed to maintain the security and operation of our application(s), for troubleshooting, and for our internal analytics and reporting purposes.

All personal information that you provide to us must be true, complete, and accurate, and you must notify us of any changes to such personal information.

Information automatically collected

In Short: Some information — such as your Internet Protocol (IP) address and/or browser and device characteristics — is collected automatically when you visit our Services.

We automatically collect certain information when you visit, use, or navigate the Services. This information does not reveal your specific identity (like your name or contact information) but may include device and usage information, such as your IP address, browser and device characteristics, operating system, language preferences, referring URLs, device name, country, location, information about how and when you use our Services, and other technical information. This information is primarily needed to maintain the security and operation of our Services, and for our internal analytics and reporting purposes.

The information we collect includes:
  • Device Data. We collect device data such as information about your computer, phone, tablet, or other device you use to access the Services. Depending on the device used, this device data may include information such as your IP address (or proxy server), device and application identification numbers, location, browser type, hardware model, Internet service provider and/or mobile carrier, operating system, and system configuration information.
  • Location Data. We collect location data such as information about your device's location, which can be either precise or imprecise. How much information we collect depends on the type and settings of the device you use to access the Services. For example, we may use GPS and other technologies to collect geolocation data that tells us your current location (based on your IP address). You can opt out of allowing us to collect this information either by refusing access to the information or by disabling your Location setting on your device. However, if you choose to opt out, you may not be able to use certain aspects of the Services.
  • __________. __________
2. HOW DO WE PROCESS YOUR INFORMATION?

In Short: We process your information to provide, improve, and administer our Services, communicate with you, for security and fraud prevention, and to comply with law. We may also process your information for other purposes with your consent.

We process your personal information for a variety of reasons, depending on how you interact with our Services, including:
  • To facilitate account creation and authentication and otherwise manage user accounts. We may process your information so you can create and log in to your account, as well as keep your account in working order.
  • To deliver and facilitate delivery of services to the user. We may process your information to provide you with the requested service.
  • To respond to user inquiries/offer support to users. We may process your information to respond to your inquiries and solve any potential issues you might have with the requested service.
  • To send administrative information to you. We may process your information to send you details about our products and services, changes to our terms and policies, and other similar information.
  • To fulfill and manage your orders. We may process your information to fulfill and manage your orders, payments, returns, and exchanges made through the Services.

  • To enable user-to-user communications. We may process your information if you choose to use any of our offerings that allow for communication with another user.

  • To request feedback. We may process your information when necessary to request feedback and to contact you about your use of our Services.

  • To send you marketing and promotional communications. We may process the personal information you send to us for our marketing purposes, if this is in accordance with your marketing preferences. You can opt out of our marketing emails at any time. For more information, see "WHAT ARE YOUR PRIVACY RIGHTS?" below.
  • To protect our Services. We may process your information as part of our efforts to keep our Services safe and secure, including fraud monitoring and prevention.
  • To administer prize draws and competitions. We may process your information to administer prize draws and competitions.
  • To identify usage trends. We may process information about how you use our Services to better understand how they are being used so we can improve them.
  • To comply with our legal obligations. We may process your information to comply with our legal obligations, respond to legal requests, and exercise, establish, or defend our legal rights.

3. WHEN AND WITH WHOM DO WE SHARE YOUR PERSONAL INFORMATION?

In Short: We may share information in specific situations described in this section and/or with the following third parties.

We may need to share your personal information in the following situations:
  • Business Transfers. We may share or transfer your information in connection with, or during negotiations of, any merger, sale of company assets, financing, or acquisition of all or a portion of our business to another company.

4. HOW DO WE HANDLE YOUR SOCIAL LOGINS?

In Short: If you choose to register or log in to our Services using a social media account, we may have access to certain information about you.

Our Services offer you the ability to register and log in using your third-party social media account details (like your Facebook or Twitter logins). Where you choose to do this, we will receive certain profile information about you from your social media provider. The profile information we receive may vary depending on the social media provider concerned, but will often include your name, email address, friends list, and profile picture, as well as other information you choose to make public on such a social media platform.

We will use the information we receive only for the purposes that are described in this privacy notice or that are otherwise made clear to you on the relevant Services. Please note that we do not control, and are not responsible for, other uses of your personal information by your third-party social media provider. We recommend that you review their privacy notice to understand how they collect, use, and share your personal information, and how you can set your privacy preferences on their sites and apps.

5. HOW LONG DO WE KEEP YOUR INFORMATION?

In Short: We keep your information for as long as necessary to fulfill the purposes outlined in this privacy notice unless otherwise required by law.

We will only keep your personal information for as long as it is necessary for the purposes set out in this privacy notice, unless a longer retention period is required or permitted by law (such as tax, accounting, or other legal requirements). No purpose in this notice will require us keeping your personal information for longer than   one (1) months past the termination of the user's account.

When we have no ongoing legitimate business need to process your personal information, we will either delete or anonymize such information, or, if this is not possible (for example, because your personal information has been stored in backup archives), then we will securely store your personal information and isolate it from any further processing until deletion is possible.

6. HOW DO WE KEEP YOUR INFORMATION SAFE?

In Short: We aim to protect your personal information through a system of organizational and technical security measures.

We have implemented appropriate and reasonable technical and organizational security measures designed to protect the security of any personal information we process. However, despite our safeguards and efforts to secure your information, no electronic transmission over the Internet or information storage technology can be guaranteed to be 100% secure, so we cannot promise or guarantee that hackers, cybercriminals, or other unauthorized third parties will not be able to defeat our security and improperly collect, access, steal, or modify your information. Although we will do our best to protect your personal information, transmission of personal information to and from our Services is at your own risk. You should only access the Services within a secure environment.

7. DO WE COLLECT INFORMATION FROM MINORS?

In Short: We do not knowingly collect data from or market to children under 18 years of age.

We do not knowingly solicit data from or market to children under 18 years of age. By using the Services, you represent that you are at least 18 or that you are the parent or guardian of such a minor and consent to such minor dependent’s use of the Services. If we learn that personal information from users less than 18 years of age has been collected, we will deactivate the account and take reasonable measures to promptly delete such data from our records. If you become aware of any data we may have collected from children under age 18, please contact us at support@mobile-app.store.

8. WHAT ARE YOUR PRIVACY RIGHTS?

In Short:  You may review, change, or terminate your account at any time.

Withdrawing your consent: If we are relying on your consent to process your personal information, which may be express and/or implied consent depending on the applicable law, you have the right to withdraw your consent at any time. You can withdraw your consent at any time by contacting us by using the contact details provided in the section "HOW CAN YOU CONTACT US ABOUT THIS NOTICE?" below.

However, please note that this will not affect the lawfulness of the processing before its withdrawal nor, when applicable law allows, will it affect the processing of your personal information conducted in reliance on lawful processing grounds other than consent.

Account Information

If you would at any time like to review or change the information in your account or terminate your account, you can:
  • Log in to your account settings and update your user account.
  • Contact us using the contact information provided.
  • support@mobile-app.store
Upon your request to terminate your account, we will deactivate or delete your account and information from our active databases. However, we may retain some information in our files to prevent fraud, troubleshoot problems, assist with any investigations, enforce our legal terms and/or comply with applicable legal requirements.

If you have questions or comments about your privacy rights, you may email us at hamzaayed@mobile-app.store.

9. CONTROLS FOR DO-NOT-TRACK FEATURES

Most web browsers and some mobile operating systems and mobile applications include a Do-Not-Track ("DNT") feature or setting you can activate to signal your privacy preference not to have data about your online browsing activities monitored and collected. At this stage no uniform technology standard for recognizing and implementing DNT signals has been finalized. As such, we do not currently respond to DNT browser signals or any other mechanism that automatically communicates your choice not to be tracked online. If a standard for online tracking is adopted that we must follow in the future, we will inform you about that practice in a revised version of this privacy notice.

10. DO UNITED STATES RESIDENTS HAVE SPECIFIC PRIVACY RIGHTS?

In Short: If you are a resident of California, Colorado, Utah, Virginia or Connecticut, you are granted specific rights regarding access to your personal information.

What categories of personal information do we collect?

We have collected the following categories of personal information in the past twelve (12) months:

CategoryExamplesCollected
A. Identifiers
Contact details, such as real name, alias, postal address, telephone or mobile contact number, unique personal identifier, online identifier, Internet Protocol address, email address, and account name

NO

B. Personal information as defined in the California Customer Records statute
Name, contact information, education, employment, employment history, and financial information

NO

C. Protected classification characteristics under state or federal law
Gender and date of birth

YES

D. Commercial information
Transaction information, purchase history, financial details, and payment information

NO

E. Biometric information
Fingerprints and voiceprints

NO

F. Internet or other similar network activity
Browsing history, search history, online behavior, interest data, and interactions with our and other websites, applications, systems, and advertisements

NO

G. Geolocation data
Device location

YES

H. Audio, electronic, visual, thermal, olfactory, or similar information
Images and audio, video or call recordings created in connection with our business activities

NO

I. Professional or employment-related information
Business contact details in order to provide you our Services at a business level or job title, work history, and professional qualifications if you apply for a job with us

NO

J. Education Information
Student records and directory information

YES

K. Inferences drawn from collected personal information
Inferences drawn from any of the collected personal information listed above to create a profile or summary about, for example, an individual’s preferences and characteristics

NO

L. Sensitive personal InformationAccount login information, contents of email or text messages, precise geolocation, sex life or sexual orientation and state id card numbers

YES


We will use and retain the collected personal information as needed to provide the Services or for:
  • Category B - As long as the user has an account with us
  • Category C - As long as the user has an account with us
  • Category G - As long as the user has an account with us
  • Category J - As long as the user has an account with us
  • Category L - As long as the user has an account with us
Category L information may be used, or disclosed to a service provider or contractor, for additional, specified purposes. You have the right to limit the use or disclosure of your sensitive personal information.

We may also collect other personal information outside of these categories through instances where you interact with us in person, online, or by phone or mail in the context of:
  • Receiving help through our customer support channels;
  • Participation in customer surveys or contests; and
  • Facilitation in the delivery of our Services and to respond to your inquiries.
How do we use and share your personal information?

Learn about how we use your personal information in the section, "HOW DO WE PROCESS YOUR INFORMATION?"

Will your information be shared with anyone else?

We may disclose your personal information with our service providers pursuant to a written contract between us and each service provider. Learn more about how we disclose personal information to in the section, "WHEN AND WITH WHOM DO WE SHARE YOUR PERSONAL INFORMATION?"

We may use your personal information for our own business purposes, such as for undertaking internal research for technological development and demonstration. This is not considered to be "selling" of your personal information.

We have not disclosed, sold, or shared any personal information to third parties for a business or commercial purpose in the preceding twelve (12) months. We will not sell or share personal information in the future belonging to website visitors, users, and other consumers.

California Residents

California Civil Code Section 1798.83, also known as the "Shine The Light" law permits our users who are California residents to request and obtain from us, once a year and free of charge, information about categories of personal information (if any) we disclosed to third parties for direct marketing purposes and the names and addresses of all third parties with which we shared personal information in the immediately preceding calendar year. If you are a California resident and would like to make such a request, please submit your request in writing to us using the contact information provided below.

If you are under 18 years of age, reside in California, and have a registered account with the Services, you have the right to request removal of unwanted data that you publicly post on the Services. To request removal of such data, please contact us using the contact information provided below and include the email address associated with your account and a statement that you reside in California. We will make sure the data is not publicly displayed on the Services, but please be aware that the data may not be completely or comprehensively removed from all our systems (e.g., backups, etc.).

CCPA Privacy Notice

This section applies only to California residents. Under the California Consumer Privacy Act (CCPA), you have the rights listed below.

The California Code of Regulations defines a "residents" as:

(1) every individual who is in the State of California for other than a temporary or transitory purpose and
(2) every individual who is domiciled in the State of California who is outside the State of California for a temporary or transitory purpose

All other individuals are defined as "non-residents."

If this definition of "resident" applies to you, we must adhere to certain rights and obligations regarding your personal information.

Your rights with respect to your personal data

Right to request deletion of the data — Request to delete

You can ask for the deletion of your personal information. If you ask us to delete your personal information, we will respect your request and delete your personal information, subject to certain exceptions provided by law, such as (but not limited to) the exercise by another consumer of his or her right to free speech, our compliance requirements resulting from a legal obligation, or any processing that may be required to protect against illegal activities.

Right to be informed — Request to know

Depending on the circumstances, you have a right to know:
  • whether we collect and use your personal information;
  • the categories of personal information that we collect;
  • the purposes for which the collected personal information is used;
  • whether we sell or share personal information to third parties;
  • the categories of personal information that we sold, shared, or disclosed for a business purpose;
  • the categories of third parties to whom the personal information was sold, shared, or disclosed for a business purpose;
  • the business or commercial purpose for collecting, selling, or sharing personal information; and
  • the specific pieces of personal information we collected about you.
In accordance with applicable law, we are not obligated to provide or delete consumer information that is de-identified in response to a consumer request or to re-identify individual data to verify a consumer request.

Right to Non-Discrimination for the Exercise of a Consumer’s Privacy Rights

We will not discriminate against you if you exercise your privacy rights.

Right to Limit Use and Disclosure of Sensitive Personal Information

If the business collects any of the following:
  • social security information, drivers' licenses, state ID cards, passport numbers
  • account login information
  • credit card numbers, financial account information, or credentials allowing access to such accounts
  • precise geolocation
  • racial or ethnic origin, religious or philosophical beliefs, union membership
  • the contents of email and text, unless the business is the intended recipient of the communication
  • genetic data, biometric data, and health data
  • data concerning sexual orientation and sex life
you have the right to direct that business to limit its use of your sensitive personal information to that use which is necessary to perform the Services.

Once a business receives your request, they are no longer allowed to use or disclose your sensitive personal information for any other purpose unless you provide consent for the use or disclosure of sensitive personal information for additional purposes.

Please note that sensitive personal information that is collected or processed without the purpose of inferring characteristics about a consumer is not covered by this right, as well as the publicly available information.

To exercise your right to limit use and disclosure of sensitive personal information, please email hamzaayed@mobile-app.store or visit: __________.

Verification process

Upon receiving your request, we will need to verify your identity to determine you are the same person about whom we have the information in our system. These verification efforts require us to ask you to provide information so that we can match it with information you have previously provided us. For instance, depending on the type of request you submit, we may ask you to provide certain information so that we can match the information you provide with the information we already have on file, or we may contact you through a communication method (e.g., phone or email) that you have previously provided to us. We may also use other verification methods as the circumstances dictate.

We will only use personal information provided in your request to verify your identity or authority to make the request. To the extent possible, we will avoid requesting additional information from you for the purposes of verification. However, if we cannot verify your identity from the information already maintained by us, we may request that you provide additional information for the purposes of verifying your identity and for security or fraud-prevention purposes. We will delete such additionally provided information as soon as we finish verifying you.

Other privacy rights
  • You may object to the processing of your personal information.
  • You may request correction of your personal data if it is incorrect or no longer relevant, or ask to restrict the processing of the information.
  • You can designate an authorized agent to make a request under the CCPA on your behalf. We may deny a request from an authorized agent that does not submit proof that they have been validly authorized to act on your behalf in accordance with the CCPA.
  • You may request to opt out from future selling or sharing of your personal information to third parties. Upon receiving an opt-out request, we will act upon the request as soon as feasibly possible, but no later than fifteen (15) days from the date of the request submission.
To exercise these rights, you can contact us by visiting __________, by email at support@mobile-app.store, or by referring to the contact details at the bottom of this document. If you have a complaint about how we handle your data, we would like to hear from you.

Colorado Residents

This section applies only to Colorado residents. Under the Colorado Privacy Act (CPA), you have the rights listed below. However, these rights are not absolute, and in certain cases, we may decline your request as permitted by law.
  • Right to be informed whether or not we are processing your personal data
  • Right to access your personal data
  • Right to correct inaccuracies in your personal data
  • Right to request deletion of your personal data
  • Right to obtain a copy of the personal data you previously shared with us
  • Right to opt out of the processing of your personal data if it is used for targeted advertising, the sale of personal data, or profiling in furtherance of decisions that produce legal or similarly significant effects ("profiling")
To submit a request to exercise these rights described above, please email hamzaayed@mobile-app.store or visit __________.

If we decline to take action regarding your request and you wish to appeal our decision, please email us at support@mobile-app.store. Within forty-five (45) days of receipt of an appeal, we will inform you in writing of any action taken or not taken in response to the appeal, including a written explanation of the reasons for the decisions.

Connecticut Residents

This section applies only to Connecticut residents. Under the Connecticut Data Privacy Act (CTDPA), you have the rights listed below. However, these rights are not absolute, and in certain cases, we may decline your request as permitted by law.
  • Right to be informed whether or not we are processing your personal data
  • Right to access your personal data
  • Right to correct inaccuracies in your personal data
  • Right to request deletion of your personal data
  • Right to obtain a copy of the personal data you previously shared with us
  • Right to opt out of the processing of your personal data if it is used for targeted advertising, the sale of personal data, or profiling in furtherance of decisions that produce legal or similarly significant effects ("profiling")
To submit a request to exercise these rights described above, please email hamzaayed@mobile-app.store or visit __________.

If we decline to take action regarding your request and you wish to appeal our decision, please email us at support@mobile-app.store. Within sixty (60) days of receipt of an appeal, we will inform you in writing of any action taken or not taken in response to the appeal, including a written explanation of the reasons for the decisions.

Utah Residents

This section applies only to Utah residents. Under the Utah Consumer Privacy Act (UCPA), you have the rights listed below. However, these rights are not absolute, and in certain cases, we may decline your request as permitted by law.
  • Right to be informed whether or not we are processing your personal data
  • Right to access your personal data
  • Right to request deletion of your personal data
  • Right to obtain a copy of the personal data you previously shared with us
  • Right to opt out of the processing of your personal data if it is used for targeted advertising or the sale of personal data
To submit a request to exercise these rights described above, please email hamzaayed@mobile-app.store or visit __________.

Virginia Residents

Under the Virginia Consumer Data Protection Act (VCDPA):

"Consumer" means a natural person who is a resident of the Commonwealth acting only in an individual or household context. It does not include a natural person acting in a commercial or employment context.

"Personal data" means any information that is linked or reasonably linkable to an identified or identifiable natural person. "Personal data" does not include de-identified data or publicly available information.

"Sale of personal data" means the exchange of personal data for monetary consideration.

If this definition of "consumer" applies to you, we must adhere to certain rights and obligations regarding your personal data.

Your rights with respect to your personal data
  • Right to be informed whether or not we are processing your personal data
  • Right to access your personal data
  • Right to correct inaccuracies in your personal data
  • Right to request deletion of your personal data
  • Right to obtain a copy of the personal data you previously shared with us
  • Right to opt out of the processing of your personal data if it is used for targeted advertising, the sale of personal data, or profiling in furtherance of decisions that produce legal or similarly significant effects ("profiling")
Exercise your rights provided under the Virginia VCDPA

You may contact us by email at hamzaayed@mobile-app.store or visit __________.

If you are using an authorized agent to exercise your rights, we may deny a request if the authorized agent does not submit proof that they have been validly authorized to act on your behalf.

Verification process

We may request that you provide additional information reasonably necessary to verify you and your consumer's request. If you submit the request through an authorized agent, we may need to collect additional information to verify your identity before processing your request.

Upon receiving your request, we will respond without undue delay, but in all cases, within forty-five (45) days of receipt. The response period may be extended once by forty-five (45) additional days when reasonably necessary. We will inform you of any such extension within the initial 45-day response period, together with the reason for the extension.

Right to appeal

If we decline to take action regarding your request, we will inform you of our decision and reasoning behind it. If you wish to appeal our decision, please email us at support@mobile-app.store. Within sixty (60) days of receipt of an appeal, we will inform you in writing of any action taken or not taken in response to the appeal, including a written explanation of the reasons for the decisions. If your appeal is denied, you may contact the Attorney General to submit a complaint.

11. DO WE MAKE UPDATES TO THIS NOTICE?

In Short: Yes, we will update this notice as necessary to stay compliant with relevant laws.

We may update this privacy notice from time to time. The updated version will be indicated by an updated "Revised" date and the updated version will be effective as soon as it is accessible. If we make material changes to this privacy notice, we may notify you either by prominently posting a notice of such changes or by directly sending you a notification. We encourage you to review this privacy notice frequently to be informed of how we are protecting your information.

12. HOW CAN YOU CONTACT US ABOUT THIS NOTICE?

If you have questions or comments about this notice, you may email us at support@mobile-app.store or contact us by post at:

Mobile-App
__________
__________, MA
United States

13. HOW CAN YOU REVIEW, UPDATE, OR DELETE THE DATA WE COLLECT FROM YOU?

Based on the applicable laws of your country, you may have the right to request access to the personal information we collect from you, change that information, or delete it. To request to review, update, or delete your personal information, please visit: __________.
-
- - - \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/.DS_Store b/walletintaleq.intaleq.xyz/v2/main/ride/.DS_Store deleted file mode 100644 index d6c510d..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/ride/.DS_Store and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/driver/ecash_verify.php b/walletintaleq.intaleq.xyz/v2/main/ride/ecash/driver/ecash_verify.php deleted file mode 100755 index ffd76b2..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/driver/ecash_verify.php +++ /dev/null @@ -1,148 +0,0 @@ -prepare("INSERT INTO payment_tokens (token, driverID, dateCreated, amount) VALUES (:token, :driverID, NOW(), :amount)"); - $stmt->execute([':token' => $token, ':driverID' => $driverId, ':amount' => $amount]); - return $stmt->rowCount() > 0 ? $token : null; -} - -/** - * تسجيل دفعة في جدول النقاط وإعادة المعرف الخاص بها - * Logs a payment in the points table and returns its ID. - */ -function generatePaymentID($con, $driverId, $amount, $method): ?string -{ - $stmt = $con->prepare("INSERT INTO paymentsDriverPoints (`amount`, `payment_method`, `driverID`) VALUES (:amount, :method, :driverID)"); - $stmt->execute([':driverID' => $driverId, ':amount' => $amount, ':method' => $method]); - return $stmt->rowCount() > 0 ? $con->lastInsertId() : null; -} - - -// ------------------------------------------------- -// المنطق الرئيسي للمعالجة -// Main processing logic -// ------------------------------------------------- - -// 1. استقبال الرقم المرجعي من الرابط -// 1. Receive the order reference from the URL. -$orderRef = $_GET['orderRef'] ?? null; -if (empty($orderRef)) { - echo "

خطأ: الرقم المرجعي للطلب مفقود.

"; - exit; -} - -// 2. الانتظار والتأكد من وصول الـ Webhook -// 2. Wait and verify that the webhook has updated the status. -$payment = null; -$max_attempts = 5; // محاولة لمدة 10 ثوانٍ - Poll for 10 seconds -for ($attempts = 0; $attempts < $max_attempts; $attempts++) { - // تأكد من أن اسم الجدول صحيح - // Make sure the table name is correct. - $stmt = $con->prepare("SELECT * FROM `paymentsLogSyriaDriver` WHERE order_ref = :order_ref AND status = 1 LIMIT 1"); - $stmt->execute([':order_ref' => $orderRef]); - $payment = $stmt->fetch(PDO::FETCH_ASSOC); - - if ($payment) { - break; // تم العثور على الدفعة الناجحة - Successful payment found - } - sleep(2); // الانتظار لمدة ثانيتين قبل المحاولة التالية - Wait 2 seconds before retrying -} - -// 3. التحقق من نتيجة البحث -// 3. Check the polling result. -if (!$payment) { - echo "

خطأ في تأكيد الدفع

لم نتمكن من تأكيد دفعتك. قد تستغرق العملية بضع لحظات. يرجى التحقق من رصيدك في التطبيق لاحقاً أو التواصل مع الدعم الفني.

"; - exit; -} - -// 4. تمت عملية الدفع بنجاح، لنقم بإضافة الرصيد -// 4. Payment successful, proceed to add balance. -try { - $driverId = $payment['user_id']; - // eCash لا تحتاج للقسمة على 100 - // eCash amount does not need division by 100. - $originalAmount = floatval($payment['amount']); - $paymentMethod = $payment['payment_method'] ?? 'ecash'; - - // حساب المكافأة - // Calculate the bonus. - $bonusAmount = match ((int)$originalAmount) { - 80 => 80.0, - 200 => 215.0, - 400 => 450.0, - 1000 => 1140.0, - default => $originalAmount, - }; - - // --- تنفيذ منطق تحديث المحافظ --- - // --- Execute wallet update logic --- - - $tokenDriver = generateToken($con, $driverId, $bonusAmount); - if (!$tokenDriver) throw new Exception('Failed to generate token for driver wallet.'); - - $tokenSefer = generateToken($con, $driverId, $originalAmount); - if (!$tokenSefer) throw new Exception('Failed to generate token for sefer wallet.'); - - $paymentID = generatePaymentID($con, $driverId, $bonusAmount, $paymentMethod); - if (!$paymentID) throw new Exception('Failed to generate payment ID.'); - - // إضافة الرصيد إلى driverWallet - // Add balance to driverWallet - $insertDriver = $con->prepare("INSERT INTO driverWallet (driverID, paymentID, amount, paymentMethod) VALUES (:driverID, :paymentID, :amount, :paymentMethod)"); - $insertDriver->execute([':driverID' => $driverId, ':paymentID' => $paymentID, ':amount' => $bonusAmount, ':paymentMethod' => $paymentMethod]); - if ($insertDriver->rowCount() === 0) throw new Exception('Failed to insert into driverWallet.'); - - $markTokenDriver = $con->prepare("UPDATE payment_tokens SET isUsed = TRUE WHERE token = :token"); - $markTokenDriver->execute([':token' => $tokenDriver]); - - // إضافة الرصيد إلى seferWallet - // Add balance to seferWallet - $insertSefer = $con->prepare("INSERT INTO seferWallet (driverId, passengerId, amount, paymentMethod, token, createdAt) VALUES (:driverId, :passengerId, :amount, :paymentMethod, :token, CURRENT_TIMESTAMP)"); - $insertSefer->execute([':driverId' => $driverId, ':passengerId' => 'driver', ':amount' => $originalAmount, ':paymentMethod' => $paymentMethod, ':token' => $tokenSefer]); - - $markTokenSefer = $con->prepare("UPDATE payment_tokens SET isUsed = TRUE WHERE token = :token"); - $markTokenSefer->execute([':token' => $tokenSefer]); - - // 5. عرض صفحة النجاح النهائية - // 5. Display final success page. - echo "

تمت العملية بنجاح

تمت إضافة الرصيد إلى محفظتك. يمكنك الآن العودة إلى التطبيق.

"; - -} catch (Throwable $e) { - // في حال حدوث خطأ، يتم تسجيله وعرض رسالة للمستخدم - // In case of an error, log it and display a message to the user. - error_log("VERIFY_ERROR: " . $e->getMessage() . " | OrderRef: " . $orderRef); - echo "

حدث خطأ

لقد تم استلام دفعتك بنجاح، ولكن حدث خطأ أثناء تحديث رصيدك. يرجى التواصل مع الدعم الفني وتزويدهم بالرقم المرجعي: " . htmlspecialchars($orderRef) . "

"; -} - -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/driver/ecash_webhook.php b/walletintaleq.intaleq.xyz/v2/main/ride/ecash/driver/ecash_webhook.php deleted file mode 100755 index 72e30de..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/driver/ecash_webhook.php +++ /dev/null @@ -1,91 +0,0 @@ -prepare( - "UPDATE `paymentsLogSyriaDriver` SET status = :status, updated_at = NOW() WHERE order_ref = :order_ref AND status = 2" - ); - $stmt->execute([ - ':status' => $payment_status, - - ':order_ref' => $orderRef - ]); - - if ($stmt->rowCount() > 0) { - http_response_code(200); - file_put_contents($log_file, "SUCCESS: Database updated." . PHP_EOL, FILE_APPEND); - } else { - http_response_code(200); - file_put_contents($log_file, "INFO: Order not found or already processed." . PHP_EOL, FILE_APPEND); - } - -} catch (PDOException $e) { - http_response_code(500); - file_put_contents($log_file, "FATAL: Database update failed: " . $e->getMessage() . PHP_EOL, FILE_APPEND); -} -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/driver/finalize_payment.php b/walletintaleq.intaleq.xyz/v2/main/ride/ecash/driver/finalize_payment.php deleted file mode 100755 index 8507840..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/driver/finalize_payment.php +++ /dev/null @@ -1,79 +0,0 @@ -prepare( - "SELECT * FROM `paymentsLogSyria` - WHERE user_id = :user_id - AND status = 1 - AND updated_at >= DATE_SUB(NOW(), INTERVAL 5 MINUTE) - ORDER BY updated_at DESC - LIMIT 1" - ); - $stmt->bindParam(':user_id', $userId, PDO::PARAM_STR); - $stmt->execute(); - $payment = $stmt->fetch(PDO::FETCH_ASSOC); - - if (!$payment) { - printFailure("لم يتم العثور على دفعة ناجحة حديثة."); - exit; - } - - // خطوة 2: الحصول على المبلغ (لا يحتاج للقسمة على 100) - $amount = $payment['amount']; - - // خطوة 3: حساب المكافأة - $finalAmount = calculateBonus($amount); // استخدم دالة حساب المكافآت الخاصة بك - - $passengerId = $userId; // نفترض أن معرّف المستخدم هو نفسه معرّف الراكب - - // --- هنا تضع نفس منطق إضافة الرصيد الذي كان في ملف payment_verify.php القديم --- - // (مثال) - // $token = generatePaymentToken($passengerId, $finalAmount); - // addToPassengerWallet($passengerId, $finalAmount, $token); - // ... إلخ - - // --- النجاح النهائي --- - printSuccess("تمت معالجة الدفع وتحديث الرصيد بنجاح."); - -} catch (PDOException $e) { - error_log("Finalize Payment Error: " . $e->getMessage()); - printFailure("حدث خطأ في قاعدة البيانات أثناء إتمام العملية."); -} - -// --- يمكنك وضع دوال المساعدة هنا (calculateBonus, etc.) --- -function calculateBonus($amount) { - $result = $amount; - if ($amount == 200) $result = 215; - else if ($amount == 400) $result = 450; - else if ($amount == 100) $result = 100.0; - else if ($amount == 1000) $result = 1140; - return $result; -} -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/driver/payWithEcash.php b/walletintaleq.intaleq.xyz/v2/main/ride/ecash/driver/payWithEcash.php deleted file mode 100755 index c059bce..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/driver/payWithEcash.php +++ /dev/null @@ -1,88 +0,0 @@ -prepare( - "INSERT INTO `paymentsLogSyriaDriver`( `user_id`, `amount`, `status`, `order_ref`, `payment_method`, `created_at`) - VALUES (:user_id, :amount, 2, :order_ref,'ecash-driver', NOW())" - ); - $stmt->execute([ - ':user_id' => $driverId, - ':amount' => $amount, - ':order_ref' => $orderRef - ]); -} catch (PDOException $e) { - error_log("eCash - فشل تسجيل الدفعة المبدئية: " . $e->getMessage()); - printFailure("حدث خطأ أثناء بدء عملية الدفع. يرجى المحاولة مرة أخرى."); - exit; -} - -// --- إعادة رابط الدفع إلى تطبيق فلاتر --- -// التطبيق سيستقبل هذا الرابط ويفتحه في WebView -// نرسل الرابط داخل حقل 'message' كما يتوقع كود فلاتر -printSuccess($paymentUrl); - -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/driver/webhook_connect.php b/walletintaleq.intaleq.xyz/v2/main/ride/ecash/driver/webhook_connect.php deleted file mode 100755 index 2615948..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/driver/webhook_connect.php +++ /dev/null @@ -1,42 +0,0 @@ - false, - PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, - PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, - PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES UTF8" - ]; - $user = getenv('USER'); - $pass = getenv('PASS'); - $con = new PDO($dsn, $user, $pass, $options); - -} catch (PDOException $e) { - error_log("Webhook DB Connection Error: " . $e->getMessage()); - http_response_code(500); - echo json_encode(['error' => 'Internal Server Error']); - exit; -} -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/ecash_config.php b/walletintaleq.intaleq.xyz/v2/main/ride/ecash/ecash_config.php deleted file mode 100755 index f81532b..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/ecash_config.php +++ /dev/null @@ -1,44 +0,0 @@ - 'error', 'message' => 'Payment gateway not configured correctly.']); - exit; -} -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/logs/ecash_production.log b/walletintaleq.intaleq.xyz/v2/main/ride/ecash/logs/ecash_production.log deleted file mode 100644 index 9ef6d7a..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/logs/ecash_production.log +++ /dev/null @@ -1,264 +0,0 @@ ---- NEW WEBHOOK --- -2025-07-21 17:33:55 - RAW BODY: {"IsSuccess":true,"Message":null,"OrderRef":"tripz_109270481246447459618_1753108408","TransactionNo":"2515118257","Amount":"10000.00","Token":"386BBEDFFA3FBCEFCCF7F546FB4BC622"} -VERIFICATION STRING: UOMACVPA8BQ8U99BRDDONSLAKW2IDSLBTCQFR776E8L55C0DLBYFB6NJJOWJ7FOLWEYQE2251511825710000.00tripz_109270481246447459618_1753108408 - - Merchant ID Used: UOMACV - - TransactionNo Used: 2515118257 - - Amount Used: 10000.00 - - OrderRef Used: tripz_109270481246447459618_1753108408 -CALCULATED TOKEN: 386BBEDFFA3FBCEFCCF7F546FB4BC622 -RECEIVED TOKEN: 386BBEDFFA3FBCEFCCF7F546FB4BC622 -TOKEN MATCH! Proceeding to update database. -FATAL: Database update failed: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'payment_id' in 'field list' ---- NEW WEBHOOK --- -2025-07-21 17:34:00 - RAW BODY: {"IsSuccess":true,"Message":null,"OrderRef":"tripz_109270481246447459618_1753108408","TransactionNo":"2515118257","Amount":"10000.00","Token":"386BBEDFFA3FBCEFCCF7F546FB4BC622"} -VERIFICATION STRING: UOMACVPA8BQ8U99BRDDONSLAKW2IDSLBTCQFR776E8L55C0DLBYFB6NJJOWJ7FOLWEYQE2251511825710000.00tripz_109270481246447459618_1753108408 - - Merchant ID Used: UOMACV - - TransactionNo Used: 2515118257 - - Amount Used: 10000.00 - - OrderRef Used: tripz_109270481246447459618_1753108408 -CALCULATED TOKEN: 386BBEDFFA3FBCEFCCF7F546FB4BC622 -RECEIVED TOKEN: 386BBEDFFA3FBCEFCCF7F546FB4BC622 -TOKEN MATCH! Proceeding to update database. -FATAL: Database update failed: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'payment_id' in 'field list' ---- NEW WEBHOOK --- -2025-07-21 17:34:05 - RAW BODY: {"IsSuccess":true,"Message":null,"OrderRef":"tripz_109270481246447459618_1753108408","TransactionNo":"2515118257","Amount":"10000.00","Token":"386BBEDFFA3FBCEFCCF7F546FB4BC622"} -VERIFICATION STRING: UOMACVPA8BQ8U99BRDDONSLAKW2IDSLBTCQFR776E8L55C0DLBYFB6NJJOWJ7FOLWEYQE2251511825710000.00tripz_109270481246447459618_1753108408 - - Merchant ID Used: UOMACV - - TransactionNo Used: 2515118257 - - Amount Used: 10000.00 - - OrderRef Used: tripz_109270481246447459618_1753108408 -CALCULATED TOKEN: 386BBEDFFA3FBCEFCCF7F546FB4BC622 -RECEIVED TOKEN: 386BBEDFFA3FBCEFCCF7F546FB4BC622 -TOKEN MATCH! Proceeding to update database. -FATAL: Database update failed: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'payment_id' in 'field list' ---- NEW WEBHOOK --- -2025-07-21 17:34:11 - RAW BODY: {"IsSuccess":true,"Message":null,"OrderRef":"tripz_109270481246447459618_1753108408","TransactionNo":"2515118257","Amount":"10000.00","Token":"386BBEDFFA3FBCEFCCF7F546FB4BC622"} -VERIFICATION STRING: UOMACVPA8BQ8U99BRDDONSLAKW2IDSLBTCQFR776E8L55C0DLBYFB6NJJOWJ7FOLWEYQE2251511825710000.00tripz_109270481246447459618_1753108408 - - Merchant ID Used: UOMACV - - TransactionNo Used: 2515118257 - - Amount Used: 10000.00 - - OrderRef Used: tripz_109270481246447459618_1753108408 -CALCULATED TOKEN: 386BBEDFFA3FBCEFCCF7F546FB4BC622 -RECEIVED TOKEN: 386BBEDFFA3FBCEFCCF7F546FB4BC622 -TOKEN MATCH! Proceeding to update database. -FATAL: Database update failed: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'payment_id' in 'field list' ---- NEW WEBHOOK --- -2025-07-21 17:34:16 - RAW BODY: {"IsSuccess":true,"Message":null,"OrderRef":"tripz_109270481246447459618_1753108408","TransactionNo":"2515118257","Amount":"10000.00","Token":"386BBEDFFA3FBCEFCCF7F546FB4BC622"} -VERIFICATION STRING: UOMACVPA8BQ8U99BRDDONSLAKW2IDSLBTCQFR776E8L55C0DLBYFB6NJJOWJ7FOLWEYQE2251511825710000.00tripz_109270481246447459618_1753108408 - - Merchant ID Used: UOMACV - - TransactionNo Used: 2515118257 - - Amount Used: 10000.00 - - OrderRef Used: tripz_109270481246447459618_1753108408 -CALCULATED TOKEN: 386BBEDFFA3FBCEFCCF7F546FB4BC622 -RECEIVED TOKEN: 386BBEDFFA3FBCEFCCF7F546FB4BC622 -TOKEN MATCH! Proceeding to update database. -FATAL: Database update failed: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'payment_id' in 'field list' ---- NEW WEBHOOK --- -2025-07-21 17:38:33 - RAW BODY: {"IsSuccess":true,"Message":null,"OrderRef":"tripz_109270481246447459618_1753108680","TransactionNo":"3434918048","Amount":"2000.00","Token":"5E397F3BCFC8DBC277E67BBE909A4C25"} -VERIFICATION STRING: UOMACVPA8BQ8U99BRDDONSLAKW2IDSLBTCQFR776E8L55C0DLBYFB6NJJOWJ7FOLWEYQE234349180482000.00tripz_109270481246447459618_1753108680 - - Merchant ID Used: UOMACV - - TransactionNo Used: 3434918048 - - Amount Used: 2000.00 - - OrderRef Used: tripz_109270481246447459618_1753108680 -CALCULATED TOKEN: 5E397F3BCFC8DBC277E67BBE909A4C25 -RECEIVED TOKEN: 5E397F3BCFC8DBC277E67BBE909A4C25 -TOKEN MATCH! Proceeding to update database. -FATAL: Database update failed: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'payment_id' in 'field list' ---- NEW WEBHOOK --- -2025-07-21 17:38:38 - RAW BODY: {"IsSuccess":true,"Message":null,"OrderRef":"tripz_109270481246447459618_1753108680","TransactionNo":"3434918048","Amount":"2000.00","Token":"5E397F3BCFC8DBC277E67BBE909A4C25"} -VERIFICATION STRING: UOMACVPA8BQ8U99BRDDONSLAKW2IDSLBTCQFR776E8L55C0DLBYFB6NJJOWJ7FOLWEYQE234349180482000.00tripz_109270481246447459618_1753108680 - - Merchant ID Used: UOMACV - - TransactionNo Used: 3434918048 - - Amount Used: 2000.00 - - OrderRef Used: tripz_109270481246447459618_1753108680 -CALCULATED TOKEN: 5E397F3BCFC8DBC277E67BBE909A4C25 -RECEIVED TOKEN: 5E397F3BCFC8DBC277E67BBE909A4C25 -TOKEN MATCH! Proceeding to update database. -FATAL: Database update failed: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'payment_id' in 'field list' ---- NEW WEBHOOK --- -2025-07-21 17:38:44 - RAW BODY: {"IsSuccess":true,"Message":null,"OrderRef":"tripz_109270481246447459618_1753108680","TransactionNo":"3434918048","Amount":"2000.00","Token":"5E397F3BCFC8DBC277E67BBE909A4C25"} -VERIFICATION STRING: UOMACVPA8BQ8U99BRDDONSLAKW2IDSLBTCQFR776E8L55C0DLBYFB6NJJOWJ7FOLWEYQE234349180482000.00tripz_109270481246447459618_1753108680 - - Merchant ID Used: UOMACV - - TransactionNo Used: 3434918048 - - Amount Used: 2000.00 - - OrderRef Used: tripz_109270481246447459618_1753108680 -CALCULATED TOKEN: 5E397F3BCFC8DBC277E67BBE909A4C25 -RECEIVED TOKEN: 5E397F3BCFC8DBC277E67BBE909A4C25 -TOKEN MATCH! Proceeding to update database. -FATAL: Database update failed: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'payment_id' in 'field list' ---- NEW WEBHOOK --- -2025-07-21 17:38:49 - RAW BODY: {"IsSuccess":true,"Message":null,"OrderRef":"tripz_109270481246447459618_1753108680","TransactionNo":"3434918048","Amount":"2000.00","Token":"5E397F3BCFC8DBC277E67BBE909A4C25"} -VERIFICATION STRING: UOMACVPA8BQ8U99BRDDONSLAKW2IDSLBTCQFR776E8L55C0DLBYFB6NJJOWJ7FOLWEYQE234349180482000.00tripz_109270481246447459618_1753108680 - - Merchant ID Used: UOMACV - - TransactionNo Used: 3434918048 - - Amount Used: 2000.00 - - OrderRef Used: tripz_109270481246447459618_1753108680 -CALCULATED TOKEN: 5E397F3BCFC8DBC277E67BBE909A4C25 -RECEIVED TOKEN: 5E397F3BCFC8DBC277E67BBE909A4C25 -TOKEN MATCH! Proceeding to update database. -FATAL: Database update failed: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'payment_id' in 'field list' ---- NEW WEBHOOK --- -2025-07-21 17:38:54 - RAW BODY: {"IsSuccess":true,"Message":null,"OrderRef":"tripz_109270481246447459618_1753108680","TransactionNo":"3434918048","Amount":"2000.00","Token":"5E397F3BCFC8DBC277E67BBE909A4C25"} -VERIFICATION STRING: UOMACVPA8BQ8U99BRDDONSLAKW2IDSLBTCQFR776E8L55C0DLBYFB6NJJOWJ7FOLWEYQE234349180482000.00tripz_109270481246447459618_1753108680 - - Merchant ID Used: UOMACV - - TransactionNo Used: 3434918048 - - Amount Used: 2000.00 - - OrderRef Used: tripz_109270481246447459618_1753108680 -CALCULATED TOKEN: 5E397F3BCFC8DBC277E67BBE909A4C25 -RECEIVED TOKEN: 5E397F3BCFC8DBC277E67BBE909A4C25 -TOKEN MATCH! Proceeding to update database. -FATAL: Database update failed: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'payment_id' in 'field list' ---- NEW WEBHOOK --- -2025-07-21 17:43:55 - RAW BODY: {"IsSuccess":true,"Message":null,"OrderRef":"tripz_109270481246447459618_1753109008","TransactionNo":"2925347460","Amount":"2000.00","Token":"16EC668D7C9A4105D464BC925D0F35B3"} -VERIFICATION STRING: UOMACVPA8BQ8U99BRDDONSLAKW2IDSLBTCQFR776E8L55C0DLBYFB6NJJOWJ7FOLWEYQE229253474602000.00tripz_109270481246447459618_1753109008 - - Merchant ID Used: UOMACV - - TransactionNo Used: 2925347460 - - Amount Used: 2000.00 - - OrderRef Used: tripz_109270481246447459618_1753109008 -CALCULATED TOKEN: 16EC668D7C9A4105D464BC925D0F35B3 -RECEIVED TOKEN: 16EC668D7C9A4105D464BC925D0F35B3 -TOKEN MATCH! Proceeding to update database. -FATAL: Database update failed: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'updated_at' in 'field list' ---- NEW WEBHOOK --- -2025-07-21 17:44:00 - RAW BODY: {"IsSuccess":true,"Message":null,"OrderRef":"tripz_109270481246447459618_1753109008","TransactionNo":"2925347460","Amount":"2000.00","Token":"16EC668D7C9A4105D464BC925D0F35B3"} -VERIFICATION STRING: UOMACVPA8BQ8U99BRDDONSLAKW2IDSLBTCQFR776E8L55C0DLBYFB6NJJOWJ7FOLWEYQE229253474602000.00tripz_109270481246447459618_1753109008 - - Merchant ID Used: UOMACV - - TransactionNo Used: 2925347460 - - Amount Used: 2000.00 - - OrderRef Used: tripz_109270481246447459618_1753109008 -CALCULATED TOKEN: 16EC668D7C9A4105D464BC925D0F35B3 -RECEIVED TOKEN: 16EC668D7C9A4105D464BC925D0F35B3 -TOKEN MATCH! Proceeding to update database. -FATAL: Database update failed: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'updated_at' in 'field list' ---- NEW WEBHOOK --- -2025-07-21 17:44:06 - RAW BODY: {"IsSuccess":true,"Message":null,"OrderRef":"tripz_109270481246447459618_1753109008","TransactionNo":"2925347460","Amount":"2000.00","Token":"16EC668D7C9A4105D464BC925D0F35B3"} -VERIFICATION STRING: UOMACVPA8BQ8U99BRDDONSLAKW2IDSLBTCQFR776E8L55C0DLBYFB6NJJOWJ7FOLWEYQE229253474602000.00tripz_109270481246447459618_1753109008 - - Merchant ID Used: UOMACV - - TransactionNo Used: 2925347460 - - Amount Used: 2000.00 - - OrderRef Used: tripz_109270481246447459618_1753109008 -CALCULATED TOKEN: 16EC668D7C9A4105D464BC925D0F35B3 -RECEIVED TOKEN: 16EC668D7C9A4105D464BC925D0F35B3 -TOKEN MATCH! Proceeding to update database. -FATAL: Database update failed: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'updated_at' in 'field list' ---- NEW WEBHOOK --- -2025-07-21 17:44:11 - RAW BODY: {"IsSuccess":true,"Message":null,"OrderRef":"tripz_109270481246447459618_1753109008","TransactionNo":"2925347460","Amount":"2000.00","Token":"16EC668D7C9A4105D464BC925D0F35B3"} -VERIFICATION STRING: UOMACVPA8BQ8U99BRDDONSLAKW2IDSLBTCQFR776E8L55C0DLBYFB6NJJOWJ7FOLWEYQE229253474602000.00tripz_109270481246447459618_1753109008 - - Merchant ID Used: UOMACV - - TransactionNo Used: 2925347460 - - Amount Used: 2000.00 - - OrderRef Used: tripz_109270481246447459618_1753109008 -CALCULATED TOKEN: 16EC668D7C9A4105D464BC925D0F35B3 -RECEIVED TOKEN: 16EC668D7C9A4105D464BC925D0F35B3 -TOKEN MATCH! Proceeding to update database. -FATAL: Database update failed: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'updated_at' in 'field list' ---- NEW WEBHOOK --- -2025-07-21 17:44:16 - RAW BODY: {"IsSuccess":true,"Message":null,"OrderRef":"tripz_109270481246447459618_1753109008","TransactionNo":"2925347460","Amount":"2000.00","Token":"16EC668D7C9A4105D464BC925D0F35B3"} -VERIFICATION STRING: UOMACVPA8BQ8U99BRDDONSLAKW2IDSLBTCQFR776E8L55C0DLBYFB6NJJOWJ7FOLWEYQE229253474602000.00tripz_109270481246447459618_1753109008 - - Merchant ID Used: UOMACV - - TransactionNo Used: 2925347460 - - Amount Used: 2000.00 - - OrderRef Used: tripz_109270481246447459618_1753109008 -CALCULATED TOKEN: 16EC668D7C9A4105D464BC925D0F35B3 -RECEIVED TOKEN: 16EC668D7C9A4105D464BC925D0F35B3 -TOKEN MATCH! Proceeding to update database. -FATAL: Database update failed: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'updated_at' in 'field list' ---- NEW WEBHOOK --- -2025-07-21 17:51:29 - RAW BODY: {"IsSuccess":true,"Message":null,"OrderRef":"tripz_109270481246447459618_1753109456","TransactionNo":"2487921821","Amount":"2000.00","Token":"1EA870532F15308A41780C06AC852C33"} -VERIFICATION STRING: UOMACVPA8BQ8U99BRDDONSLAKW2IDSLBTCQFR776E8L55C0DLBYFB6NJJOWJ7FOLWEYQE224879218212000.00tripz_109270481246447459618_1753109456 - - Merchant ID Used: UOMACV - - TransactionNo Used: 2487921821 - - Amount Used: 2000.00 - - OrderRef Used: tripz_109270481246447459618_1753109456 -CALCULATED TOKEN: 1EA870532F15308A41780C06AC852C33 -RECEIVED TOKEN: 1EA870532F15308A41780C06AC852C33 -TOKEN MATCH! Proceeding to update database. -SUCCESS: Database updated. ---- NEW WEBHOOK --- -2025-07-21 18:54:15 - RAW BODY: {"IsSuccess":true,"Message":null,"OrderRef":"tripz_109270481246447459618_1753113200","TransactionNo":"1725092256","Amount":"2000.00","Token":"983B8B9FDA5947CEE1D16D6ECC29FAF9"} -VERIFICATION STRING: UOMACVPA8BQ8U99BRDDONSLAKW2IDSLBTCQFR776E8L55C0DLBYFB6NJJOWJ7FOLWEYQE217250922562000.00tripz_109270481246447459618_1753113200 - - Merchant ID Used: UOMACV - - TransactionNo Used: 1725092256 - - Amount Used: 2000.00 - - OrderRef Used: tripz_109270481246447459618_1753113200 -CALCULATED TOKEN: 983B8B9FDA5947CEE1D16D6ECC29FAF9 -RECEIVED TOKEN: 983B8B9FDA5947CEE1D16D6ECC29FAF9 -TOKEN MATCH! Proceeding to update database. -SUCCESS: Database updated. ---- NEW WEBHOOK --- -2025-07-21 19:06:34 - RAW BODY: {"IsSuccess":true,"Message":null,"OrderRef":"tripz_109270481246447459618_1753113966","TransactionNo":"1477094275","Amount":"2000.00","Token":"01AF3E8E7C921FF72ADB09300971F2D2"} -VERIFICATION STRING: UOMACVPA8BQ8U99BRDDONSLAKW2IDSLBTCQFR776E8L55C0DLBYFB6NJJOWJ7FOLWEYQE214770942752000.00tripz_109270481246447459618_1753113966 - - Merchant ID Used: UOMACV - - TransactionNo Used: 1477094275 - - Amount Used: 2000.00 - - OrderRef Used: tripz_109270481246447459618_1753113966 -CALCULATED TOKEN: 01AF3E8E7C921FF72ADB09300971F2D2 -RECEIVED TOKEN: 01AF3E8E7C921FF72ADB09300971F2D2 -TOKEN MATCH! Proceeding to update database. -SUCCESS: Database updated. ---- NEW WEBHOOK --- -2025-07-21 19:15:57 - RAW BODY: {"IsSuccess":true,"Message":null,"OrderRef":"tripz_109270481246447459618_1753114529","TransactionNo":"746605967","Amount":"2000.00","Token":"7102931A8851540F14F4E259751EA776"} -VERIFICATION STRING: UOMACVPA8BQ8U99BRDDONSLAKW2IDSLBTCQFR776E8L55C0DLBYFB6NJJOWJ7FOLWEYQE27466059672000.00tripz_109270481246447459618_1753114529 - - Merchant ID Used: UOMACV - - TransactionNo Used: 746605967 - - Amount Used: 2000.00 - - OrderRef Used: tripz_109270481246447459618_1753114529 -CALCULATED TOKEN: 7102931A8851540F14F4E259751EA776 -RECEIVED TOKEN: 7102931A8851540F14F4E259751EA776 -TOKEN MATCH! Proceeding to update database. -SUCCESS: Database updated. ---- NEW WEBHOOK --- -2025-07-21 19:20:54 - RAW BODY: {"IsSuccess":true,"Message":null,"OrderRef":"tripz_109270481246447459618_1753114829","TransactionNo":"10119078","Amount":"2000.00","Token":"11DEB7F0AA5121F048E94CF385D5FC3D"} -VERIFICATION STRING: UOMACVPA8BQ8U99BRDDONSLAKW2IDSLBTCQFR776E8L55C0DLBYFB6NJJOWJ7FOLWEYQE2101190782000.00tripz_109270481246447459618_1753114829 - - Merchant ID Used: UOMACV - - TransactionNo Used: 10119078 - - Amount Used: 2000.00 - - OrderRef Used: tripz_109270481246447459618_1753114829 -CALCULATED TOKEN: 11DEB7F0AA5121F048E94CF385D5FC3D -RECEIVED TOKEN: 11DEB7F0AA5121F048E94CF385D5FC3D -TOKEN MATCH! Proceeding to update database. -SUCCESS: Database updated. ---- NEW WEBHOOK --- -2025-07-21 19:23:26 - RAW BODY: {"IsSuccess":true,"Message":null,"OrderRef":"tripz_109270481246447459618_1753114985","TransactionNo":"532601241","Amount":"2000.00","Token":"18DCD7E952332EB655B036B0C76EEDC7"} -VERIFICATION STRING: UOMACVPA8BQ8U99BRDDONSLAKW2IDSLBTCQFR776E8L55C0DLBYFB6NJJOWJ7FOLWEYQE25326012412000.00tripz_109270481246447459618_1753114985 - - Merchant ID Used: UOMACV - - TransactionNo Used: 532601241 - - Amount Used: 2000.00 - - OrderRef Used: tripz_109270481246447459618_1753114985 -CALCULATED TOKEN: 18DCD7E952332EB655B036B0C76EEDC7 -RECEIVED TOKEN: 18DCD7E952332EB655B036B0C76EEDC7 -TOKEN MATCH! Proceeding to update database. -SUCCESS: Database updated. ---- NEW WEBHOOK --- -2025-07-22 00:11:03 - RAW BODY: {"IsSuccess":true,"Message":null,"OrderRef":"tripz_14a51b422c9972299e109c7db5f65a2c_1753132198","TransactionNo":"947634072","Amount":"200000.00","Token":"E6811EE374F921257C45DC84CCCF48DC"} -VERIFICATION STRING: UOMACVPA8BQ8U99BRDDONSLAKW2IDSLBTCQFR776E8L55C0DLBYFB6NJJOWJ7FOLWEYQE2947634072200000.00tripz_14a51b422c9972299e109c7db5f65a2c_1753132198 - - Merchant ID Used: UOMACV - - TransactionNo Used: 947634072 - - Amount Used: 200000.00 - - OrderRef Used: tripz_14a51b422c9972299e109c7db5f65a2c_1753132198 -CALCULATED TOKEN: E6811EE374F921257C45DC84CCCF48DC -RECEIVED TOKEN: E6811EE374F921257C45DC84CCCF48DC -TOKEN MATCH! Proceeding to update database. -SUCCESS: Database updated. ---- NEW WEBHOOK --- -2025-07-22 00:17:06 - RAW BODY: {"IsSuccess":false,"Message":"OTP is not valid!","OrderRef":"tripz_14a51b422c9972299e109c7db5f65a2c_1753132598","TransactionNo":"1773754242","Amount":"200000.00","Token":"2654D3390FF25082FF5A8A1BA59D6CDA"} -VERIFICATION STRING: UOMACVPA8BQ8U99BRDDONSLAKW2IDSLBTCQFR776E8L55C0DLBYFB6NJJOWJ7FOLWEYQE21773754242200000.00tripz_14a51b422c9972299e109c7db5f65a2c_1753132598 - - Merchant ID Used: UOMACV - - TransactionNo Used: 1773754242 - - Amount Used: 200000.00 - - OrderRef Used: tripz_14a51b422c9972299e109c7db5f65a2c_1753132598 -CALCULATED TOKEN: 2654D3390FF25082FF5A8A1BA59D6CDA -RECEIVED TOKEN: 2654D3390FF25082FF5A8A1BA59D6CDA -TOKEN MATCH! Proceeding to update database. -SUCCESS: Database updated. ---- NEW WEBHOOK --- -2025-07-22 00:19:54 - RAW BODY: {"IsSuccess":true,"Message":null,"OrderRef":"tripz_14a51b422c9972299e109c7db5f65a2c_1753132768","TransactionNo":"1048082327","Amount":"100000.00","Token":"DCF7C2AEE0A81DB6C5F40C086E396928"} -VERIFICATION STRING: UOMACVPA8BQ8U99BRDDONSLAKW2IDSLBTCQFR776E8L55C0DLBYFB6NJJOWJ7FOLWEYQE21048082327100000.00tripz_14a51b422c9972299e109c7db5f65a2c_1753132768 - - Merchant ID Used: UOMACV - - TransactionNo Used: 1048082327 - - Amount Used: 100000.00 - - OrderRef Used: tripz_14a51b422c9972299e109c7db5f65a2c_1753132768 -CALCULATED TOKEN: DCF7C2AEE0A81DB6C5F40C086E396928 -RECEIVED TOKEN: DCF7C2AEE0A81DB6C5F40C086E396928 -TOKEN MATCH! Proceeding to update database. -SUCCESS: Database updated. diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/logs/payment_verification.log b/walletintaleq.intaleq.xyz/v2/main/ride/ecash/logs/payment_verification.log deleted file mode 100644 index 95bc263..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/logs/payment_verification.log +++ /dev/null @@ -1,9 +0,0 @@ -[2025-07-21 17:38:50] STEP VERIFY: لم يتم تأكيد الدفع بعد عدة محاولات | Data: {"orderRef":"tripz_109270481246447459618_1753108680"} -[2025-07-21 17:38:56] STEP VERIFY: لم يتم تأكيد الدفع بعد عدة محاولات | Data: {"orderRef":"tripz_109270481246447459618_1753108680"} -[2025-07-21 17:44:13] STEP VERIFY: لم يتم تأكيد الدفع بعد عدة محاولات | Data: {"orderRef":"tripz_109270481246447459618_1753109008"} -[2025-07-21 17:51:41] STEP VERIFY: اكتملت العملية بنجاح | Data: {"orderRef":"tripz_109270481246447459618_1753109456","userId":"109270481246447459618"} -[2025-07-21 19:06:39] STEP VERIFY: اكتملت العملية بنجاح | Data: {"orderRef":"tripz_109270481246447459618_1753113966","userId":"109270481246447459618"} -[2025-07-21 19:20:58] STEP VERIFY: اكتملت العملية بنجاح | Data: {"orderRef":"tripz_109270481246447459618_1753114829","userId":"109270481246447459618"} -[2025-07-21 19:23:30] STEP VERIFY: اكتملت العملية بنجاح | Data: {"orderRef":"tripz_109270481246447459618_1753114985","userId":"109270481246447459618"} -[2025-07-22 00:11:08] STEP VERIFY: اكتملت العملية بنجاح | Data: {"orderRef":"tripz_14a51b422c9972299e109c7db5f65a2c_1753132198","userId":"14a51b422c9972299e109c7db5f65a2c"} -[2025-07-22 00:20:01] STEP VERIFY: اكتملت العملية بنجاح | Data: {"orderRef":"tripz_14a51b422c9972299e109c7db5f65a2c_1753132768","userId":"14a51b422c9972299e109c7db5f65a2c"} diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/passenger/ecash_verify.php b/walletintaleq.intaleq.xyz/v2/main/ride/ecash/passenger/ecash_verify.php deleted file mode 100755 index be249f5..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/passenger/ecash_verify.php +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - <?= htmlspecialchars($title) ?> - - - -
-
-

-

-
- - - prepare("SELECT * FROM `paymentsLogSyria` WHERE order_ref = :order_ref AND status = 1 LIMIT 1"); - $stmt->execute([':order_ref' => $orderRef]); - $payment = $stmt->fetch(PDO::FETCH_ASSOC); - if ($payment) break; - sleep(2); -} - -if (!$payment) { - logError("VERIFY", "لم يتم تأكيد الدفع بعد عدة محاولات", ["orderRef" => $orderRef]); - showHTMLPage("error", "لم يتم تأكيد الدفع", "لم نتمكن من تأكيد دفعتك بعد. قد تستغرق العملية بضع لحظات. يرجى التحقق من رصيدك في التطبيق لاحقاً أو التواصل مع الدعم الفني."); -} - -try { - $userId = $payment['user_id']; - $amount = $payment['amount']; - $paymentMethod = $payment['payment_method'] ?? 'ecash'; - - $finalAmount = calculateBonus($amount); - - $token = generatePaymentToken($userId, $finalAmount); - if (!$token) throw new Exception("فشل إنشاء توكن محفظة الراكب"); - - $walletResult = addToPassengerWallet($userId, $finalAmount, $token); - if (!$walletResult || ($walletResult['status'] ?? 'fail') != "success") { - throw new Exception("فشل إضافة الرصيد لمحفظة الراكب"); - } - - $seferToken = generatePaymentToken($userId, $amount); - if (!$seferToken) throw new Exception("فشل إنشاء توكن محفظة سفر"); - - $seferWalletResult = addToSeferWallet($userId, $amount, $paymentMethod, $seferToken); - if (!$seferWalletResult || ($seferWalletResult['status'] ?? 'fail') != "success") { - throw new Exception("فشل إضافة الرصيد لمحفظة سفر"); - } - - logError("VERIFY", "اكتملت العملية بنجاح", ["orderRef" => $orderRef, "userId" => $userId]); - showHTMLPage("success", "تم الدفع بنجاح", "تمت إضافة الرصيد إلى محفظتك. شكرًا لاستخدامك Intaleq."); -} catch (Exception $e) { - logError("VERIFY_ERROR", $e->getMessage(), ["orderRef" => $orderRef]); - showHTMLPage("error", "حدث خطأ", "لقد تم استلام دفعتك بنجاح، ولكن حدث خطأ أثناء تحديث رصيدك. يرجى التواصل مع الدعم الفني وتزويدهم بالرقم المرجعي: " . htmlspecialchars($orderRef)); -} - -// --- دوال مساعدة --- - -function calculateBonus($amount) { - if ($amount == 200000) return 205000; - if ($amount == 400000) return 425000; - if ($amount == 1000000) return 1040000; - return $amount; -} - -function generatePaymentToken($passengerId, $amount) { - $url = BASE_URL . "/passengerWallet/addPaymentTokenPassenger.php"; - $postData = ['passengerId' => $passengerId, 'amount' => $amount]; - $ch = curl_init($url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData)); - $response = curl_exec($ch); - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - curl_close($ch); - if ($httpCode != 200) return null; - $data = json_decode($response, true); - return $data['message'] ?? null; -} - -function addToPassengerWallet($passengerId, $amount, $token) { - $url = BASE_URL . "/passengerWallet/add.php"; - $postData = ['passenger_id' => $passengerId, 'balance' => $amount, 'token' => $token]; - $ch = curl_init($url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData)); - $response = curl_exec($ch); - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - curl_close($ch); - if ($httpCode != 200) return null; - return json_decode($response, true); -} - -function addToSeferWallet($passengerId, $amount, $paymentMethod, $token) { - $url = BASE_URL . "/seferWallet/add.php"; - $postData = [ - 'amount' => $amount, - 'paymentMethod' => $paymentMethod, - 'passengerId' => $passengerId, - 'token' => $token, - 'driverId' => 'passenger' - ]; - $ch = curl_init($url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData)); - $response = curl_exec($ch); - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - curl_close($ch); - if ($httpCode != 200) return null; - return json_decode($response, true); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/passenger/ecash_webhook.php b/walletintaleq.intaleq.xyz/v2/main/ride/ecash/passenger/ecash_webhook.php deleted file mode 100755 index 00646b0..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/passenger/ecash_webhook.php +++ /dev/null @@ -1,91 +0,0 @@ -prepare( - "UPDATE `paymentsLogSyria` SET status = :status, updated_at = NOW() WHERE order_ref = :order_ref AND status = 2" - ); - $stmt->execute([ - ':status' => $payment_status, - - ':order_ref' => $orderRef - ]); - - if ($stmt->rowCount() > 0) { - http_response_code(200); - file_put_contents($log_file, "SUCCESS: Database updated." . PHP_EOL, FILE_APPEND); - } else { - http_response_code(200); - file_put_contents($log_file, "INFO: Order not found or already processed." . PHP_EOL, FILE_APPEND); - } - -} catch (PDOException $e) { - http_response_code(500); - file_put_contents($log_file, "FATAL: Database update failed: " . $e->getMessage() . PHP_EOL, FILE_APPEND); -} -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/passenger/finalize_payment.php b/walletintaleq.intaleq.xyz/v2/main/ride/ecash/passenger/finalize_payment.php deleted file mode 100755 index 58e7d12..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/passenger/finalize_payment.php +++ /dev/null @@ -1,79 +0,0 @@ -prepare( - "SELECT * FROM `paymentsLogSyria` - WHERE user_id = :user_id - AND status = 1 - AND updated_at >= DATE_SUB(NOW(), INTERVAL 5 MINUTE) - ORDER BY updated_at DESC - LIMIT 1" - ); - $stmt->bindParam(':user_id', $userId, PDO::PARAM_STR); - $stmt->execute(); - $payment = $stmt->fetch(PDO::FETCH_ASSOC); - - if (!$payment) { - printFailure("لم يتم العثور على دفعة ناجحة حديثة."); - exit; - } - - // خطوة 2: الحصول على المبلغ (لا يحتاج للقسمة على 100) - $amount = $payment['amount']; - - // خطوة 3: حساب المكافأة - $finalAmount = calculateBonus($amount); // استخدم دالة حساب المكافآت الخاصة بك - - $passengerId = $userId; // نفترض أن معرّف المستخدم هو نفسه معرّف الراكب - - // --- هنا تضع نفس منطق إضافة الرصيد الذي كان في ملف payment_verify.php القديم --- - // (مثال) - // $token = generatePaymentToken($passengerId, $finalAmount); - // addToPassengerWallet($passengerId, $finalAmount, $token); - // ... إلخ - - // --- النجاح النهائي --- - printSuccess("تمت معالجة الدفع وتحديث الرصيد بنجاح."); - -} catch (PDOException $e) { - error_log("Finalize Payment Error: " . $e->getMessage()); - printFailure("حدث خطأ في قاعدة البيانات أثناء إتمام العملية."); -} - -// --- يمكنك وضع دوال المساعدة هنا (calculateBonus, etc.) --- -function calculateBonus($amount) { - $result = $amount; - if ($amount == 500) return 530; - if ($amount == 1000) return 1070; - if ($amount == 2000) return 2180; - if ($amount == 5000) return 5700; - return $result; -} -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/passenger/payWithEcash.php b/walletintaleq.intaleq.xyz/v2/main/ride/ecash/passenger/payWithEcash.php deleted file mode 100755 index 25c07cd..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/passenger/payWithEcash.php +++ /dev/null @@ -1,88 +0,0 @@ -prepare( - "INSERT INTO `paymentsLogSyria`( `user_id`, `amount`, `status`, `order_ref`, `payment_method`, `created_at`) - VALUES (:user_id, :amount, 2, :order_ref,'ecash-passenger', NOW())" - ); - $stmt->execute([ - ':user_id' => $passengerId, - ':amount' => $amount, - ':order_ref' => $orderRef - ]); -} catch (PDOException $e) { - error_log("eCash - فشل تسجيل الدفعة المبدئية: " . $e->getMessage()); - printFailure("حدث خطأ أثناء بدء عملية الدفع. يرجى المحاولة مرة أخرى."); - exit; -} - -// --- إعادة رابط الدفع إلى تطبيق فلاتر --- -// التطبيق سيستقبل هذا الرابط ويفتحه في WebView -// نرسل الرابط داخل حقل 'message' كما يتوقع كود فلاتر -printSuccess($paymentUrl); - -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/passenger/webhook_connect.php b/walletintaleq.intaleq.xyz/v2/main/ride/ecash/passenger/webhook_connect.php deleted file mode 100755 index 2615948..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/passenger/webhook_connect.php +++ /dev/null @@ -1,42 +0,0 @@ - false, - PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, - PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, - PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES UTF8" - ]; - $user = getenv('USER'); - $pass = getenv('PASS'); - $con = new PDO($dsn, $user, $pass, $options); - -} catch (PDOException $e) { - error_log("Webhook DB Connection Error: " . $e->getMessage()); - http_response_code(500); - echo json_encode(['error' => 'Internal Server Error']); - exit; -} -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/payWithEcash.php b/walletintaleq.intaleq.xyz/v2/main/ride/ecash/payWithEcash.php deleted file mode 100755 index 06ea112..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/payWithEcash.php +++ /dev/null @@ -1,73 +0,0 @@ -user_id ?? null; -if (!$userId) { - printFailure("Authentication failed."); - exit; -} - -// 1. --- Create a unique order reference --- -$orderRef = 'INTALEQ_' . $userId . '_' . time(); - -// 2. --- Save the initial transaction to your database --- -// This step is CRITICAL for the webhook to work correctly. -// Create a table named 'ecash_transactions' with columns like: -// id, order_ref, user_id, passenger_id, amount, status, created_at, updated_at -try { - $stmt = $con->prepare( - "INSERT INTO ecash_transactions (order_ref, user_id, passenger_id, amount, status) VALUES (?, ?, ?, ?, 'pending')" - ); - $stmt->execute([$orderRef, $userId, $passengerId, $amount]); -} catch (PDOException $e) { - // Log the database error - error_log("ecash_initiate DB Error: " . $e->getMessage()); - printFailure("Failed to initiate payment transaction."); - exit; -} - -// 3. --- Generate the Verification Code (VC) --- -$stringToHash = ECASH_MERCHANT_ID . ECASH_MERCHANT_SECRET . $amount . $orderRef; -$verificationCode = strtoupper(md5($stringToHash)); - -// 4. --- Construct URLs --- -$redirectUrl = urlencode(APP_REDIRECT_URL_SUCCESS); -$callbackUrl = urlencode(APP_CALLBACK_URL); - -// 5. --- Build the Final Checkout URL --- -$checkoutUrl = sprintf( - "%s/Checkout/CardCheckout?tk=%s&mid=%s&vc=%s&c=%s&a=%s&lang=%s&or=%s&ru=%s&cu=%s", - ECASH_CHECKOUT_URL, - ECASH_TERMINAL_KEY, - ECASH_MERCHANT_ID, - $verificationCode, - ECASH_CURRENCY, - $amount, - ECASH_LANG, - $orderRef, - $redirectUrl, - $callbackUrl -); - -// 6. --- Return the URL to Flutter --- -printSuccess($checkoutUrl); - -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/webhook_ecash.php b/walletintaleq.intaleq.xyz/v2/main/ride/ecash/webhook_ecash.php deleted file mode 100755 index 148e8b7..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/ecash/webhook_ecash.php +++ /dev/null @@ -1,310 +0,0 @@ - - $raw_post_data]); - -$data = json_decode($raw_post_data, true); -if (!$data) { - logError("0.1", "Invalid JSON payload."); - http_response_code(400); - exit; -} - -// 2. Extract data and verify the token from ecash -$isSuccess = $data['isSuccess'] ?? null; -$orderRef = $data['orderRef'] ?? null; -$transactionNo = $data['transactionNo'] ?? null; -$amount = $data['amount'] ?? null; -$receivedToken = $data['token'] ?? ''; - -$string_to_hash = ECASH_MERCHANT_ID . ECASH_MERCHANT_SECRET . $transactionNo . $amount . $orderRef; -$expected_token = md5($string_to_hash); - -if (strcasecmp($expected_token, $receivedToken) !== 0) { - logError("1", "Token Mismatch", [ - "expected" => $expected_token, - "received" => $receivedToken, - "string" => $string_to_hash - ]); - http_response_code(401); // Unauthorized - exit; -} -logError("1", "Token Verified Successfully."); - -// 3. Check if payment was successful -if ($isSuccess !== true) { - logError("2", "Payment was not successful according to ecash.", $data); - // Optionally, update your database to mark the order as 'failed' - updateTransactionStatus($orderRef, 'failed', $transactionNo); - http_response_code(200); // Respond OK to ecash, but do nothing else - exit; -} -logError("2", "Payment reported as SUCCESS by ecash."); - -// 4. Find the original transaction in your database using the Order Reference -try { - $stmt = $con->prepare("SELECT * FROM ecash_transactions WHERE order_ref = ? LIMIT 1"); - $stmt->execute([$orderRef]); - $transaction = $stmt->fetch(PDO::FETCH_ASSOC); - - if (!$transaction) { - logError("3", "OrderRef not found in our database.", ["orderRef" => $orderRef]); - http_response_code(404); // Not Found - exit; - } - - // Security Check: Ensure this transaction hasn't already been processed - if ($transaction['status'] !== 'pending') { - logError("3.1", "Transaction already processed.", ["orderRef" => $orderRef, "status" => $transaction['status']]); - http_response_code(200); // Acknowledge receipt, but prevent double-spending - exit; - } - - $passengerId = $transaction['passenger_id']; - $paidAmount = $transaction['amount']; // Use the amount from your DB as the source of truth - logError("3", "Transaction found in DB.", ["passengerId" => $passengerId, "amount" => $paidAmount]); - - // 5. --- Start Wallet Update Logic (from your paymet_verfy.php) --- - - // Calculate bonus - $finalAmount = calculateBonus($paidAmount); - logError("4", "Bonus calculated.", ["original" => $paidAmount, "final" => $finalAmount]); - - // Add to Passenger Wallet - $passengerToken = generatePaymentToken($passengerId, $finalAmount); - if ($passengerToken) { - addToPassengerWallet($passengerId, $finalAmount, $passengerToken); - } - - // Add to Sefer Wallet - $paymentMethod = 'ecash'; // Or another identifier - addToSeferWallet($passengerId, $paidAmount, $paymentMethod); - - // 6. Mark the transaction as 'success' in your database to prevent reprocessing - updateTransactionStatus($orderRef, 'success', $transactionNo); - logError("7", "Process completed successfully."); - -} catch (PDOException $e) { - logError("DB_ERROR", "Database error: " . $e->getMessage()); - http_response_code(500); - exit; -} catch (Exception $e) { - logError("GENERAL_ERROR", "General error: " . $e->getMessage()); - http_response_code(500); - exit; -} - -// 7. Respond to ecash server -http_response_code(200); -echo "Webhook processed."; - - -// --- ALL HELPER FUNCTIONS FROM paymet_verfy.php --- - -function updateTransactionStatus($orderRef, $status, $transactionNo) { - global $con; - try { - $stmt = $con->prepare( - "UPDATE ecash_transactions SET status = ?, ecash_transaction_no = ?, updated_at = NOW() WHERE order_ref = ?" - ); - $stmt->execute([$status, $transactionNo, $orderRef]); - } catch (PDOException $e) { - logError("DB_UPDATE_ERROR", "Failed to update transaction status", ["error" => $e->getMessage()]); - } -} - - - - -function generatePaymentToken($passengerId, $amount) { - $url = BASE_URL . "/passengerWallet/addPaymentTokenPassenger.php"; - - $postData = [ - 'passengerId' => $passengerId, - 'amount' => $amount - ]; - - $ch = curl_init($url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData)); - - $response = curl_exec($ch); - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - $curlError = curl_error($ch); - curl_close($ch); - - if ($curlError) { - logError("4.1", "cURL error in token generation", [ - "error" => $curlError, - "url" => $url - ]); - return null; - } - - if ($httpCode != 200) { - logError("4.2", "HTTP error in token generation", [ - "http_code" => $httpCode, - "response" => $response - ]); - return null; - } - - $data = json_decode($response, true); - - if (!$data || !isset($data['message'])) { - logError("4.3", "Invalid response format in token generation", [ - "response" => $response - ]); - return null; - } - - return $data['message']; // ✅ Return token -} - -// 🎯 Function to add balance to passenger's wallet with error logging -function addToPassengerWallet($passengerId, $amount, $token) { - $url = BASE_URL . "/passengerWallet/add.php"; - - $postData = [ - 'passenger_id' => $passengerId, - 'balance' => $amount, - 'token' => $token - ]; - - $ch = curl_init($url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData)); - - $response = curl_exec($ch); - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - $curlError = curl_error($ch); - curl_close($ch); - - if ($curlError) { - logError("5.1", "cURL error in passenger wallet update", [ - "error" => $curlError, - "url" => $url - ]); - return null; - } - - if ($httpCode != 200) { - logError("5.2", "HTTP error in passenger wallet update", [ - "http_code" => $httpCode, - "response" => $response - ]); - return null; - } - - $data = json_decode($response, true); - - if (!$data) { - logError("5.3", "Invalid response format in passenger wallet update", [ - "response" => $response - ]); - return null; - } - - return $data; // ✅ Return result -} - -// 🎯 Function to add balance to Sefer wallet with error logging - - -function addToSeferWallet($passengerId, $amount, $paymentMethod) { - - - // Generate a new token specifically for the Sefer wallet - $seferToken = generatePaymentToken($passengerId, $amount); - - if (!$seferToken) { - logError("6.0.1", "Failed to generate Sefer token"); - return null; - } - - logError("6.0.2", "Generated new Sefer token", [ - "token_length" => ($seferToken) - ]); - - $url = BASE_URL . "/seferWallet/add.php"; - - $postData = [ - 'amount' => $amount, - 'paymentMethod' => $paymentMethod, - 'passengerId' => $passengerId, - 'token' => $seferToken, // Use the new Sefer-specific token - 'driverId' => 'passenger' - ]; - - $ch = curl_init($url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData)); - - $response = curl_exec($ch); - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - $curlError = curl_error($ch); - curl_close($ch); - - if ($curlError) { - logError("6.1", "cURL error in Sefer wallet update", [ - "error" => $curlError, - "url" => $url - ]); - return null; - } - - if ($httpCode != 200) { - logError("6.2", "HTTP error in Sefer wallet update", [ - "http_code" => $httpCode, - "response" => $response - ]); - return null; - } - - $data = json_decode($response, true); - - if (!$data) { - logError("6.3", "Invalid response format in Sefer wallet update", [ - "response" => $response - ]); - return null; - } - - return $data; // ✅ Return result -} - - -// 🎯 Function to calculate bonus -function calculateBonus($amount) { - logError("3.1", "Bonus calculation input", ["amount" => $amount]); - - $result = 0; - if ($amount == 100) $result = 100; - else if ($amount == 200) $result = 215; - else if ($amount == 400) $result = 450; - else if ($amount == 1000) $result = 1140; - - logError("3.2", "Bonus calculation result", [ - "input" => $amount, - "output" => $result - ]); - - return $result; -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/kazan/add.php b/walletintaleq.intaleq.xyz/v2/main/ride/kazan/add.php deleted file mode 100755 index ce926dc..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/kazan/add.php +++ /dev/null @@ -1,45 +0,0 @@ -prepare($sql); - -// Bind the parameters to the SQL query -$stmt->bindParam(':kazan', $kazan); -$stmt->bindParam(':comfortPrice', $comfortPrice); -$stmt->bindParam(':speedPrice', $speedPrice); -$stmt->bindParam(':deliveryPrice', $deliveryPrice); -$stmt->bindParam(':freePrice', $freePrice); -$stmt->bindParam(':latePrice', $latePrice); -$stmt->bindParam(':heavyPrice', $heavyPrice); -$stmt->bindParam(':adminId', $adminId); -$stmt->bindParam(':naturePrice', $naturePrice); -$stmt->bindParam(':country', $country); -$stmt->bindParam(':fuelPrice', $fuelPrice); - -// Execute the statement -if ($stmt->execute()) { - // Print a success message - printSuccess("Kazan saved successfully"); -} else { - // Print a failure message - printFailure("Failed to save Kazan"); -} - -// Close the statement -$stmt->close(); -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/kazan/delete.php b/walletintaleq.intaleq.xyz/v2/main/ride/kazan/delete.php deleted file mode 100644 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/kazan/error_log b/walletintaleq.intaleq.xyz/v2/main/ride/kazan/error_log deleted file mode 100644 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/kazan/get.php b/walletintaleq.intaleq.xyz/v2/main/ride/kazan/get.php deleted file mode 100644 index 24e2069..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/kazan/get.php +++ /dev/null @@ -1,27 +0,0 @@ -prepare($sql); -$stmt->execute(); - -$row = $stmt->fetchAll(PDO::FETCH_ASSOC); - -if ($row){ - // Fetch the record - // $row = $stmt->fetchAll(PDO::FETCH_ASSOC); - - - printSuccess( $row); - -} - else{ - // Print a failure message - - printFailure($message = "No Kazan record found"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/kazan/update.php b/walletintaleq.intaleq.xyz/v2/main/ride/kazan/update.php deleted file mode 100644 index 2e50a15..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/kazan/update.php +++ /dev/null @@ -1,72 +0,0 @@ -prepare($sql); -$stmt->execute(); - -if ($stmt->rowCount() > 0) { - // Print a success message - printSuccess($message = "Kazan data updated successfully"); -} else { - // Print a failure message - printFailure($message = "Failed to update kazan data"); -} \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/logs/payment_verification.log b/walletintaleq.intaleq.xyz/v2/main/ride/logs/payment_verification.log deleted file mode 100644 index 08c1039..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/logs/payment_verification.log +++ /dev/null @@ -1,385 +0,0 @@ -[2025-03-20 21:01:11] STEP 0: Request received | Data: {"user_id":"+201010101010","passengerId":"113172279072358305645"} -[2025-03-20 21:01:11] STEP 1: Querying latest payment | Data: {"user_id":"+201010101010"} -[2025-03-20 21:01:11] STEP 1: Payment found | Data: {"payment_id":"13","status":"1","amount":"2800.00"} -[2025-03-20 21:01:11] STEP 2: Payment status verified | Data: {"status":"1"} -[2025-03-20 21:01:11] STEP 3: Calculating bonus | Data: {"amount":"2800.00"} -[2025-03-20 21:01:11] STEP 3.1: Bonus calculation input | Data: {"amount":"2800.00"} -[2025-03-20 21:01:11] STEP 3.2: Bonus calculation result | Data: {"input":"2800.00","output":0} -[2025-03-20 21:01:11] STEP 3: Bonus calculation failed | Data: {"original_amount":"2800.00","calculated_amount":0} -[2025-03-20 21:07:36] STEP 0: Request received | Data: {"user_id":"+201010101010","passengerId":"113172279072358305645"} -[2025-03-20 21:07:36] STEP 1: Querying latest payment | Data: {"user_id":"+201010101010"} -[2025-03-20 21:07:36] STEP 1: Payment found | Data: {"payment_id":"14","status":"1","amount":28} -[2025-03-20 21:07:36] STEP 2: Payment status verified | Data: {"status":"1"} -[2025-03-20 21:07:36] STEP 3: Calculating bonus | Data: {"amount":"2800.00"} -[2025-03-20 21:07:36] STEP 3.1: Bonus calculation input | Data: {"amount":"2800.00"} -[2025-03-20 21:07:36] STEP 3.2: Bonus calculation result | Data: {"input":"2800.00","output":0} -[2025-03-20 21:07:36] STEP 3: Bonus calculation failed | Data: {"original_amount":"2800.00","calculated_amount":0} -[2025-03-20 21:10:41] STEP 0: Request received | Data: {"user_id":"+201010101010","passengerId":"113172279072358305645"} -[2025-03-20 21:10:41] STEP 1: Querying latest payment | Data: {"user_id":"+201010101010"} -[2025-03-20 21:10:41] STEP 1: Payment found | Data: {"payment_id":"15","status":"1","amount":80} -[2025-03-20 21:10:41] STEP 2: Payment status verified | Data: {"status":"1"} -[2025-03-20 21:10:41] STEP 3: Calculating bonus | Data: {"amount":80} -[2025-03-20 21:10:41] STEP 3.1: Bonus calculation input | Data: {"amount":80} -[2025-03-20 21:10:41] STEP 3.2: Bonus calculation result | Data: {"input":80,"output":0} -[2025-03-20 21:10:41] STEP 3: Bonus calculation failed | Data: {"original_amount":80,"calculated_amount":0} -[2025-03-20 21:11:51] STEP 0: Request received | Data: {"user_id":"+201010101010","passengerId":"113172279072358305645"} -[2025-03-20 21:11:51] STEP 1: Querying latest payment | Data: {"user_id":"+201010101010"} -[2025-03-20 21:11:51] STEP 1: Payment found | Data: {"payment_id":"16","status":"1","amount":100} -[2025-03-20 21:11:51] STEP 2: Payment status verified | Data: {"status":"1"} -[2025-03-20 21:11:51] STEP 3: Calculating bonus | Data: {"amount":100} -[2025-03-20 21:11:51] STEP 3.1: Bonus calculation input | Data: {"amount":100} -[2025-03-20 21:11:51] STEP 3.2: Bonus calculation result | Data: {"input":100,"output":100} -[2025-03-20 21:11:51] STEP 3: Bonus calculated | Data: {"original_amount":100,"final_amount":100} -[2025-03-20 21:11:51] STEP 4: Generating payment token | Data: {"passengerId":"113172279072358305645","amount":100} -[2025-03-20 21:11:51] STEP 4.2: HTTP error in token generation | Data: {"http_code":404,"response":"\n\n404 Not Found<\/title>\n<\/head><body>\n<h1>Not Found<\/h1>\n<p>The requested URL was not found on this server.<\/p>\n<p>Additionally, a 404 Not Found\nerror was encountered while trying to use an ErrorDocument to handle the request.<\/p>\n<\/body><\/html>\n"} -[2025-03-20 21:11:51] STEP 4: Token generation failed -[2025-03-20 21:15:42] STEP 0: Request received | Data: {"user_id":"+201010101010","passengerId":"113172279072358305645"} -[2025-03-20 21:15:42] STEP 1: Querying latest payment | Data: {"user_id":"+201010101010"} -[2025-03-20 21:15:42] STEP 1: Payment found | Data: {"payment_id":"17","status":"1","amount":100} -[2025-03-20 21:15:42] STEP 2: Payment status verified | Data: {"status":"1"} -[2025-03-20 21:15:42] STEP 3: Calculating bonus | Data: {"amount":100} -[2025-03-20 21:15:42] STEP 3.1: Bonus calculation input | Data: {"amount":100} -[2025-03-20 21:15:42] STEP 3.2: Bonus calculation result | Data: {"input":100,"output":100} -[2025-03-20 21:15:42] STEP 3: Bonus calculated | Data: {"original_amount":100,"final_amount":100} -[2025-03-20 21:15:42] STEP 4: Generating payment token | Data: {"passengerId":"113172279072358305645","amount":100} -[2025-03-20 21:15:42] STEP 4.2: HTTP error in token generation | Data: {"http_code":401,"response":"{\"error\":\"Authorization token required\"}"} -[2025-03-20 21:15:42] STEP 4: Token generation failed -[2025-03-20 21:27:10] STEP 0: Request received | Data: {"user_id":"+201010101010","passengerId":"113172279072358305645"} -[2025-03-20 21:27:10] STEP 1: Querying latest payment | Data: {"user_id":"+201010101010"} -[2025-03-20 21:27:10] STEP 1: Payment found | Data: {"payment_id":"18","status":"1","amount":100} -[2025-03-20 21:27:10] STEP 2: Payment status verified | Data: {"status":"1"} -[2025-03-20 21:27:10] STEP 3: Calculating bonus | Data: {"amount":100} -[2025-03-20 21:27:10] STEP 3.1: Bonus calculation input | Data: {"amount":100} -[2025-03-20 21:27:10] STEP 3.2: Bonus calculation result | Data: {"input":100,"output":100} -[2025-03-20 21:27:10] STEP 3: Bonus calculated | Data: {"original_amount":100,"final_amount":100} -[2025-03-20 21:27:10] STEP 4: Generating payment token | Data: {"passengerId":"113172279072358305645","amount":100} -[2025-03-20 21:27:10] STEP 4: Token generated successfully | Data: {"token_length":64} -[2025-03-20 21:27:10] STEP 5: Adding balance to passenger wallet | Data: {"passengerId":"113172279072358305645","amount":100} -[2025-03-20 21:27:10] STEP 5: Balance added to passenger wallet | Data: {"status":"success","message":"Wallet record created successfully"} -[2025-03-20 21:27:10] STEP 6: Adding balance to Sefer wallet | Data: {"passengerId":"113172279072358305645","amount":100,"paymentMethod":"unknown"} -[2025-03-20 21:27:10] STEP 6.1: cURL error in Sefer wallet update | Data: {"error":"Could not resolve host: wallet.sefer.live","url":"https:\/\/wallet.sefer.live\/seferpw.shop\/sefer\/ride\/seferWallet\/add.php"} -[2025-03-20 21:27:10] STEP 6: Failed to add balance to Sefer wallet -[2025-03-20 21:31:51] STEP 0: Request received | Data: {"user_id":"+201010101010","passengerId":"113172279072358305645"} -[2025-03-20 21:31:51] STEP 1: Querying latest payment | Data: {"user_id":"+201010101010"} -[2025-03-20 21:31:51] STEP 1: Payment found | Data: {"payment_id":"19","status":"1","amount":100} -[2025-03-20 21:31:51] STEP 2: Payment status verified | Data: {"status":"1"} -[2025-03-20 21:31:51] STEP 3: Calculating bonus | Data: {"amount":100} -[2025-03-20 21:31:51] STEP 3.1: Bonus calculation input | Data: {"amount":100} -[2025-03-20 21:31:51] STEP 3.2: Bonus calculation result | Data: {"input":100,"output":100} -[2025-03-20 21:31:51] STEP 3: Bonus calculated | Data: {"original_amount":100,"final_amount":100} -[2025-03-20 21:31:51] STEP 4: Generating payment token | Data: {"passengerId":"113172279072358305645","amount":100} -[2025-03-20 21:31:51] STEP 4: Token generated successfully | Data: {"token_length":64} -[2025-03-20 21:31:51] STEP 5: Adding balance to passenger wallet | Data: {"passengerId":"113172279072358305645","amount":100} -[2025-03-20 21:31:51] STEP 5: Balance added to passenger wallet | Data: {"status":"success","message":"Wallet record created successfully"} -[2025-03-20 21:31:51] STEP 6: Adding balance to Sefer wallet | Data: {"passengerId":"113172279072358305645","amount":100,"paymentMethod":"unknown"} -[2025-03-20 21:31:51] STEP 6: Failed to add balance to Sefer wallet | Data: {"status":"failure","message":"Invalid or already used token"} -[2025-03-20 21:35:58] STEP 0: Request received | Data: {"user_id":"+201010101010","passengerId":"113172279072358305645"} -[2025-03-20 21:35:58] STEP 1: Querying latest payment | Data: {"user_id":"+201010101010"} -[2025-03-20 21:35:58] STEP 1: Payment found | Data: {"payment_id":"20","status":"1","amount":100} -[2025-03-20 21:35:58] STEP 2: Payment status verified | Data: {"status":"1"} -[2025-03-20 21:35:58] STEP 3: Calculating bonus | Data: {"amount":100} -[2025-03-20 21:35:58] STEP 3.1: Bonus calculation input | Data: {"amount":100} -[2025-03-20 21:35:58] STEP 3.2: Bonus calculation result | Data: {"input":100,"output":100} -[2025-03-20 21:35:58] STEP 3: Bonus calculated | Data: {"original_amount":100,"final_amount":100} -[2025-03-20 21:35:58] STEP 4: Generating payment token | Data: {"passengerId":"113172279072358305645","amount":100} -[2025-03-20 21:35:58] STEP 4: Token generated successfully | Data: {"token_length":64} -[2025-03-20 21:35:58] STEP 5: Adding balance to passenger wallet | Data: {"passengerId":"113172279072358305645","amount":100} -[2025-03-20 21:35:58] STEP 5: Balance added to passenger wallet | Data: {"status":"success","message":"Wallet record created successfully"} -[2025-03-20 21:35:58] STEP 6: Adding balance to Sefer wallet | Data: {"passengerId":"113172279072358305645","amount":100,"paymentMethod":"unknown"} -[2025-03-20 21:35:58] STEP 4: tokenSefer generated successfully | Data: {"token_length":64} -[2025-03-20 21:35:58] STEP 6: Failed to add balance to Sefer wallet | Data: {"status":"failure","message":"Invalid or already used token"} -[2025-03-20 21:52:30] STEP 0: Request received | Data: {"user_id":"+201010101010","passengerId":"113172279072358305645"} -[2025-03-20 21:52:30] STEP 1: Querying latest payment | Data: {"user_id":"+201010101010"} -[2025-03-20 21:52:30] STEP 1: Payment found | Data: {"payment_id":"21","status":"1","amount":100} -[2025-03-20 21:52:30] STEP 2: Payment status verified | Data: {"status":"1"} -[2025-03-20 21:52:30] STEP 3: Calculating bonus | Data: {"amount":100} -[2025-03-20 21:52:30] STEP 3.1: Bonus calculation input | Data: {"amount":100} -[2025-03-20 21:52:30] STEP 3.2: Bonus calculation result | Data: {"input":100,"output":100} -[2025-03-20 21:52:30] STEP 3: Bonus calculated | Data: {"original_amount":100,"final_amount":100} -[2025-03-20 21:52:30] STEP 4: Generating payment token | Data: {"passengerId":"113172279072358305645","amount":100} -[2025-03-20 21:52:30] STEP 4: Token generated successfully | Data: {"token_length":64} -[2025-03-20 21:52:30] STEP 5: Adding balance to passenger wallet | Data: {"passengerId":"113172279072358305645","amount":100} -[2025-03-20 21:52:30] STEP 5: Balance added to passenger wallet | Data: {"status":"success","message":"Wallet record created successfully"} -[2025-03-20 21:52:30] STEP 6: Adding balance to Sefer wallet | Data: {"passengerId":"113172279072358305645","amount":100,"paymentMethod":"unknown"} -[2025-03-20 21:52:30] STEP 4: tokenSefer generated successfully | Data: {"token_length":64} -[2025-03-20 21:52:30] STEP 6: Failed to add balance to Sefer wallet | Data: {"status":"failure","message":"Invalid or already used token"} -[2025-03-20 22:09:36] STEP 0: Request received | Data: {"user_id":"+201010101010","passengerId":"113172279072358305645"} -[2025-03-20 22:09:36] STEP 1: Querying latest payment | Data: {"user_id":"+201010101010"} -[2025-03-20 22:09:36] STEP 1: Payment found | Data: {"payment_id":"22","status":"1","amount":200} -[2025-03-20 22:09:36] STEP 2: Payment status verified | Data: {"status":"1"} -[2025-03-20 22:09:36] STEP 3: Calculating bonus | Data: {"amount":200} -[2025-03-20 22:09:36] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-20 22:09:36] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-20 22:09:36] STEP 3: Bonus calculated | Data: {"original_amount":200,"final_amount":215} -[2025-03-20 22:09:36] STEP 4: Generating payment token | Data: {"passengerId":"113172279072358305645","amount":215} -[2025-03-20 22:09:36] STEP 4: Token generated successfully | Data: {"token_length":64} -[2025-03-20 22:09:36] STEP 5: Adding balance to passenger wallet | Data: {"passengerId":"113172279072358305645","amount":215} -[2025-03-20 22:09:36] STEP 5: Balance added to passenger wallet | Data: {"status":"success","message":"Wallet record created successfully"} -[2025-03-20 22:09:36] STEP 6: Adding balance to Sefer wallet | Data: {"passengerId":"113172279072358305645","amount":215,"paymentMethod":null} -[2025-03-20 22:09:36] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":64} -[2025-03-20 22:09:36] STEP 6: Failed to add balance to Sefer wallet | Data: {"status":"failure","message":"Invalid or already used token"} -[2025-03-20 22:19:03] STEP 0: Request received | Data: {"user_id":"+201010101010","passengerId":"113172279072358305645"} -[2025-03-20 22:19:03] STEP 1: Querying latest payment | Data: {"user_id":"+201010101010"} -[2025-03-20 22:19:03] STEP 1: Payment found | Data: {"payment_id":"23","status":"1","amount":200} -[2025-03-20 22:19:03] STEP 2: Payment status verified | Data: {"status":"1"} -[2025-03-20 22:19:03] STEP 3: Calculating bonus | Data: {"amount":200} -[2025-03-20 22:19:03] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-20 22:19:03] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-20 22:19:03] STEP 3: Bonus calculated | Data: {"original_amount":200,"final_amount":215} -[2025-03-20 22:19:03] STEP 4: Generating payment token | Data: {"passengerId":"113172279072358305645","amount":215} -[2025-03-20 22:19:03] STEP 4: Token generated successfully | Data: {"token_length":64} -[2025-03-20 22:19:03] STEP 5: Adding balance to passenger wallet | Data: {"passengerId":"113172279072358305645","amount":215} -[2025-03-20 22:19:03] STEP 5: Balance added to passenger wallet | Data: {"status":"success","message":"Wallet record created successfully"} -[2025-03-20 22:19:03] STEP 6: Adding balance to Sefer wallet | Data: {"passengerId":"113172279072358305645","amount":215,"paymentMethod":null} -[2025-03-20 22:19:03] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"e8131e30ba2ccef8c2f15cd03fa15d6151ca6e3fbc60778b9ad6fb5e105f383d"} -[2025-03-20 22:19:03] STEP 6.2: HTTP error in Sefer wallet update | Data: {"http_code":401,"response":"{\"error\":\"Authorization token required\"}"} -[2025-03-20 22:19:03] STEP 6: Failed to add balance to Sefer wallet -[2025-03-20 22:24:40] STEP 0: Request received | Data: {"user_id":"+201010101010","passengerId":"113172279072358305645"} -[2025-03-20 22:24:40] STEP 1: Querying latest payment | Data: {"user_id":"+201010101010"} -[2025-03-20 22:24:40] STEP 1: Payment found | Data: {"payment_id":"24","status":"1","amount":200} -[2025-03-20 22:24:40] STEP 2: Payment status verified | Data: {"status":"1"} -[2025-03-20 22:24:40] STEP 3: Calculating bonus | Data: {"amount":200} -[2025-03-20 22:24:40] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-20 22:24:40] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-20 22:24:40] STEP 3: Bonus calculated | Data: {"original_amount":200,"final_amount":215} -[2025-03-20 22:24:40] STEP 4: Generating payment token | Data: {"passengerId":"113172279072358305645","amount":215} -[2025-03-20 22:24:40] STEP 4: Token generated successfully | Data: {"token_length":64} -[2025-03-20 22:24:40] STEP 5: Adding balance to passenger wallet | Data: {"passengerId":"113172279072358305645","amount":215} -[2025-03-20 22:24:40] STEP 5: Balance added to passenger wallet | Data: {"status":"success","message":"Wallet record created successfully"} -[2025-03-20 22:24:40] STEP 6: Adding balance to Sefer wallet | Data: {"passengerId":"113172279072358305645","amount":215,"paymentMethod":"visa-in"} -[2025-03-20 22:24:40] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"9d924a59964a75c672502e0a961e79bcdb23d62f6fadfe2aa6b5cac145022015"} -[2025-03-20 22:24:40] STEP 6: Failed to add balance to Sefer wallet | Data: {"status":"failure","message":"Invalid or already used token"} -[2025-03-20 22:38:27] STEP 0: Request received | Data: {"user_id":"+201010101010","passengerId":"113172279072358305645"} -[2025-03-20 22:38:27] STEP 1: Querying latest payment | Data: {"user_id":"+201010101010"} -[2025-03-20 22:38:27] STEP 1: Payment found | Data: {"payment_id":"25","status":"1","amount":200} -[2025-03-20 22:38:27] STEP 2: Payment status verified | Data: {"status":"1"} -[2025-03-20 22:38:27] STEP 3: Calculating bonus | Data: {"amount":200} -[2025-03-20 22:38:27] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-20 22:38:27] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-20 22:38:27] STEP 3: Bonus calculated | Data: {"original_amount":200,"final_amount":215} -[2025-03-20 22:38:27] STEP 4: Generating payment token | Data: {"passengerId":"113172279072358305645","amount":215} -[2025-03-20 22:38:27] STEP 4: Token generated successfully | Data: {"token_length":64} -[2025-03-20 22:38:27] STEP 5: Adding balance to passenger wallet | Data: {"passengerId":"113172279072358305645","amount":215} -[2025-03-20 22:38:27] STEP 5: Balance added to passenger wallet | Data: {"status":"success","message":"Wallet record created successfully"} -[2025-03-20 22:38:27] STEP 6: Adding balance to Sefer wallet | Data: {"passengerId":"113172279072358305645","amount":215,"paymentMethod":"visa-in"} -[2025-03-20 22:38:27] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"d0b8b5d6e25d74038ff96d9bb61533213536049fc99484df751cbff86f354058"} -[2025-03-20 22:38:27] STEP 6: Failed to add balance to Sefer wallet | Data: {"status":"failure","message":"Invalid or already used token"} -[2025-03-20 22:45:51] STEP 0: Request received | Data: {"user_id":"+201010101010","passengerId":"113172279072358305645"} -[2025-03-20 22:45:51] STEP 1: Querying latest payment | Data: {"user_id":"+201010101010"} -[2025-03-20 22:45:51] STEP 1: Payment found | Data: {"payment_id":"26","status":"1","amount":200} -[2025-03-20 22:45:51] STEP 2: Payment status verified | Data: {"status":"1"} -[2025-03-20 22:45:51] STEP 3: Calculating bonus | Data: {"amount":200} -[2025-03-20 22:45:51] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-20 22:45:51] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-20 22:45:51] STEP 3: Bonus calculated | Data: {"original_amount":200,"final_amount":215} -[2025-03-20 22:45:51] STEP 4: Generating payment token | Data: {"passengerId":"113172279072358305645","amount":215} -[2025-03-20 22:45:51] STEP 4: Token generated successfully | Data: {"token_length":64} -[2025-03-20 22:45:51] STEP 5: Adding balance to passenger wallet | Data: {"passengerId":"113172279072358305645","amount":215} -[2025-03-20 22:45:51] STEP 5: Balance added to passenger wallet | Data: {"status":"success","message":"Wallet record created successfully"} -[2025-03-20 22:45:51] STEP 6: Adding balance to Sefer wallet | Data: {"passengerId":"113172279072358305645","amount":215,"paymentMethod":"visa-in"} -[2025-03-20 22:45:51] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"698f6808c38e9075e74513a21a2b8255c9b04c1473be5fb9bc559488e3a29c1f"} -[2025-03-20 22:45:51] STEP 6: Failed to add balance to Sefer wallet | Data: {"status":"failure","message":"Invalid or already used token"} -[2025-03-20 22:48:56] STEP 0: Request received | Data: {"user_id":"+201010101010","passengerId":"113172279072358305645"} -[2025-03-20 22:48:56] STEP 1: Querying latest payment | Data: {"user_id":"+201010101010"} -[2025-03-20 22:48:56] STEP 1: Payment found | Data: {"payment_id":"27","status":"1","amount":200} -[2025-03-20 22:48:56] STEP 2: Payment status verified | Data: {"status":"1"} -[2025-03-20 22:48:56] STEP 3: Calculating bonus | Data: {"amount":200} -[2025-03-20 22:48:56] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-20 22:48:56] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-20 22:48:56] STEP 3: Bonus calculated | Data: {"original_amount":200,"final_amount":215} -[2025-03-20 22:48:56] STEP 4: Generating payment token | Data: {"passengerId":"113172279072358305645","amount":215} -[2025-03-20 22:48:56] STEP 4: Token generated successfully | Data: {"token_length":64} -[2025-03-20 22:48:56] STEP 5: Adding balance to passenger wallet | Data: {"passengerId":"113172279072358305645","amount":215} -[2025-03-20 22:48:56] STEP 5: Balance added to passenger wallet | Data: {"status":"success","message":"Wallet record created successfully"} -[2025-03-20 22:48:56] STEP 6: Adding balance to Sefer wallet | Data: {"passengerId":"113172279072358305645","amount":215,"paymentMethod":"visa-in"} -[2025-03-20 22:48:56] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"86128c316f4f275e543fc07b7a171c39a1c92b81fcadd1548f6c150a1651d1f4"} -[2025-03-20 22:48:56] STEP 6.2: HTTP error in Sefer wallet update | Data: {"http_code":500,"response":""} -[2025-03-20 22:48:56] STEP 6: Failed to add balance to Sefer wallet -[2025-03-20 22:51:43] STEP 0: Request received | Data: {"user_id":"+201010101010","passengerId":"113172279072358305645"} -[2025-03-20 22:51:43] STEP 1: Querying latest payment | Data: {"user_id":"+201010101010"} -[2025-03-20 22:51:43] STEP 1: Payment found | Data: {"payment_id":"28","status":"1","amount":200} -[2025-03-20 22:51:43] STEP 2: Payment status verified | Data: {"status":"1"} -[2025-03-20 22:51:43] STEP 3: Calculating bonus | Data: {"amount":200} -[2025-03-20 22:51:43] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-20 22:51:43] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-20 22:51:43] STEP 3: Bonus calculated | Data: {"original_amount":200,"final_amount":215} -[2025-03-20 22:51:43] STEP 4: Generating payment token | Data: {"passengerId":"113172279072358305645","amount":215} -[2025-03-20 22:51:43] STEP 4: Token generated successfully | Data: {"token_length":64} -[2025-03-20 22:51:43] STEP 5: Adding balance to passenger wallet | Data: {"passengerId":"113172279072358305645","amount":215} -[2025-03-20 22:51:43] STEP 5: Balance added to passenger wallet | Data: {"status":"success","message":"Wallet record created successfully"} -[2025-03-20 22:51:43] STEP 6: Adding balance to Sefer wallet | Data: {"passengerId":"113172279072358305645","amount":215,"paymentMethod":"visa-in"} -[2025-03-20 22:51:43] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"9a7626a1c58f54e0181a059a9ce4758af2c75998941cc6c00947377b4fc5bacf"} -[2025-03-20 22:51:43] STEP 6.2: HTTP error in Sefer wallet update | Data: {"http_code":500,"response":""} -[2025-03-20 22:51:43] STEP 6: Failed to add balance to Sefer wallet -[2025-03-20 22:54:12] STEP 0: Request received | Data: {"user_id":"+201010101010","passengerId":"113172279072358305645"} -[2025-03-20 22:54:12] STEP 1: Querying latest payment | Data: {"user_id":"+201010101010"} -[2025-03-20 22:54:12] STEP 1: Payment found | Data: {"payment_id":"29","status":"1","amount":200} -[2025-03-20 22:54:12] STEP 2: Payment status verified | Data: {"status":"1"} -[2025-03-20 22:54:12] STEP 3: Calculating bonus | Data: {"amount":200} -[2025-03-20 22:54:12] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-20 22:54:12] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-20 22:54:12] STEP 3: Bonus calculated | Data: {"original_amount":200,"final_amount":215} -[2025-03-20 22:54:12] STEP 4: Generating payment token | Data: {"passengerId":"113172279072358305645","amount":215} -[2025-03-20 22:54:12] STEP 4: Token generated successfully | Data: {"token_length":64} -[2025-03-20 22:54:12] STEP 5: Adding balance to passenger wallet | Data: {"passengerId":"113172279072358305645","amount":215} -[2025-03-20 22:54:12] STEP 5: Balance added to passenger wallet | Data: {"status":"success","message":"Wallet record created successfully"} -[2025-03-20 22:54:12] STEP 6: Adding balance to Sefer wallet | Data: {"passengerId":"113172279072358305645","amount":215,"paymentMethod":"visa-in"} -[2025-03-20 22:54:12] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"7f955f629d5da0ec127b6c0b32de0fa44aeaad9c9ec8231418905c8031c94316"} -[2025-03-20 22:54:12] STEP 6: Balance added to Sefer wallet | Data: {"status":"success","message":"Wallet data saved successfully"} -[2025-03-20 22:54:12] STEP 7: Process completed successfully | Data: {"payment_id":"29","amount":215,"passengerId":"113172279072358305645"} -[2025-03-20 23:00:11] STEP 0: Request received | Data: {"user_id":"+201010101010","passengerId":"113172279072358305645"} -[2025-03-20 23:00:11] STEP 1: Querying latest payment | Data: {"user_id":"+201010101010"} -[2025-03-20 23:00:11] STEP 1: Payment found | Data: {"payment_id":"30","status":"1","amount":200} -[2025-03-20 23:00:11] STEP 2: Payment status verified | Data: {"status":"1"} -[2025-03-20 23:00:11] STEP 3: Calculating bonus | Data: {"amount":200} -[2025-03-20 23:00:11] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-20 23:00:11] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-20 23:00:11] STEP 3: Bonus calculated | Data: {"original_amount":200,"final_amount":215} -[2025-03-20 23:00:11] STEP 4: Generating payment token | Data: {"passengerId":"113172279072358305645","amount":215} -[2025-03-20 23:00:11] STEP 4: Token generated successfully | Data: {"token_length":64} -[2025-03-20 23:00:11] STEP 5: Adding balance to passenger wallet | Data: {"passengerId":"113172279072358305645","amount":215} -[2025-03-20 23:00:11] STEP 5: Balance added to passenger wallet | Data: {"status":"success","message":"Wallet record created successfully"} -[2025-03-20 23:00:11] STEP 6: Adding balance to Sefer wallet | Data: {"passengerId":"113172279072358305645","amount":215,"paymentMethod":"visa-in"} -[2025-03-20 23:00:11] STEP 4: Token generated successfully | Data: {"token_length":64} -[2025-03-20 23:00:11] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"5c6d19041cfab3851040212ccf045f21be41c84c5d736dfc58b2da7eb3c8854a"} -[2025-03-20 23:00:11] STEP 6: Balance added to Sefer wallet | Data: {"status":"success","message":"Wallet data saved successfully"} -[2025-03-20 23:00:11] STEP 7: Process completed successfully | Data: {"payment_id":"30","amount":215,"passengerId":"113172279072358305645"} -[2025-03-20 23:07:14] STEP 0: Request received | Data: {"user_id":"+201010101010","passengerId":"113172279072358305645"} -[2025-03-20 23:07:14] STEP 1: Querying latest payment | Data: {"user_id":"+201010101010"} -[2025-03-20 23:07:14] STEP 1: Payment found | Data: {"payment_id":"31","status":"1","amount":200} -[2025-03-20 23:07:14] STEP 2: Payment status verified | Data: {"status":"1"} -[2025-03-20 23:07:14] STEP 3: Calculating bonus | Data: {"amount":200} -[2025-03-20 23:07:14] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-20 23:07:14] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-20 23:07:14] STEP 3: Bonus calculated | Data: {"original_amount":200,"final_amount":215} -[2025-03-20 23:07:14] STEP 4: Generating payment token | Data: {"passengerId":"113172279072358305645","amount":215} -[2025-03-20 23:07:14] STEP 4: Token generated successfully | Data: {"token_length":64} -[2025-03-20 23:07:14] STEP 5: Adding balance to passenger wallet | Data: {"passengerId":"113172279072358305645","amount":215} -[2025-03-20 23:07:14] STEP 5: Balance added to passenger wallet | Data: {"status":"success","message":"Wallet record created successfully"} -[2025-03-20 23:07:14] STEP 6: Adding balance to Sefer wallet | Data: {"passengerId":"113172279072358305645","amount":215,"paymentMethod":"visa-in"} -[2025-03-20 23:07:14] STEP 4: Token generated successfully | Data: {"token_length":64} -[2025-03-20 23:07:14] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"b912396d32c1b398d65e4459ac945079025840776db6feb34a9cc4f06b60191a"} -[2025-03-20 23:07:14] STEP 6: Balance added to Sefer wallet | Data: {"status":"success","message":"Wallet data saved successfully"} -[2025-03-20 23:07:14] STEP 7: Process completed successfully | Data: {"payment_id":"31","amount":215,"passengerId":"113172279072358305645"} -[2025-03-20 23:13:05] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-20 23:13:05] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-20 23:13:05] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"3b68024312f568ea264d279280d9a6164a4a272531b21678d6a5e556816a7592"} -[2025-03-20 23:28:20] STEP 0: Request received | Data: {"user_id":"+201010101010","passengerId":"113172279072358305645"} -[2025-03-20 23:28:20] STEP 1: Querying latest payment | Data: {"user_id":"+201010101010"} -[2025-03-20 23:28:20] STEP 1: Payment found | Data: {"payment_id":"36","status":"1","amount":200} -[2025-03-20 23:28:20] STEP 2: Payment status verified | Data: {"status":"1"} -[2025-03-20 23:28:20] STEP 3: Calculating bonus | Data: {"amount":200} -[2025-03-20 23:28:20] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-20 23:28:20] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-20 23:28:20] STEP 3: Bonus calculated | Data: {"original_amount":200,"final_amount":215} -[2025-03-20 23:28:20] STEP 4: Generating payment token | Data: {"passengerId":"113172279072358305645","amount":215} -[2025-03-20 23:28:20] STEP 4: Token generated successfully | Data: {"token_length":64} -[2025-03-20 23:28:20] STEP 5: Adding balance to passenger wallet | Data: {"passengerId":"113172279072358305645","amount":215} -[2025-03-20 23:28:20] STEP 5: Balance added to passenger wallet | Data: {"status":"success","message":"Wallet record created successfully"} -[2025-03-20 23:28:20] STEP 6: Adding balance to Sefer wallet | Data: {"passengerId":"113172279072358305645","amount":215,"paymentMethod":"visa-in"} -[2025-03-20 23:28:20] STEP 4: Token generated successfully | Data: {"token_length":64} -[2025-03-20 23:28:20] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"b0f64da4cfca1bf153c523a03cd692b8f1a44c09674683df5406dcd6c874f00d"} -[2025-03-20 23:28:20] STEP 6: Balance added to Sefer wallet | Data: {"status":"success","message":"Wallet data saved successfully"} -[2025-03-20 23:28:20] STEP 7: Process completed successfully | Data: {"payment_id":"36","amount":215,"passengerId":"113172279072358305645"} -[2025-03-20 23:31:52] STEP 0: Request received | Data: {"user_id":"+201010101010","passengerId":"113172279072358305645"} -[2025-03-20 23:31:52] STEP 1: Querying latest payment | Data: {"user_id":"+201010101010"} -[2025-03-20 23:31:52] STEP 1: Payment found | Data: {"payment_id":"37","status":"1","amount":200} -[2025-03-20 23:31:52] STEP 2: Payment status verified | Data: {"status":"1"} -[2025-03-20 23:31:52] STEP 3: Calculating bonus | Data: {"amount":200} -[2025-03-20 23:31:52] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-20 23:31:52] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-20 23:31:52] STEP 3: Bonus calculated | Data: {"original_amount":200,"final_amount":215} -[2025-03-20 23:31:52] STEP 4: Generating payment token | Data: {"passengerId":"113172279072358305645","amount":215} -[2025-03-20 23:31:52] STEP 4: Token generated successfully | Data: {"token_length":64} -[2025-03-20 23:31:52] STEP 5: Adding balance to passenger wallet | Data: {"passengerId":"113172279072358305645","amount":215} -[2025-03-20 23:31:52] STEP 5: Balance added to passenger wallet | Data: {"status":"success","message":"Wallet record created successfully"} -[2025-03-20 23:31:52] STEP 6: Adding balance to Sefer wallet | Data: {"passengerId":"113172279072358305645","amount":215,"paymentMethod":"visa-in"} -[2025-03-20 23:31:52] STEP 4: Token generated successfully | Data: {"token_length":64} -[2025-03-20 23:31:52] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"dc156df7310f9ce998bf0fae3a325a716ec7806ff037021c4b12b3b800f37bf2"} -[2025-03-20 23:31:52] STEP 6: Balance added to Sefer wallet | Data: {"status":"success","message":"Wallet data saved successfully"} -[2025-03-20 23:31:52] STEP 7: Process completed successfully | Data: {"payment_id":"37","amount":215,"passengerId":"113172279072358305645"} -[2025-03-20 23:49:27] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-20 23:49:27] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-20 23:49:27] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"172ea88c6fc36188b435508f8f434736cc58f2b75feb54e6b8fa1674d4a9910a"} -[2025-03-21 09:32:00] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-21 09:32:00] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-21 09:32:00] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"6ad135e7b01bf9c1ab99f68d0dead8f91bc93588c173d837a8f3ce77e96c6eee"} -[2025-03-21 09:33:06] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-21 09:33:06] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-21 09:33:06] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"4ebb300836e9cb522a0afd422e818c2603fda11ef52e050a78624f728b994f01"} -[2025-03-21 09:41:54] STEP 1: No payment found | Data: {"user_id":"+201010101010"} -[2025-03-21 09:45:44] STEP 1: No payment found | Data: {"user_id":"+201010101010"} -[2025-03-21 09:48:54] STEP 1: No payment found | Data: {"user_id":"+201010101010"} -[2025-03-21 11:30:48] STEP 1: No payment found | Data: {"user_id":"+201010101010"} -[2025-03-21 11:37:18] STEP 1: No payment found | Data: {"user_id":"+201010101010"} -[2025-03-21 12:19:24] STEP 1: No payment found | Data: {"user_id":"+201010101010"} -[2025-03-21 12:20:48] STEP 1: No payment found | Data: {"user_id":"+201010101010"} -[2025-03-21 12:22:09] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-21 12:22:09] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-21 12:22:09] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"a5589a7714ea56acd72341a0c14079d3b8d548dbef885a2f71ea19cd20325c91"} -[2025-03-21 12:37:16] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-21 12:37:16] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-21 12:37:17] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"d6f2e4bc82d052bcba3d287e5c4f3465ad8f3707ee739692e2832a5b9dc131c6"} -[2025-03-21 12:49:11] STEP 1: No payment found | Data: {"user_id":"+201010101010"} -[2025-03-21 12:51:03] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-21 12:51:03] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-21 12:51:04] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"3081636c569695289e5484b738d6cf63bd015505490b3c94841538767ff2f058"} -[2025-03-21 14:04:09] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-21 14:04:09] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-21 14:04:10] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"67e48b2025ea10823d2c37eb9f821963efff9fa26b5e41d5b1d391376a31b59a"} -[2025-03-21 14:07:48] STEP 1: No payment found | Data: {"user_id":"+201010101010"} -[2025-03-21 14:17:03] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-21 14:17:03] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-21 14:17:03] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"e952b7b4417a71eaff2b348e8241c4a63d97b12d4ad1d79acfb5cce1992a2acd"} -[2025-03-21 14:24:19] STEP 1: No payment found | Data: {"user_id":"+201010101010"} -[2025-03-21 14:28:35] STEP 1: No payment found | Data: {"user_id":"+201010101010"} -[2025-03-21 14:32:45] STEP 1: No payment found | Data: {"user_id":"+201010101010"} -[2025-03-21 14:37:37] STEP 1: No payment found | Data: {"user_id":"+201010101010"} -[2025-03-21 14:38:56] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-21 14:38:56] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-21 14:38:56] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"a8aad013fb6332aef78521c6cccff74485c158bbdb3242e51e66ab7f1059e4c9"} -[2025-03-21 14:42:15] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-21 14:42:15] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-21 14:42:15] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"2803a235094afa54c82ad250292f15a121f524bf4c109df32342068a03c9c212"} -[2025-03-21 14:45:52] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-21 14:45:52] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-21 14:45:52] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"1e6a84b59f5580fb4fe52248222620c7cb3c44f8edfeb0db0003192a90403aa3"} -[2025-03-21 14:54:41] STEP 1: No payment found | Data: {"user_id":"+201010101010"} -[2025-03-21 14:59:31] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-21 14:59:31] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-21 14:59:31] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"7dee4184aa286693ef8e3a2c4fe03b103d6ff8348198f5faa6bfc91c4ed6ae21"} -[2025-03-21 15:19:15] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-21 15:19:15] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-21 15:19:15] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"0ebad59f5b4b439fae5e5e8f6fa65e816ac5943e724ef1758dc714bdea39bdb8"} -[2025-03-21 15:21:45] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-21 15:21:45] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-21 15:21:45] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"abfb981f8fbfba8cf3591c502d27a9b03066d909c95f44b3adfee6b01523e4df"} -[2025-03-21 15:23:37] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-21 15:23:37] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-21 15:23:37] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"c0775be365dbad9fc99ee84786b7101d4bbd51bf4d8b29475e7407b350a5873f"} -[2025-03-21 15:28:30] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-21 15:28:30] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-21 15:28:31] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"51181d3015c2756d256569e96ec7221b34aba737483a3f8e92858840c50441ae"} -[2025-03-21 15:28:55] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-21 15:28:55] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-21 15:28:55] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"6a3c946d98dbc3ed66e8e30b80c56fc8925073fce70105260c64bc86c1e5cd6c"} -[2025-03-21 15:35:16] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-21 15:35:16] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-21 15:35:16] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"b4f3b175044981388b0ecd6cf9f7f9713f591f20c58e55a977c9be9029a45fb4"} -[2025-03-21 15:38:43] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-21 15:38:43] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-21 15:38:43] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"de17e4d8db68e3e0649d6515937fa1ef8464a47bef52a8178a751e54d1fde4e3"} -[2025-03-21 15:39:48] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-21 15:39:48] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-21 15:39:48] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"cf0b6242a0c25023b69dfdfa17ee4ff5c4e265e0b1ae43276891347f08f6d648"} -[2025-03-21 15:43:53] STEP 1: No payment found | Data: {"user_id":"+201010101010"} -[2025-03-21 15:44:58] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-21 15:44:58] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-21 15:44:59] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"fc66691cf53e4f559b3ff957a13384a84052ca52b191de3c5a76ed5572827e2e"} -[2025-03-21 15:47:30] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-21 15:47:30] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-21 15:47:30] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"c16c271306018e5791ba0e0ca8012ba4c3674837bec30164c39a61e0715f7124"} -[2025-03-21 15:49:41] STEP 3.1: Bonus calculation input | Data: {"amount":200} -[2025-03-21 15:49:41] STEP 3.2: Bonus calculation result | Data: {"input":200,"output":215} -[2025-03-21 15:49:41] STEP 6.0.2: Generated new Sefer token | Data: {"token_length":"2d2024c3b3954388a45dc40ec0ac8a62af917975def467636a26ee14ca97c8b9"} -[2025-03-21 16:36:27] STEP 1: No payment found | Data: {"user_id":"+201010101010"} diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/logs/payment_verification_driver.log b/walletintaleq.intaleq.xyz/v2/main/ride/logs/payment_verification_driver.log deleted file mode 100755 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/driver/confirm_payment.php b/walletintaleq.intaleq.xyz/v2/main/ride/mtn/driver/confirm_payment.php deleted file mode 100755 index 429ac56..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/driver/confirm_payment.php +++ /dev/null @@ -1,125 +0,0 @@ -<?php -// /v1/main/ride/mtn/driver/confirm_payment.php -include "../../../connect.php"; - -// It's better to use __DIR__ for reliable file path resolution. -// Assuming your private_key.pem is in the same directory as this script. -$privateKeyPath = __DIR__ . "/private_key.pem"; - -$baseUrl = rtrim(getenv('MTN_API_BASE_URL'), '/'); -$terminalId = getenv('MTN_TERMINAL_ID'); -$privateKey = openssl_pkey_get_private(file_get_contents($privateKeyPath)); - -$invoice = filterRequest('invoiceNumber'); -$phone = filterRequest('phone'); -$guid = filterRequest('guid'); -$operationNumber = filterRequest('operationNumber'); -$code = filterRequest('otp'); // The OTP - -error_log("MTN Confirm (Driver): Start request for invoice={$invoice}, phone={$phone}, guid={$guid}, opNum={$operationNumber}"); - -if (!$invoice || !$phone || !$guid || !$operationNumber || !$code) { - error_log("MTN Confirm (Driver): Missing parameters"); - printFailure("Missing parameters."); - exit; -} - -// Encrypt the code -$hashBin = hash('sha256', $code, true); -$codeB64 = base64_encode($hashBin); - -$body = [ - 'Invoice' => intval($invoice), - 'Phone' => $phone, - 'Guid' => $guid, - 'OperationNumber' => intval($operationNumber), - 'Code' => $codeB64 -]; -$bodyJson = json_encode($body, JSON_UNESCAPED_UNICODE); - -error_log("MTN Confirm (Driver): Prepared body JSON: " . $bodyJson); - -// Generate signature -$signResult = openssl_sign($bodyJson, $sig, $privateKey, OPENSSL_ALGO_SHA256); -if (!$signResult) { - error_log("MTN Confirm (Driver): Failed to generate signature"); - printFailure("Signature error."); - exit; -} -$xSignature = base64_encode($sig); -error_log("MTN Confirm (Driver): Generated signature"); - -// Send the request -$ch = curl_init("{$baseUrl}/pos_web/payment_phone/confirm"); -curl_setopt_array($ch, [ - CURLOPT_POST => true, - CURLOPT_POSTFIELDS => $bodyJson, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HTTPHEADER => [ - "Content-Type: application/json", - "Request-Name: pos_web/payment_phone/confirm", - "Subject: {$terminalId}", - "X-Signature: {$xSignature}" - ] -]); - -$response = curl_exec($ch); -$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); -$curlError = curl_error($ch); -curl_close($ch); - -error_log("MTN Confirm (Driver): HTTP $httpCode - Response: $response"); -if ($curlError) { - error_log("MTN Confirm (Driver): cURL error - $curlError"); -} - -// --- SOLUTION IMPLEMENTED HERE --- -// 1. Decode the response from MTN to check its contents. -$responseData = json_decode($response, true) ?: []; - -// 2. First, check for network/gateway level failure. -if ($httpCode !== 200) { - error_log("MTN Confirm (Driver): HTTP failure for invoice {$invoice}. Code: {$httpCode}"); - // Use printFailure to send a structured error to Flutter - printFailure(['message' => 'MTN Gateway Error', 'http' => $httpCode, 'details' => $responseData]); - exit; -} - -// 3. Now, check for business-logic failure (like "Balance not enough"). -$errno = $responseData['Errno'] ?? -1; // Default to an error state if Errno is missing -if ($errno !== 0) { - $apiError = $responseData['Error'] ?? 'Unknown MTN API Error'; - error_log("MTN Confirm (Driver): Business failure for invoice {$invoice}. Errno: {$errno}, Reason: {$apiError}"); - // This now sends the specific error message in the format Flutter expects! - printFailure(['message' => $apiError, 'errno' => $errno, 'details' => $responseData]); - exit; -} - -// --- ONLY PROCEED TO DATABASE ON FULL SUCCESS (HTTP 200 AND Errno 0) --- -try { - $stmt = $con->prepare( - "UPDATE `paymentsLogSyriaDriver` SET status = 1, updated_at = NOW() - WHERE order_ref = :inv" - ); - $stmt->execute([':inv' => $invoice]); - error_log("MTN Confirm (Driver): Payment updated successfully in DB for invoice={$invoice}"); - - // The file path correction from before remains important. - include_once __DIR__ . '/finalize_wallet_payment.php'; - - // Call the wallet finalization logic - if (function_exists('finalizeWalletPayment')) { - $_GET['orderRef'] = $invoice; - finalizeWalletPayment($con); - } else { - error_log("MTN Confirm (Driver): FATAL - finalizeWalletPayment() function does not exist after include."); - } - - // On success, send a success response to Flutter - printSuccess(['message' => 'Payment confirmed successfully', 'details' => $responseData]); - -} catch (PDOException $e) { - error_log("MTN Confirm (Driver): DB update error - " . $e->getMessage()); - printFailure("Database processing error."); -} - diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/driver/finalize_wallet_payment.php b/walletintaleq.intaleq.xyz/v2/main/ride/mtn/driver/finalize_wallet_payment.php deleted file mode 100755 index 1c37d73..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/driver/finalize_wallet_payment.php +++ /dev/null @@ -1,103 +0,0 @@ -<?php -// wallet/finalize_wallet_payment.php -include_once "../../../jwtconnect.php"; - -define("LOG_FILE", "../logs/payment_verification.log"); - -function logError($step, $message, $data = null) { - $logDir = dirname(LOG_FILE); - if (!is_dir($logDir)) { mkdir($logDir, 0755, true); } - $logEntry = "[" . date('Y-m-d H:i:s') . "] STEP {$step}: {$message}"; - if ($data !== null) { $logEntry .= " | Data: " . json_encode($data, JSON_UNESCAPED_UNICODE); } - file_put_contents(LOG_FILE, $logEntry . PHP_EOL, FILE_APPEND); -} - -function generateToken($con, $driverId, $amount): ?string { - global $secretKey; - $data = $driverId . $amount . time() . ($secretKey ?? 'default_secret'); - $hash = hash('sha256', $data); - $randomBytes = bin2hex(random_bytes(16)); - $token = substr($hash . $randomBytes, 0, 64); - - $stmt = $con->prepare("INSERT INTO payment_tokens (token, driverID, dateCreated, amount) VALUES (:token, :driverID, NOW(), :amount)"); - $stmt->execute([':token' => $token, ':driverID' => $driverId, ':amount' => $amount]); - return $stmt->rowCount() > 0 ? $token : null; -} - -function generatePaymentID($con, $driverId, $amount, $method): ?string { - $stmt = $con->prepare("INSERT INTO paymentsDriverPoints (`amount`, `payment_method`, `driverID`) VALUES (:amount, :method, :driverID)"); - $stmt->execute([':driverID' => $driverId, ':amount' => $amount, ':method' => $method]); - return $stmt->rowCount() > 0 ? $con->lastInsertId() : null; -} - -function finalizeWalletPayment($con) { - $orderRef = $_GET['orderRef'] ?? null; - if (empty($orderRef)) { - logError("FINALIZE", "Missing orderRef"); - return; - } - - // 1. تحقق من الدفع - $stmt = $con->prepare("SELECT * FROM `paymentsLogSyriaDriver` WHERE order_ref = :order_ref AND status = 1 LIMIT 1"); - $stmt->execute([':order_ref' => $orderRef]); - $payment = $stmt->fetch(PDO::FETCH_ASSOC); - - if (!$payment) { - logError("FINALIZE", "Payment not found or not completed", ['orderRef' => $orderRef]); - return; - } - - try { - $driverId = $payment['user_id']; - $originalAmount = floatval($payment['amount']); - $paymentMethod = $payment['payment_method'] ?? 'ecash'; - - // حساب المكافأة - $bonusAmount = match ((int)$originalAmount) { - 10000 => 10000.0, - 20000 => 21000.0, - 40000 => 45000.0, - 100000 => 110000.0, - default => $originalAmount, - }; - - // إنشاء التوكنات - $tokenDriver = generateToken($con, $driverId, $bonusAmount); - if (!$tokenDriver) throw new Exception('Failed to generate driver token'); - - $tokenSefer = generateToken($con, $driverId, $originalAmount); - if (!$tokenSefer) throw new Exception('Failed to generate sefer token'); - - $paymentID = generatePaymentID($con, $driverId, $bonusAmount, $paymentMethod); - if (!$paymentID) throw new Exception('Failed to generate payment ID'); - - // driverWallet - $insertDriver = $con->prepare("INSERT INTO driverWallet (driverID, paymentID, amount, paymentMethod) VALUES (:driverID, :paymentID, :amount, :paymentMethod)"); - $insertDriver->execute([ - ':driverID' => $driverId, - ':paymentID' => $paymentID, - ':amount' => $bonusAmount, - ':paymentMethod' => $paymentMethod - ]); - if ($insertDriver->rowCount() === 0) throw new Exception('Insert to driverWallet failed'); - - $con->prepare("UPDATE payment_tokens SET isUsed = TRUE WHERE token = :token")->execute([':token' => $tokenDriver]); - - // seferWallet - $insertSefer = $con->prepare("INSERT INTO seferWallet (driverId, passengerId, amount, paymentMethod, token, createdAt) - VALUES (:driverId, :passengerId, :amount, :paymentMethod, :token, CURRENT_TIMESTAMP)"); - $insertSefer->execute([ - ':driverId' => $driverId, - ':passengerId' => 'driver', - ':amount' => $originalAmount, - ':paymentMethod' => $paymentMethod, - ':token' => $tokenSefer - ]); - $con->prepare("UPDATE payment_tokens SET isUsed = TRUE WHERE token = :token")->execute([':token' => $tokenSefer]); - - logError("FINALIZE", "Wallets updated successfully", ['orderRef' => $orderRef]); - printSuccess("FINALIZE", "Wallets updated successfully"); - } catch (Throwable $e) { - logError("FINALIZE", "Exception during finalization: " . $e->getMessage(), ['orderRef' => $orderRef]); - } -} \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/driver/generate_keys.php b/walletintaleq.intaleq.xyz/v2/main/ride/mtn/driver/generate_keys.php deleted file mode 100755 index 05d1fe4..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/driver/generate_keys.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php -// File: generate_keys.php -// الوظيفة: إنشاء زوج المفاتيح (العام والخاص) لمرة واحدة فقط - -// إعدادات لتوليد المفتاح -$config = [ - "digest_alg" => "sha256", - "private_key_bits" => 1024, - "private_key_type" => OPENSSL_KEYTYPE_RSA, -]; - -// إنشاء زوج المفاتيح -$res = openssl_pkey_new($config); - -if (!$res) { - die('Failed to generate new private key. Error: ' . openssl_error_string()); -} - -// استخراج المفتاح الخاص -openssl_pkey_export($res, $private_key); - -// استخراج المفتاح العام -$public_key_details = openssl_pkey_get_details($res); -$public_key = $public_key_details["key"]; - -// حفظ المفاتيح في ملفات -file_put_contents('private_key.pem', $private_key); -file_put_contents('public_key.pem', $public_key); - -echo "<h1>Keys Generated Successfully!</h1>"; -echo "<h2>Private Key (saved to private_key.pem):</h2>"; -echo "<pre>" . htmlspecialchars($private_key) . "</pre>"; -echo "<h2>Public Key (saved to public_key.pem):</h2>"; -echo "<pre>" . htmlspecialchars($public_key) . "</pre>"; - -// --- تحضير المفتاح العام لعملية التفعيل --- -// إزالة الهيدر والفوتر والأسطر الجديدة كما هو مطلوب -$formatted_public_key = str_replace("-----BEGIN PUBLIC KEY-----", "", $public_key); -$formatted_public_key = str_replace("-----END PUBLIC KEY-----", "", $formatted_public_key); -$formatted_public_key = preg_replace("/\s+/", "", $formatted_public_key); - - -echo "<h2>Formatted Public Key (for Terminal Activation):</h2>"; -echo "<p><strong>انسخ هذا المفتاح لاستخدامه في خطوة تفعيل الجهاز (activate_terminal.php)</strong></p>"; -echo "<textarea rows='5' cols='80' readonly>" . htmlspecialchars($formatted_public_key) . "</textarea>"; - -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/driver/initiate_payment.php b/walletintaleq.intaleq.xyz/v2/main/ride/mtn/driver/initiate_payment.php deleted file mode 100755 index 47bffea..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/driver/initiate_payment.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php -// /v1/main/ride/mtn/passenger/initiate_payment.php -include "../../../connect.php"; - -$baseUrl = rtrim(getenv('MTN_API_BASE_URL'), '/'); -$terminalId = getenv('MTN_TERMINAL_ID'); -$privateKeyPem = getenv('MTN_PRIVATE_KEY'); - -$invoice = filterRequest('invoice'); // رقم الفاتورة -$phone = filterRequest('phone'); // رقم الزبون -$guid = uniqid('mtn_'); - -if (!$invoice || !$phone) { - printFailure("Missing invoice or phone."); - exit; -} - -$body = json_encode([ - 'Invoice' => intval($invoice), - 'Phone' => $phone, - 'Guid' => $guid -], JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE); - -$hash = hash('sha256', $body, true); -openssl_sign($hash, $sig, $privateKeyPem, OPENSSL_ALGO_SHA256); -$xSignature = base64_encode($sig); - -$ch = curl_init("{$baseUrl}/pos_web/payment_phone/initiate"); -curl_setopt_array($ch, [ - CURLOPT_POST => true, - CURLOPT_POSTFIELDS => $body, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HTTPHEADER => [ - "Content-Type: application/json", - "Request-Name: pos_web/payment_phone/initiate", - "Subject: {$terminalId}", - "X-Signature: {$xSignature}" - ] -]); -$response = curl_exec($ch); -$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); -curl_close($ch); - -// سجل المحاولة مع Guid -$stmt = $con->prepare( - "UPDATE `mtn_payments` - SET guid = :guid, status = 3, updated_at = NOW() - WHERE invoice = :inv" -); -$stmt->execute([':guid'=>$guid, ':inv'=>$invoice]); - -header('Content-Type: application/json'); -http_response_code($httpCode); -echo $response; \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/driver/key.php b/walletintaleq.intaleq.xyz/v2/main/ride/mtn/driver/key.php deleted file mode 100755 index eaf9c08..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/driver/key.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php -// بيانات التفعيل -$terminalId = "9001000000060863"; -$activationCode = "26164711"; -$serialNumber = "INTALEQ-001"; // يمكنك تغييره - -// المفتاح العام على سطر واحد — بدون BEGIN/END وبدون أسطر جديدة -//$publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDNxFbepx2OrpyrNG4+/aAaH3Rjc8dGw6B6vMAfsZzzm4wzoSkrtsr6jfuaMTZRLwxS5h8k1ztLG1HrOmL/NDsiE/7yxaKLAIZyWB/rR9byvPeOCC8QnCd/08kmxNl/l7Akn6qlPwsVpKUUNsr0SkU9lShMAw4OBgQq399jsbkFSwIDAQAB"; -$publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDOhVAdUyxFpVNSyjRndMWEPAN9vJEetMzLbjF9DTn2lPVuRj/Mkwq9wCNhy+tdeX2lIn4K3EkONBvYJubBhxnYOoQuMchPW5vG7VnmpLjZ7TkpM2n9fcMu8u1GkLatLblDI4LTfvn3851+nhpnYlUVkjw5GAhH4XnEpveIjqDhzQIDAQAB"; -// جسم الطلب -$body = [ - "Key" => $publicKey, - "Secret" => $activationCode, - "Serial" => $serialNumber -]; -//$bodyJson = json_encode($body, JSON_UNESCAPED_SLASHES); -$bodyJson = trim(stripslashes(json_encode($body, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_LINE_TERMINATORS)),'"'); -//$bodyJson = json_encode($body, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); -// 1. توليد هاش SHA256 للـ JSON -//$bodyHash = hash('sha256', $bodyJson, true); - -// 2. تحميل المفتاح الخاص للتوقيع -$privateKey = openssl_pkey_get_private(file_get_contents("private_key.pem")); // تأكد من وجود هذا الملف بجانب السكربت - -// 3. توقيع الهاش -openssl_sign($bodyJson, $signature, $privateKey, OPENSSL_ALGO_SHA256); - -// 4. تحويل التوقيع إلى Base64 -$xSignature = base64_encode($signature); - -// 5. إرسال الطلب -$headers = [ - "Content-Type: application/json", - "Accept-Language: en", - "Request-Name: pos_web/pos/activate", - "Subject: $terminalId", - "X-Signature: $xSignature" -]; - -$ch = curl_init("https://cashmobile.mtnsyr.com:9000"); -curl_setopt($ch, CURLOPT_POST, true); -curl_setopt($ch, CURLOPT_POSTFIELDS, $bodyJson); -curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); -curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - -$response = curl_exec($ch); -$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); -curl_close($ch); - -// ✅ النتيجة -header('Content-Type: application/json'); -echo json_encode([ - "httpCode" => $httpCode, - "response" => json_decode($response, true), - "sentBody" => $body, -]); \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/driver/mtn_start.php b/walletintaleq.intaleq.xyz/v2/main/ride/mtn/driver/mtn_start.php deleted file mode 100755 index 10e5b49..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/driver/mtn_start.php +++ /dev/null @@ -1,129 +0,0 @@ -<?php -include "../../../connect.php"; -date_default_timezone_set("Asia/Damascus"); - -// ========== إعدادات MTN ========== -$terminalId = "9001000000060863"; -$currencyCode = 760; -$sessionNumber = 0; -$ttl = 15; - -// ====== استقبال البيانات من فلاتر ====== -$amount = filterRequest("amount"); -$passengerId = filterRequest("passengerId"); -$phone = filterRequest("phone"); - -// ✅ Log مبدئي -error_log("🚦 START | passengerId: $passengerId | phone: $phone | amount: $amount"); - -// تحقق من المدخلات -if (empty($amount) || empty($passengerId) || empty($phone) || $amount <= 0) { - error_log("❌ Invalid input: amount=$amount, passengerId=$passengerId, phone=$phone"); - printFailure("بيانات الدفع غير كاملة أو غير صالحة."); - exit; -} - -// ====== توليد invoiceNumber و GUID ====== -$invoiceNumber = mt_rand(10000000000, 99999999999); -//$invoiceNumber = "MTN_" . $passengerId . "_" . time(); -$guid = uniqid("mtn_"); -error_log("🧾 Generated Invoice: $invoiceNumber"); -error_log("🧭 Generated GUID: $guid"); - -// ====== 1. إنشاء الفاتورة ====== -$createInvoiceBody = [ - "Amount" => intval($amount * 100), - "Invoice" => $invoiceNumber, - "Session" => $sessionNumber, - "TTL" => $ttl -]; -error_log("📦 Create Invoice Body: " . json_encode($createInvoiceBody, JSON_UNESCAPED_UNICODE)); -$invoiceResponse = sendMtnApiRequest("pos_web/invoice/create", $terminalId, $createInvoiceBody); -error_log("📥 Create Invoice Response: " . json_encode($invoiceResponse, JSON_UNESCAPED_UNICODE)); - -if (!$invoiceResponse || isset($invoiceResponse['Errno']) && $invoiceResponse['Errno'] != 0) { - error_log("❌ Failed to create invoice. Error: " . json_encode($invoiceResponse)); - printFailure("فشل إنشاء الفاتورة عبر MTN."); - exit; -} - -// ====== 2. بدء الدفع ====== -$initiateBody = [ - "Invoice" => $invoiceNumber, - "Phone" => $phone, - "Guid" => $guid -]; -error_log("📤 body initiateBody: $initiateBody"); -error_log("📦 Initiate Payment Body: " . json_encode($initiateBody, JSON_UNESCAPED_UNICODE)); -$initiateResponse = sendMtnApiRequest("pos_web/payment_phone/initiate", $terminalId, $initiateBody); -error_log("📥 Initiate Response: " . json_encode($initiateResponse, JSON_UNESCAPED_UNICODE)); - -if (!$initiateResponse || !isset($initiateResponse['OperationNumber'])) { - error_log("❌ Failed to initiate payment."); - printFailure($initiateResponse); - exit; -} - -$operationNumber = $initiateResponse['OperationNumber']; - -// ====== 3. تسجيل العملية ====== -try { - $stmt = $con->prepare("INSERT INTO `paymentsLogSyriaDriver` - (`user_id`, `amount`, `status`, `order_ref`, `payment_method`, `created_at`) - VALUES (?, ?, 2, ?, 'mtn', NOW())"); - $stmt->execute([$passengerId, $amount, $invoiceNumber]); - error_log("✅ DB Log Inserted."); -} catch (PDOException $e) { - error_log("❌ DB ERROR: " . $e->getMessage()); - printFailure("فشل في تسجيل العملية."); - exit; -} - -// ====== 4. نجاح -error_log("✅ Payment initiation successful."); -printSuccess([ - "invoiceNumber" => $invoiceNumber, - "operationNumber" => $operationNumber, - "guid" => $guid -]); - - -// ====== دالة إرسال الطلب ===================== -function sendMtnApiRequest($requestName, $terminalId, $body) -{ - $apiUrl = "https://cashmobile.mtnsyr.com:9000"; - $privateKey = openssl_pkey_get_private(file_get_contents("private_key.pem")); - - // ✅ تحويل الـ body إلى JSON بدون فراغات أو أسطر - $bodyJson = trim(stripslashes(json_encode($body, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_LINE_TERMINATORS)), '"'); -//$bodyJson = json_encode($body, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); - // ✅ توليد التوقيع - // $bodyHash = hash('sha256', $bodyJson, true); - error_log("📤 body before JSON: $bodyJson"); - openssl_sign($bodyJson, $signature, $privateKey, OPENSSL_ALGO_SHA256); - $xSignature = base64_encode($signature); -error_log("📤 body xSignature: $xSignature"); - // ✅ رؤوس الطلب - $headers = [ - "Content-Type: application/json", - "Accept-Language: en", - "Request-Name: $requestName", - "Subject: $terminalId", - "X-Signature: $xSignature" - ]; - - $ch = curl_init($apiUrl); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $bodyJson); - curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - $response = curl_exec($ch); - - // ✅ لوق داخلي - error_log("🔐 Signature for $requestName: $xSignature"); - error_log("📤 Sent JSON: $bodyJson"); - - curl_close($ch); - return json_decode($response, true); -} \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/driver/private_key.pem b/walletintaleq.intaleq.xyz/v2/main/ride/mtn/driver/private_key.pem deleted file mode 100644 index fead7a6..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/driver/private_key.pem +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXwIBAAKBgQDOhVAdUyxFpVNSyjRndMWEPAN9vJEetMzLbjF9DTn2lPVuRj/M -kwq9wCNhy+tdeX2lIn4K3EkONBvYJubBhxnYOoQuMchPW5vG7VnmpLjZ7TkpM2n9 -fcMu8u1GkLatLblDI4LTfvn3851+nhpnYlUVkjw5GAhH4XnEpveIjqDhzQIDAQAB -AoGBALRcAvqJT8nHN7y+8QNFHNZ+XwIpc4egmJY1Ny0iJvPtZWaYHVG5PRE4Qu4+ -29+3oX5dYDx146tu4L5mQvLS3ULBsvxaUZt2lT/vxkQzI9pNfXw584WvIrbtxQod -ILvBcnamwQa9hEOIFZVyZ/hzkzUcMO6cAXqvsfqqPgJhm7PBAkEA+xgE9CUOLDFl -vLePQKGcHIUOsPLr16qNEgGhTW7Km3OMMqoB2f7t67xOHGqK6tnANRM4Sk6IModI -wbZuVh4jMQJBANKOVmIdDLNffZVHp90SDRG7/YdK2R5ob361CIkcUzjh927Wfs5W -A/WroB7eJ7pWiq2BMaj/xq65nYaCOldvaV0CQQDm12c+eY61DFjnDa6ykaEvCxi9 -jydJp+93vW3o/VFhZvJeZbO8EcX0MrNxJnY+gSBW6yuWDOrj4UH/bVO08pIRAkEA -lH3TiBAqo9nlTEEjrnILi4VD0IVFx/8pGnf71A6I1qXuBVn6RfQ9iKWIIBzWccCU -vrZNWn1AFntLD9CJ6p3k9QJBAMbSQ9CoXWlOLJRduV15ER1ZyE/inVd4jIvtjAgz -b7QaM62Ecxl3D8EI/LTSZV9Oa8D/62cJeMsflVa7gpavL70= ------END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/driver/public_key.pem b/walletintaleq.intaleq.xyz/v2/main/ride/mtn/driver/public_key.pem deleted file mode 100644 index 63a3519..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/driver/public_key.pem +++ /dev/null @@ -1,6 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDqBQZEJXWCQwPsPzBM70M3TjyU -5vwCZWoEtUomR9Qu+dEQaa0Hniz6JY8+goCxfMYuZQw6+kimctA2KqzT2pCsJufN -b92pSAMZgb0RSTl2y62oJkJd2WY7dj36AvPEyw6DxCFItvFOu7HGl3LlHQBriiw3 -jwtuS6DO7gbmAJPU8wIDAQAB ------END PUBLIC KEY----- diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/driver_payout_syria.php b/walletintaleq.intaleq.xyz/v2/main/ride/mtn/driver_payout_syria.php deleted file mode 100755 index 0c86897..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/driver_payout_syria.php +++ /dev/null @@ -1,115 +0,0 @@ -<?php - -include "../../connect.php"; - -// --- 2. استقبال البيانات من الطلب --- -$driver_id = filterRequest("driver_id"); -$driver_name = filterRequest("driver_name"); -$amount = filterRequest("amount"); -$wallet_type = filterRequest("wallet_type"); -$wallet_number = filterRequest("wallet_number"); - -// التحقق من أن البيانات الأساسية موجودة -if (empty($driver_id) || empty($driver_name) || empty($amount) || empty($wallet_type) || empty($wallet_number)) { - printFailure('Missing required fields.'); - exit(); -} - -// --- 3. إدراج الطلب في قاعدة البيانات --- -try { - $sql = "INSERT INTO driver_withdrawal_requests (driver_id, driver_name, amount, wallet_type, wallet_number) VALUES (?, ?, ?, ?, ?)"; - $stmt = $con->prepare($sql); - - // تنفيذ الاستعلام مع تمرير البيانات - $success = $stmt->execute([ - $driver_id, - $driver_name, - $amount, - $wallet_type, - $wallet_number - ]); - - if ($success) { - // --- 4. الحصول على رقم الطلب وإرسال إشعار واتساب --- - $transaction_id = $con->lastInsertId(); // الحصول على رقم التعريف الخاص بالطلب الجديد - sendWhatsAppNotification($transaction_id, $driver_name, $amount, $wallet_type, $wallet_number); - - // إرسال استجابة نجاح إلى التطبيق - printSuccess("Withdrawal request saved and notification sent."); - - } else { - printFailure('Failed to save withdrawal request.'); - } - -} catch (PDOException $e) { - // التعامل مع أخطاء قاعدة البيانات - error_log("Database Error in request_withdrawal.php: " . $e->getMessage()); - printFailure('A database error occurred.'); -} - - -/** - * دالة لإرسال إشعار إلى خدمة العملاء عبر RaseelPlus API - */ -function sendWhatsAppNotification($transaction_id, $driver_name, $amount, $wallet_type, $wallet_number) { - - // استخدام متغيرات البيئة (Environment Variables) هو الطريقة الأكثر أماناً لإدارة المعلومات الحساسة - // بدلاً من كتابتها مباشرة في الكود. - $customer_service_number = getenv('CUSTOMER_SERVICE_WHATSAPP'); - // $customer_service_number = "9639XXXXXXXX"; // كرقم احتياطي مؤقت - - // نص الرسالة مع إضافة رقم الطلب - $messageBody = "طلب سحب جديد (رقم الطلب: #$transaction_id):\n\n" . - "اسم السائق: " . $driver_name . "\n" . - "المبلغ: " . $amount . " ل.س\n" . - "نوع المحفظة: " . $wallet_type . "\n" . - "رقم المحفظة: " . $wallet_number; - - // بيانات الطلب (Payload) للـ API - $payload = [ - "number" => $customer_service_number, - "type" => "text", - "message" => $messageBody, - "instance_id" => getenv('instance_idWhatsApp'); - "access_token" => getenv('access_tokenWhatsApp'); - ]; - - // استدعاء الـ API - // ملاحظة: لا نتحقق من استجابة الـ API هنا لأن العملية الرئيسية (حفظ الطلب) قد نجحت بالفعل. - // يمكن إضافة تسجيل للأخطاء إذا لزم الأمر. - callAPI_Withdrawal("POST", "https://raseelplus.com/api/send", json_encode($payload)); -} - - -/** - * دالة لإجراء استدعاءات API باستخدام cURL - */ -function callAPI_Withdrawal($method, $url, $data) { - $curl = curl_init(); - curl_setopt_array($curl, [ - CURLOPT_URL => $url, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => "", - CURLOPT_MAXREDIRS => 10, - CURLOPT_TIMEOUT => 30, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => $method, - CURLOPT_POSTFIELDS => $data, - CURLOPT_HTTPHEADER => [ - "Content-Type: application/json", - "Accept: application/json" - ], - ]); - $response = curl_exec($curl); - $err = curl_error($curl); - curl_close($curl); - - if ($err) { - // تسجيل الخطأ في سجلات الخادم للمراجعة لاحقًا - error_log("[callAPI_Withdrawal] cURL Error #: " . $err); - return null; - } else { - return json_decode($response); - } -} -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/passenger/confirm_payment.php b/walletintaleq.intaleq.xyz/v2/main/ride/mtn/passenger/confirm_payment.php deleted file mode 100755 index 6de8265..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/passenger/confirm_payment.php +++ /dev/null @@ -1,169 +0,0 @@ -<?php -// /v1/main/ride/mtn/passenger/confirm_payment.php -include "../../../connect.php"; - -$baseUrl = rtrim(getenv('MTN_API_BASE_URL'), '/'); -$terminalId = getenv('MTN_TERMINAL_ID'); -$privateKeyPem = getenv('MTN_PRIVATE_KEY'); -$privateKey = openssl_pkey_get_private(file_get_contents("private_key.pem")); -$invoice = filterRequest('invoiceNumber'); -$phone = filterRequest('phone'); -$guid = filterRequest('guid'); -$operationNumber = filterRequest('operationNumber'); -$code = filterRequest('otp'); // الـ OTP - -error_log("MTN Confirm: Start request for invoice={$invoice}, phone={$phone}, guid={$guid}, opNum={$operationNumber}"); - -if (!$invoice || !$phone || !$guid || !$operationNumber || !$code) { - error_log("MTN Confirm: Missing parameters"); - printFailure("Missing parameters."); - exit; -} - -// تشفير الكود -$hashBin = hash('sha256', $code, true); -$codeB64 = base64_encode($hashBin); - -$body = [ - 'Invoice' => intval($invoice), - 'Phone' => $phone, - 'Guid' => $guid, - 'OperationNumber' => intval($operationNumber), - 'Code' => $codeB64 -]; -$bodyJson = trim(stripslashes(json_encode($body, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_LINE_TERMINATORS)), '"'); - -error_log("MTN Confirm: Prepared body JSON: " . $bodyJson); - -// توليد التوقيع -$signResult = openssl_sign($bodyJson, $sig, $privateKey, OPENSSL_ALGO_SHA256); -if (!$signResult) { - error_log("MTN Confirm: Failed to generate signature"); - printFailure("Signature error."); - exit; -} -$xSignature = base64_encode($sig); -error_log("MTN Confirm: Generated signature"); - -// إرسال الطلب -$ch = curl_init("{$baseUrl}/pos_web/payment_phone/confirm"); -curl_setopt_array($ch, [ - CURLOPT_POST => true, - CURLOPT_POSTFIELDS => $bodyJson, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HTTPHEADER => [ - "Content-Type: application/json", - "Request-Name: pos_web/payment_phone/confirm", - "Subject: {$terminalId}", - "X-Signature: {$xSignature}" - ] -]); - -$response = curl_exec($ch); -$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); -$curlError = curl_error($ch); -curl_close($ch); - -error_log("MTN Confirm: HTTP $httpCode - Response: $response"); -if ($curlError) { - error_log("MTN Confirm: cURL error - $curlError"); -} - -// تحديث قاعدة البيانات في حال نجاح -if ($httpCode === 200) { - try { - $stmt = $con->prepare( - "UPDATE `paymentsLogSyria` SET status = 1, updated_at = NOW() - WHERE order_ref = :inv" - ); - $stmt->execute([':inv' => $invoice]); - error_log("MTN Confirm: Payment updated successfully in DB for invoice={$invoice}"); - - $stmt = $con->prepare("SELECT * FROM paymentsLogSyria WHERE order_ref = :order_ref LIMIT 1"); - $stmt->execute([':order_ref' => $invoice]); - $payment = $stmt->fetch(PDO::FETCH_ASSOC); - - if ($payment) { - $userId = $payment['user_id']; - $amount = $payment['amount']; - $paymentMethod = $payment['payment_method'] ?? 'mtn'; - - $finalAmount = calculateBonus($amount); - $token = generatePaymentToken($userId, $finalAmount); - $walletResult = addToPassengerWallet($userId, $finalAmount, $token); - - $seferToken = generatePaymentToken($userId, $amount); - $seferWalletResult = addToSeferWallet($userId, $amount, $paymentMethod, $seferToken); - - printSuccess('MTN Confirm'); - - exit; - } - - - } catch (PDOException $e) { - error_log("MTN Confirm: DB update error - " . $e->getMessage()); - } -} else { - error_log("MTN Confirm: Payment failed with HTTP code $httpCode"); -} - -header('Content-Type: application/json'); -http_response_code($httpCode); -echo $response; - -function calculateBonus($amount) { - if ($amount == 200000) return 205000; - if ($amount == 400000) return 425000; - if ($amount == 1000000) return 1040000; - return $amount; -} - -function generatePaymentToken($passengerId, $amount) { - $url = BASE_URL . "/passengerWallet/addPaymentTokenPassenger.php"; - $postData = ['passengerId' => $passengerId, 'amount' => $amount]; - $ch = curl_init($url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData)); - $response = curl_exec($ch); - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - curl_close($ch); - if ($httpCode != 200) return null; - $data = json_decode($response, true); - return $data['message'] ?? null; -} -function addToPassengerWallet($passengerId, $amount, $token) { - $url = BASE_URL . "/passengerWallet/add.php"; - $postData = ['passenger_id' => $passengerId, 'balance' => $amount, 'token' => $token]; - $ch = curl_init($url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData)); - $response = curl_exec($ch); - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - curl_close($ch); - if ($httpCode != 200) return null; - return json_decode($response, true); -} - -function addToSeferWallet($passengerId, $amount, $paymentMethod, $token) { - $url = BASE_URL . "/seferWallet/add.php"; - $postData = [ - 'amount' => $amount, - 'paymentMethod' => $paymentMethod, - 'passengerId' => $passengerId, - 'token' => $token, - 'driverId' => 'passenger' - ]; - $ch = curl_init($url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData)); - $response = curl_exec($ch); - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - curl_close($ch); - if ($httpCode != 200) return null; - return json_decode($response, true); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/passenger/finalize_wallet_payment.php b/walletintaleq.intaleq.xyz/v2/main/ride/mtn/passenger/finalize_wallet_payment.php deleted file mode 100755 index 1c37d73..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/passenger/finalize_wallet_payment.php +++ /dev/null @@ -1,103 +0,0 @@ -<?php -// wallet/finalize_wallet_payment.php -include_once "../../../jwtconnect.php"; - -define("LOG_FILE", "../logs/payment_verification.log"); - -function logError($step, $message, $data = null) { - $logDir = dirname(LOG_FILE); - if (!is_dir($logDir)) { mkdir($logDir, 0755, true); } - $logEntry = "[" . date('Y-m-d H:i:s') . "] STEP {$step}: {$message}"; - if ($data !== null) { $logEntry .= " | Data: " . json_encode($data, JSON_UNESCAPED_UNICODE); } - file_put_contents(LOG_FILE, $logEntry . PHP_EOL, FILE_APPEND); -} - -function generateToken($con, $driverId, $amount): ?string { - global $secretKey; - $data = $driverId . $amount . time() . ($secretKey ?? 'default_secret'); - $hash = hash('sha256', $data); - $randomBytes = bin2hex(random_bytes(16)); - $token = substr($hash . $randomBytes, 0, 64); - - $stmt = $con->prepare("INSERT INTO payment_tokens (token, driverID, dateCreated, amount) VALUES (:token, :driverID, NOW(), :amount)"); - $stmt->execute([':token' => $token, ':driverID' => $driverId, ':amount' => $amount]); - return $stmt->rowCount() > 0 ? $token : null; -} - -function generatePaymentID($con, $driverId, $amount, $method): ?string { - $stmt = $con->prepare("INSERT INTO paymentsDriverPoints (`amount`, `payment_method`, `driverID`) VALUES (:amount, :method, :driverID)"); - $stmt->execute([':driverID' => $driverId, ':amount' => $amount, ':method' => $method]); - return $stmt->rowCount() > 0 ? $con->lastInsertId() : null; -} - -function finalizeWalletPayment($con) { - $orderRef = $_GET['orderRef'] ?? null; - if (empty($orderRef)) { - logError("FINALIZE", "Missing orderRef"); - return; - } - - // 1. تحقق من الدفع - $stmt = $con->prepare("SELECT * FROM `paymentsLogSyriaDriver` WHERE order_ref = :order_ref AND status = 1 LIMIT 1"); - $stmt->execute([':order_ref' => $orderRef]); - $payment = $stmt->fetch(PDO::FETCH_ASSOC); - - if (!$payment) { - logError("FINALIZE", "Payment not found or not completed", ['orderRef' => $orderRef]); - return; - } - - try { - $driverId = $payment['user_id']; - $originalAmount = floatval($payment['amount']); - $paymentMethod = $payment['payment_method'] ?? 'ecash'; - - // حساب المكافأة - $bonusAmount = match ((int)$originalAmount) { - 10000 => 10000.0, - 20000 => 21000.0, - 40000 => 45000.0, - 100000 => 110000.0, - default => $originalAmount, - }; - - // إنشاء التوكنات - $tokenDriver = generateToken($con, $driverId, $bonusAmount); - if (!$tokenDriver) throw new Exception('Failed to generate driver token'); - - $tokenSefer = generateToken($con, $driverId, $originalAmount); - if (!$tokenSefer) throw new Exception('Failed to generate sefer token'); - - $paymentID = generatePaymentID($con, $driverId, $bonusAmount, $paymentMethod); - if (!$paymentID) throw new Exception('Failed to generate payment ID'); - - // driverWallet - $insertDriver = $con->prepare("INSERT INTO driverWallet (driverID, paymentID, amount, paymentMethod) VALUES (:driverID, :paymentID, :amount, :paymentMethod)"); - $insertDriver->execute([ - ':driverID' => $driverId, - ':paymentID' => $paymentID, - ':amount' => $bonusAmount, - ':paymentMethod' => $paymentMethod - ]); - if ($insertDriver->rowCount() === 0) throw new Exception('Insert to driverWallet failed'); - - $con->prepare("UPDATE payment_tokens SET isUsed = TRUE WHERE token = :token")->execute([':token' => $tokenDriver]); - - // seferWallet - $insertSefer = $con->prepare("INSERT INTO seferWallet (driverId, passengerId, amount, paymentMethod, token, createdAt) - VALUES (:driverId, :passengerId, :amount, :paymentMethod, :token, CURRENT_TIMESTAMP)"); - $insertSefer->execute([ - ':driverId' => $driverId, - ':passengerId' => 'driver', - ':amount' => $originalAmount, - ':paymentMethod' => $paymentMethod, - ':token' => $tokenSefer - ]); - $con->prepare("UPDATE payment_tokens SET isUsed = TRUE WHERE token = :token")->execute([':token' => $tokenSefer]); - - logError("FINALIZE", "Wallets updated successfully", ['orderRef' => $orderRef]); - printSuccess("FINALIZE", "Wallets updated successfully"); - } catch (Throwable $e) { - logError("FINALIZE", "Exception during finalization: " . $e->getMessage(), ['orderRef' => $orderRef]); - } -} \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/passenger/generate_keys.php b/walletintaleq.intaleq.xyz/v2/main/ride/mtn/passenger/generate_keys.php deleted file mode 100755 index 05d1fe4..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/passenger/generate_keys.php +++ /dev/null @@ -1,47 +0,0 @@ -<?php -// File: generate_keys.php -// الوظيفة: إنشاء زوج المفاتيح (العام والخاص) لمرة واحدة فقط - -// إعدادات لتوليد المفتاح -$config = [ - "digest_alg" => "sha256", - "private_key_bits" => 1024, - "private_key_type" => OPENSSL_KEYTYPE_RSA, -]; - -// إنشاء زوج المفاتيح -$res = openssl_pkey_new($config); - -if (!$res) { - die('Failed to generate new private key. Error: ' . openssl_error_string()); -} - -// استخراج المفتاح الخاص -openssl_pkey_export($res, $private_key); - -// استخراج المفتاح العام -$public_key_details = openssl_pkey_get_details($res); -$public_key = $public_key_details["key"]; - -// حفظ المفاتيح في ملفات -file_put_contents('private_key.pem', $private_key); -file_put_contents('public_key.pem', $public_key); - -echo "<h1>Keys Generated Successfully!</h1>"; -echo "<h2>Private Key (saved to private_key.pem):</h2>"; -echo "<pre>" . htmlspecialchars($private_key) . "</pre>"; -echo "<h2>Public Key (saved to public_key.pem):</h2>"; -echo "<pre>" . htmlspecialchars($public_key) . "</pre>"; - -// --- تحضير المفتاح العام لعملية التفعيل --- -// إزالة الهيدر والفوتر والأسطر الجديدة كما هو مطلوب -$formatted_public_key = str_replace("-----BEGIN PUBLIC KEY-----", "", $public_key); -$formatted_public_key = str_replace("-----END PUBLIC KEY-----", "", $formatted_public_key); -$formatted_public_key = preg_replace("/\s+/", "", $formatted_public_key); - - -echo "<h2>Formatted Public Key (for Terminal Activation):</h2>"; -echo "<p><strong>انسخ هذا المفتاح لاستخدامه في خطوة تفعيل الجهاز (activate_terminal.php)</strong></p>"; -echo "<textarea rows='5' cols='80' readonly>" . htmlspecialchars($formatted_public_key) . "</textarea>"; - -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/passenger/initiate_payment.php b/walletintaleq.intaleq.xyz/v2/main/ride/mtn/passenger/initiate_payment.php deleted file mode 100755 index 47bffea..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/passenger/initiate_payment.php +++ /dev/null @@ -1,54 +0,0 @@ -<?php -// /v1/main/ride/mtn/passenger/initiate_payment.php -include "../../../connect.php"; - -$baseUrl = rtrim(getenv('MTN_API_BASE_URL'), '/'); -$terminalId = getenv('MTN_TERMINAL_ID'); -$privateKeyPem = getenv('MTN_PRIVATE_KEY'); - -$invoice = filterRequest('invoice'); // رقم الفاتورة -$phone = filterRequest('phone'); // رقم الزبون -$guid = uniqid('mtn_'); - -if (!$invoice || !$phone) { - printFailure("Missing invoice or phone."); - exit; -} - -$body = json_encode([ - 'Invoice' => intval($invoice), - 'Phone' => $phone, - 'Guid' => $guid -], JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE); - -$hash = hash('sha256', $body, true); -openssl_sign($hash, $sig, $privateKeyPem, OPENSSL_ALGO_SHA256); -$xSignature = base64_encode($sig); - -$ch = curl_init("{$baseUrl}/pos_web/payment_phone/initiate"); -curl_setopt_array($ch, [ - CURLOPT_POST => true, - CURLOPT_POSTFIELDS => $body, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HTTPHEADER => [ - "Content-Type: application/json", - "Request-Name: pos_web/payment_phone/initiate", - "Subject: {$terminalId}", - "X-Signature: {$xSignature}" - ] -]); -$response = curl_exec($ch); -$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); -curl_close($ch); - -// سجل المحاولة مع Guid -$stmt = $con->prepare( - "UPDATE `mtn_payments` - SET guid = :guid, status = 3, updated_at = NOW() - WHERE invoice = :inv" -); -$stmt->execute([':guid'=>$guid, ':inv'=>$invoice]); - -header('Content-Type: application/json'); -http_response_code($httpCode); -echo $response; \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/passenger/key.php b/walletintaleq.intaleq.xyz/v2/main/ride/mtn/passenger/key.php deleted file mode 100755 index eaf9c08..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/passenger/key.php +++ /dev/null @@ -1,56 +0,0 @@ -<?php -// بيانات التفعيل -$terminalId = "9001000000060863"; -$activationCode = "26164711"; -$serialNumber = "INTALEQ-001"; // يمكنك تغييره - -// المفتاح العام على سطر واحد — بدون BEGIN/END وبدون أسطر جديدة -//$publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDNxFbepx2OrpyrNG4+/aAaH3Rjc8dGw6B6vMAfsZzzm4wzoSkrtsr6jfuaMTZRLwxS5h8k1ztLG1HrOmL/NDsiE/7yxaKLAIZyWB/rR9byvPeOCC8QnCd/08kmxNl/l7Akn6qlPwsVpKUUNsr0SkU9lShMAw4OBgQq399jsbkFSwIDAQAB"; -$publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDOhVAdUyxFpVNSyjRndMWEPAN9vJEetMzLbjF9DTn2lPVuRj/Mkwq9wCNhy+tdeX2lIn4K3EkONBvYJubBhxnYOoQuMchPW5vG7VnmpLjZ7TkpM2n9fcMu8u1GkLatLblDI4LTfvn3851+nhpnYlUVkjw5GAhH4XnEpveIjqDhzQIDAQAB"; -// جسم الطلب -$body = [ - "Key" => $publicKey, - "Secret" => $activationCode, - "Serial" => $serialNumber -]; -//$bodyJson = json_encode($body, JSON_UNESCAPED_SLASHES); -$bodyJson = trim(stripslashes(json_encode($body, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_LINE_TERMINATORS)),'"'); -//$bodyJson = json_encode($body, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); -// 1. توليد هاش SHA256 للـ JSON -//$bodyHash = hash('sha256', $bodyJson, true); - -// 2. تحميل المفتاح الخاص للتوقيع -$privateKey = openssl_pkey_get_private(file_get_contents("private_key.pem")); // تأكد من وجود هذا الملف بجانب السكربت - -// 3. توقيع الهاش -openssl_sign($bodyJson, $signature, $privateKey, OPENSSL_ALGO_SHA256); - -// 4. تحويل التوقيع إلى Base64 -$xSignature = base64_encode($signature); - -// 5. إرسال الطلب -$headers = [ - "Content-Type: application/json", - "Accept-Language: en", - "Request-Name: pos_web/pos/activate", - "Subject: $terminalId", - "X-Signature: $xSignature" -]; - -$ch = curl_init("https://cashmobile.mtnsyr.com:9000"); -curl_setopt($ch, CURLOPT_POST, true); -curl_setopt($ch, CURLOPT_POSTFIELDS, $bodyJson); -curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); -curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - -$response = curl_exec($ch); -$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); -curl_close($ch); - -// ✅ النتيجة -header('Content-Type: application/json'); -echo json_encode([ - "httpCode" => $httpCode, - "response" => json_decode($response, true), - "sentBody" => $body, -]); \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/passenger/mtn_confirm.php b/walletintaleq.intaleq.xyz/v2/main/ride/mtn/passenger/mtn_confirm.php deleted file mode 100755 index 2e6d32b..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/passenger/mtn_confirm.php +++ /dev/null @@ -1,247 +0,0 @@ -<?php -// /v1/main/ride/mtn/passenger/confirm_payment.php -include "../../../connect.php"; -header('Content-Type: application/json; charset=utf-8'); - -/** - * Helpers - */ -function mlog(string $msg) { error_log($msg); } // timestamp يضاف تلقائياً من PHP - -// قاعدة URL للتطبيق (لمعالجة BASE_URL غير المعروفة) -if (!defined('BASE_URL')) { - $APP_BASE_URL = rtrim(getenv('APP_BASE_URL') ?: '', '/'); - if ($APP_BASE_URL === '') { - $scheme = isset($_SERVER['REQUEST_SCHEME']) ? $_SERVER['REQUEST_SCHEME'] : 'https'; - $host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost'; - define('BASE_URL', $scheme . '://' . $host); - } else { - define('BASE_URL', $APP_BASE_URL); - } -} - -try { - -$baseUrl = rtrim(getenv('MTN_API_BASE_URL'), '/'); -$terminalId = getenv('MTN_TERMINAL_ID'); -$privateKeyPem = getenv('MTN_PRIVATE_KEY'); -$privateKey = openssl_pkey_get_private(file_get_contents("private_key.pem")); -$invoice = filterRequest('invoiceNumber'); -$phone = filterRequest('phone'); -$guid = filterRequest('guid'); -$operationNumber = filterRequest('operationNumber'); -$code = filterRequest('otp'); // الـ OTP -$lang = filterRequest("lang"); - - mlog("MTN Confirm: Start request for invoice={$invoice}, phone={$phone}, guid={$guid}, opNum={$operationNumber}"); - - if (!$invoice || !$phone || !$guid || !$operationNumber || !$code) { - mlog("MTN Confirm: Missing parameters"); - printFailure("Missing parameters."); - exit; - } - - // تشفير الكود (SHA256 ثم Base64) - $hashBin = hash('sha256', $code, true); - $codeB64 = base64_encode($hashBin); - - // جسم الطلب نحو MTN - $body = [ - 'Invoice' => (int)$invoice, - 'Phone' => $phone, - 'Guid' => $guid, - 'OperationNumber' => (int)$operationNumber, - 'Code' => $codeB64, - 'Accept-Language' => $lang - ]; - $bodyJson = json_encode($body, JSON_UNESCAPED_UNICODE); - mlog("MTN Confirm: Prepared body JSON: " . $bodyJson); - - // توقيع الجسم - $sig = null; - $signResult = openssl_sign($bodyJson, $sig, $privateKey, OPENSSL_ALGO_SHA256); - if (!$signResult || !$sig) { - mlog("MTN Confirm: Failed to generate signature"); - printFailure("Signature error."); - exit; - } - $xSignature = base64_encode($sig); - mlog("MTN Confirm: Generated signature"); - - // إرسال الطلب إلى MTN - $ch = curl_init("{$baseUrl}/pos_web/payment_phone/confirm"); - curl_setopt_array($ch, [ - CURLOPT_POST => true, - CURLOPT_POSTFIELDS => $bodyJson, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HTTPHEADER => [ - "Content-Type: application/json", - "Request-Name: pos_web/payment_phone/confirm", - "Subject: {$terminalId}", - "X-Signature: {$xSignature}" - ], - CURLOPT_TIMEOUT => 25, - ]); - - $response = curl_exec($ch); - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - $curlError = curl_error($ch); - curl_close($ch); - - mlog("MTN Confirm: HTTP {$httpCode} - Response: " . ($response ?? '')); - if ($curlError) { - mlog("MTN Confirm: cURL error - {$curlError}"); - } - - // فك JSON لرد MTN (حتى لو خطأ) لعرض سبب واضح - $mtn = json_decode($response ?: '{}', true); - if (!is_array($mtn)) { - $mtn = []; - } - - // 🧠 سياسة القرار: - // - إذا HTTP≠200 → فشل شبكة/بوابة - // - إذا HTTP=200 لكن Errno≠0 → خطأ من MTN (مثل Incorrect sms code) - // - فقط إذا HTTP=200 && Errno=0 → نجاح، نحدّث DB ونضيف للمحافظ - if ($httpCode !== 200) { - // لا تحدّث DB - printFailure([ - 'message' => 'MTN confirm HTTP failure', - 'http' => $httpCode, - 'mtn' => $mtn - ]); - exit; - } - - // HTTP 200 — افحص Errno - $errno = isset($mtn['Errno']) ? (int)$mtn['Errno'] : null; - if ($errno !== 0) { - // لا تحدّث DB في هذه الحالة - $errText = isset($mtn['Error']) ? $mtn['Error'] : 'Unknown MTN error'; - // اطبع لوج مشابه للمثال المطلوب - // مثال: {"Errno":662,"Error":"Incorrect sms code","Abuse":2,"Transaction":""} - mlog("MTN Confirm: Business failure from MTN - Errno={$errno}, Error=" . json_encode($mtn, JSON_UNESCAPED_UNICODE)); - printFailure([ - 'message' => $errText, - 'errno' => $errno, - 'mtn' => $mtn - ]); - exit; - } - - // ✅ نجاح كامل من MTN — تحديث DB ثم المحافظ - try { - global $con; - - $stmt = $con->prepare( - "UPDATE `paymentsLogSyria` SET status = 1, updated_at = NOW() - WHERE order_ref = :inv" - ); - $stmt->execute([':inv' => $invoice]); - mlog("MTN Confirm: Payment updated successfully in DB for invoice={$invoice}"); - - $stmt = $con->prepare("SELECT * FROM paymentsLogSyria WHERE order_ref = :order_ref LIMIT 1"); - $stmt->execute([':order_ref' => $invoice]); - $payment = $stmt->fetch(PDO::FETCH_ASSOC); - - if (!$payment) { - mlog("MTN Confirm: Payment row not found after update"); - printFailure("Payment row not found"); - exit; - } - - $userId = $payment['user_id']; - $amount = $payment['amount']; - $paymentMethod = $payment['payment_method'] ?? 'mtn'; - - $finalAmount = calculateBonus($amount); - - $token = generatePaymentToken($userId, $finalAmount); - $walletResult = addToPassengerWallet($userId, $finalAmount, $token); - - $seferToken = generatePaymentToken($userId, $amount); - $seferWalletResult = addToSeferWallet($userId, $amount, $paymentMethod, $seferToken); - - // رجّع رد موحّد + ضمّن رد MTN - printSuccess([ - 'message' => 'MTN Confirm', - 'data' => [ - 'invoice' => $invoice, - 'finalAmount' => $finalAmount, - 'wallet' => $walletResult, - 'seferWallet' => $seferWalletResult, - 'mtn' => $mtn - ] - ]); - exit; - - } catch (PDOException $e) { - mlog("MTN Confirm: DB update error - " . $e->getMessage()); - printFailure("DB error"); - exit; - } - -} catch (Throwable $e) { - mlog("MTN Confirm: Exception - " . $e->getMessage()); - printFailure("Server error"); - exit; -} - -/** - * نفس دوال المساعدة، لكن باستعمال BASE_URL المؤمّنة أعلاه - */ -function calculateBonus($amount) { - if ($amount == 20000) return 20500; - if ($amount == 40000) return 42500; - if ($amount == 100000) return 104000; - return $amount; -} - -function generatePaymentToken($passengerId, $amount) { - $url = rtrim(BASE_URL, '/') . "/passengerWallet/addPaymentTokenPassenger.php"; - $postData = ['passengerId' => $passengerId, 'amount' => $amount]; - $ch = curl_init($url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData)); - $response = curl_exec($ch); - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - curl_close($ch); - if ($httpCode != 200 || !$response) return null; - $data = json_decode($response, true); - return $data['message'] ?? null; -} - -function addToPassengerWallet($passengerId, $amount, $token) { - $url = rtrim(BASE_URL, '/') . "/passengerWallet/add.php"; - $postData = ['passenger_id' => $passengerId, 'balance' => $amount, 'token' => $token]; - $ch = curl_init($url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData)); - $response = curl_exec($ch); - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - curl_close($ch); - if ($httpCode != 200 || !$response) return null; - return json_decode($response, true); -} - -function addToSeferWallet($passengerId, $amount, $paymentMethod, $token) { - $url = rtrim(BASE_URL, '/') . "/seferWallet/add.php"; - $postData = [ - 'amount' => $amount, - 'paymentMethod' => $paymentMethod, - 'passengerId' => $passengerId, - 'token' => $token, - 'driverId' => 'passenger' - ]; - $ch = curl_init($url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData)); - $response = curl_exec($ch); - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - curl_close($ch); - if ($httpCode != 200 || !$response) return null; - return json_decode($response, true); -} \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/passenger/mtn_start.php b/walletintaleq.intaleq.xyz/v2/main/ride/mtn/passenger/mtn_start.php deleted file mode 100755 index c87b65e..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/passenger/mtn_start.php +++ /dev/null @@ -1,130 +0,0 @@ -<?php -include "../../../connect.php"; -date_default_timezone_set("Asia/Damascus"); - -// ========== إعدادات MTN ========== -$terminalId = "9001000000060863"; -$currencyCode = 760; -$sessionNumber = 0; -$ttl = 15; - -// ====== استقبال البيانات من فلاتر ====== -$amount = filterRequest("amount"); -$passengerId = filterRequest("passengerId"); -$phone = filterRequest("phone"); -$lang = filterRequest("lang"); - -// ✅ Log مبدئي -error_log("🚦 START | passengerId: $passengerId | phone: $phone | amount: $amount"); - -// تحقق من المدخلات -if (empty($amount) || empty($passengerId) || empty($phone) || $amount <= 0) { - error_log("❌ Invalid input: amount=$amount, passengerId=$passengerId, phone=$phone"); - printFailure("بيانات الدفع غير كاملة أو غير صالحة."); - exit; -} - -// ====== توليد invoiceNumber و GUID ====== -$invoiceNumber = mt_rand(10000000000, 99999999999); -//$invoiceNumber = "MTN_" . $passengerId . "_" . time(); -$guid = uniqid("mtn_"); -error_log("🧾 Generated Invoice: $invoiceNumber"); -error_log("🧭 Generated GUID: $guid"); - -// ====== 1. إنشاء الفاتورة ====== -$createInvoiceBody = [ - "Amount" => intval($amount * 100), - "Invoice" => $invoiceNumber, - "Session" => $sessionNumber, - "TTL" => $ttl -]; -error_log("📦 Create Invoice Body: " . json_encode($createInvoiceBody, JSON_UNESCAPED_UNICODE)); -$invoiceResponse = sendMtnApiRequest("pos_web/invoice/create", $terminalId, $createInvoiceBody); -error_log("📥 Create Invoice Response: " . json_encode($invoiceResponse, JSON_UNESCAPED_UNICODE)); - -if (!$invoiceResponse || isset($invoiceResponse['Errno']) && $invoiceResponse['Errno'] != 0) { - error_log("❌ Failed to create invoice. Error: " . json_encode($invoiceResponse)); - printFailure("فشل إنشاء الفاتورة عبر MTN."); - exit; -} - -// ====== 2. بدء الدفع ====== -$initiateBody = [ - "Invoice" => $invoiceNumber, - "Phone" => $phone, - "Guid" => $guid -]; -error_log("📤 body initiateBody: $initiateBody"); -error_log("📦 Initiate Payment Body: " . json_encode($initiateBody, JSON_UNESCAPED_UNICODE)); -$initiateResponse = sendMtnApiRequest("pos_web/payment_phone/initiate", $terminalId, $initiateBody); -error_log("📥 Initiate Response: " . json_encode($initiateResponse, JSON_UNESCAPED_UNICODE)); - -if (!$initiateResponse || !isset($initiateResponse['OperationNumber'])) { - error_log("❌ Failed to initiate payment."); - printFailure($initiateResponse); - exit; -} - -$operationNumber = $initiateResponse['OperationNumber']; - -// ====== 3. تسجيل العملية ====== -try { - $stmt = $con->prepare("INSERT INTO `paymentsLogSyria` - (`user_id`, `amount`, `status`, `order_ref`, `payment_method`, `created_at`) - VALUES (?, ?, 2, ?, 'mtn', NOW())"); - $stmt->execute([$passengerId, $amount, $invoiceNumber]); - error_log("✅ DB Log Inserted."); -} catch (PDOException $e) { - error_log("❌ DB ERROR: " . $e->getMessage()); - printFailure("فشل في تسجيل العملية."); - exit; -} - -// ====== 4. نجاح -error_log("✅ Payment initiation successful."); -printSuccess([ - "invoiceNumber" => $invoiceNumber, - "operationNumber" => $operationNumber, - "guid" => $guid -]); - - -// ====== دالة إرسال الطلب ===================== -function sendMtnApiRequest($requestName, $terminalId, $body) -{ - $apiUrl = "https://cashmobile.mtnsyr.com:9000"; - $privateKey = openssl_pkey_get_private(file_get_contents("private_key.pem")); - - // ✅ تحويل الـ body إلى JSON بدون فراغات أو أسطر - $bodyJson = trim(stripslashes(json_encode($body, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_LINE_TERMINATORS)), '"'); -//$bodyJson = json_encode($body, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); - // ✅ توليد التوقيع - // $bodyHash = hash('sha256', $bodyJson, true); - error_log("📤 body before JSON: $bodyJson"); - openssl_sign($bodyJson, $signature, $privateKey, OPENSSL_ALGO_SHA256); - $xSignature = base64_encode($signature); -error_log("📤 body xSignature: $xSignature"); - // ✅ رؤوس الطلب - $headers = [ - "Content-Type: application/json", - "Accept-Language: $lang", - "Request-Name: $requestName", - "Subject: $terminalId", - "X-Signature: $xSignature" - ]; - - $ch = curl_init($apiUrl); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $bodyJson); - curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - - $response = curl_exec($ch); - - // ✅ لوق داخلي - error_log("🔐 Signature for $requestName: $xSignature"); - error_log("📤 Sent JSON: $bodyJson"); - - curl_close($ch); - return json_decode($response, true); -} \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/passenger/private_key.pem b/walletintaleq.intaleq.xyz/v2/main/ride/mtn/passenger/private_key.pem deleted file mode 100644 index fead7a6..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/passenger/private_key.pem +++ /dev/null @@ -1,15 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIICXwIBAAKBgQDOhVAdUyxFpVNSyjRndMWEPAN9vJEetMzLbjF9DTn2lPVuRj/M -kwq9wCNhy+tdeX2lIn4K3EkONBvYJubBhxnYOoQuMchPW5vG7VnmpLjZ7TkpM2n9 -fcMu8u1GkLatLblDI4LTfvn3851+nhpnYlUVkjw5GAhH4XnEpveIjqDhzQIDAQAB -AoGBALRcAvqJT8nHN7y+8QNFHNZ+XwIpc4egmJY1Ny0iJvPtZWaYHVG5PRE4Qu4+ -29+3oX5dYDx146tu4L5mQvLS3ULBsvxaUZt2lT/vxkQzI9pNfXw584WvIrbtxQod -ILvBcnamwQa9hEOIFZVyZ/hzkzUcMO6cAXqvsfqqPgJhm7PBAkEA+xgE9CUOLDFl -vLePQKGcHIUOsPLr16qNEgGhTW7Km3OMMqoB2f7t67xOHGqK6tnANRM4Sk6IModI -wbZuVh4jMQJBANKOVmIdDLNffZVHp90SDRG7/YdK2R5ob361CIkcUzjh927Wfs5W -A/WroB7eJ7pWiq2BMaj/xq65nYaCOldvaV0CQQDm12c+eY61DFjnDa6ykaEvCxi9 -jydJp+93vW3o/VFhZvJeZbO8EcX0MrNxJnY+gSBW6yuWDOrj4UH/bVO08pIRAkEA -lH3TiBAqo9nlTEEjrnILi4VD0IVFx/8pGnf71A6I1qXuBVn6RfQ9iKWIIBzWccCU -vrZNWn1AFntLD9CJ6p3k9QJBAMbSQ9CoXWlOLJRduV15ER1ZyE/inVd4jIvtjAgz -b7QaM62Ecxl3D8EI/LTSZV9Oa8D/62cJeMsflVa7gpavL70= ------END RSA PRIVATE KEY----- \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/passenger/public_key.pem b/walletintaleq.intaleq.xyz/v2/main/ride/mtn/passenger/public_key.pem deleted file mode 100644 index 63a3519..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/mtn/passenger/public_key.pem +++ /dev/null @@ -1,6 +0,0 @@ ------BEGIN PUBLIC KEY----- -MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDqBQZEJXWCQwPsPzBM70M3TjyU -5vwCZWoEtUomR9Qu+dEQaa0Hniz6JY8+goCxfMYuZQw6+kimctA2KqzT2pCsJufN -b92pSAMZgb0RSTl2y62oJkJd2WY7dj36AvPEyw6DxCFItvFOu7HGl3LlHQBriiw3 -jwtuS6DO7gbmAJPU8wIDAQAB ------END PUBLIC KEY----- diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/mtn_new/mtn_webhook_handler.php b/walletintaleq.intaleq.xyz/v2/main/ride/mtn_new/mtn_webhook_handler.php index 3b0c546..5a40a0c 100755 --- a/walletintaleq.intaleq.xyz/v2/main/ride/mtn_new/mtn_webhook_handler.php +++ b/walletintaleq.intaleq.xyz/v2/main/ride/mtn_new/mtn_webhook_handler.php @@ -13,7 +13,7 @@ header('Content-Type: application/json'); $expectedToken = trim(file_get_contents('/home/intaleq-wallet/.mtnKey')); // يجب استبداله بتوكن حقيقي $receivedToken = $_SERVER['HTTP_X_AUTH_TOKEN'] ?? ''; -if ($receivedToken !== $expectedToken) { +if (!hash_equals($expectedToken, $receivedToken)) { http_response_code(401); // Unauthorized echo json_encode(["status" => "error", "message" => "Authentication failed."]); exit; diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/passengerWallet/add.php b/walletintaleq.intaleq.xyz/v2/main/ride/passengerWallet/add.php index 70e359f..6e3c851 100644 --- a/walletintaleq.intaleq.xyz/v2/main/ride/passengerWallet/add.php +++ b/walletintaleq.intaleq.xyz/v2/main/ride/passengerWallet/add.php @@ -6,28 +6,39 @@ $balance = filterRequest("balance"); $token = filterRequest("token"); -// Retrieve token details from the database -$stmt = $con->prepare("SELECT * FROM payment_tokens_passenger WHERE token = :token AND isUsed = FALSE"); -$stmt->execute([':token' => $token]); +try { + $con->beginTransaction(); -$tokenData = $stmt->fetch(); + // Retrieve token details from the database securely and lock the row + $stmt = $con->prepare("SELECT * FROM payment_tokens_passenger WHERE token = :token AND isUsed = FALSE FOR UPDATE"); + $stmt->execute([':token' => $token]); + $tokenData = $stmt->fetch(); -if ($tokenData) { - // Insert into passengerWallet securely using prepared statements - $sql = "INSERT INTO `passengerWallet` (`passenger_id`, `balance`) VALUES (:passenger_id, :balance)"; - $stmt = $con->prepare($sql); - $stmt->execute([':passenger_id' => $passenger_id, ':balance' => $balance]); + if ($tokenData) { + // Insert into passengerWallet securely using prepared statements + $sql = "INSERT INTO `passengerWallet` (`passenger_id`, `balance`) VALUES (:passenger_id, :balance)"; + $stmtInsert = $con->prepare($sql); + $stmtInsert->execute([':passenger_id' => $passenger_id, ':balance' => $balance]); - if ($stmt->rowCount() > 0) { - // Mark the token as used - $updateTokenStmt = $con->prepare("UPDATE payment_tokens_passenger SET isUsed = TRUE WHERE token = :token"); - $updateTokenStmt->execute([':token' => $token]); - - printSuccess("Wallet record created successfully"); + if ($stmtInsert->rowCount() > 0) { + // Mark the token as used + $updateTokenStmt = $con->prepare("UPDATE payment_tokens_passenger SET isUsed = TRUE WHERE id = :tokenID"); + $updateTokenStmt->execute([':tokenID' => $tokenData['id']]); + + $con->commit(); + printSuccess("Wallet record created successfully"); + } else { + $con->rollBack(); + printFailure("Failed to create wallet record"); + } } else { - printFailure("Failed to create wallet record"); + $con->rollBack(); + printFailure("Invalid or already used token"); } -} else { - printFailure("Invalid or already used token"); +} catch (Exception $e) { + if ($con->inTransaction()) { + $con->rollBack(); + } + printFailure("Database error: " . $e->getMessage()); } ?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/error_log b/walletintaleq.intaleq.xyz/v2/main/ride/payMob/error_log deleted file mode 100644 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/payWithPayMob.php b/walletintaleq.intaleq.xyz/v2/main/ride/payMob/payWithPayMob.php deleted file mode 100644 index 371b274..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/payWithPayMob.php +++ /dev/null @@ -1,100 +0,0 @@ - -<?php -include "../../connect.php"; -// 1. احصل على AUTH TOKEN -$api_key = getenv("payMobApiKey1"); // ضع API Key الخاص بك هنا -$email= filterRequest("amount"); -$first_name= filterRequest("first_name"); -$last_name= filterRequest("last_name"); -$phone_number= filterRequest("phone_number"); -$amount= filterRequest("amount"); - -$auth_url = "https://accept.paymob.com/api/auth/tokens"; -$auth_data = json_encode(["api_key" => $api_key]); - -$response = callAPI("POST", $auth_url, $auth_data); -// printResponse("AUTH TOKEN RESPONSE", $response); - -$auth_token = $response->token ?? null; -if (!$auth_token) { - die("❌ فشل الحصول على AUTH TOKEN!"); -} -// $amount=$amount*100; -// 2. أنشئ الطلب ORDER -$order_url = "https://accept.paymob.com/api/ecommerce/orders"; -$order_data = [ - "auth_token" => $auth_token, - "delivery_needed" => false, - "amount_cents" => $amount, - "currency" => "EGP", - "merchant_order_id" => uniqid(), - "items" => [] -]; - -$response = callAPI("POST", $order_url, json_encode($order_data)); -// printResponse("ORDER RESPONSE", $response); - -$order_id = $response->id ?? null; -if (!$order_id) { - die("❌ فشل إنشاء الطلب!"); -} -$integration_id=getenv("paymobIntegratedIdCard"); -// 3. احصل على Payment Key -$payment_key_url = "https://accept.paymob.com/api/acceptance/payment_keys"; -$payment_key_data = [ - "auth_token" => $auth_token, - "amount_cents" => $amount, - "expiration" => 3600, - "order_id" => $order_id, - "billing_data" => [ - "first_name" =>$first_name, - "last_name" => $last_name, - "email" => $email, - "phone_number" => $phone_number, - "country" => "EG", - "city" => "Cairo", - "state" => "shobra", - "street" => "Test St.", - "building" => "1", - "apartment" => "10", - "floor" => "2", - "postal_code" => "12345", - "shipping_method"=> 'card' - ], - "currency" => "EGP", - "integration_id" => $integration_id, // ضع الـ Integration ID الصحيح -]; - -$response = callAPI("POST", $payment_key_url, json_encode($payment_key_data)); -// printResponse("PAYMENT TOKEN RESPONSE", $response); - -$payment_token = $response->token ?? null; -if (!$payment_token) { - die("❌ فشل الحصول على PAYMENT TOKEN!"); -} - -// 4. إنشاء IFRAME URL -$iframe_id = "837992"; // ضع الـ Iframe ID الصحيح -$iframe_url = "https://accept.paymob.com/api/acceptance/iframes/$iframe_id?payment_token=$payment_token"; -if($payment_token){ - - printSuccess($iframe_url); -} -// دالة لطلب API عبر CURL -function callAPI($method, $url, $data) -{ - $curl = curl_init(); - - curl_setopt_array($curl, [ - CURLOPT_URL => $url, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_CUSTOMREQUEST => $method, - CURLOPT_POSTFIELDS => $data, - CURLOPT_HTTPHEADER => ["Content-Type: application/json"] - ]); - - $response = curl_exec($curl); - curl_close($curl); - - return json_decode($response); -} diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymet_verfy.php b/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymet_verfy.php deleted file mode 100644 index a9513df..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymet_verfy.php +++ /dev/null @@ -1,358 +0,0 @@ -<?php -include "../../connect.php"; - -define("BASE_URL", "https://wl.tripz-egypt.com/v1/main/ride"); -define("LOG_FILE", "../logs/payment_verification.log"); // Define log file path - -// Function to write to error log -function logError($step, $message, $data = null) { - $timestamp = date('Y-m-d H:i:s'); - $logEntry = "[{$timestamp}] STEP {$step}: {$message}"; - - if ($data !== null) { - $logEntry .= " | Data: " . json_encode($data); - } - - // Ensure log directory exists - $logDir = dirname(LOG_FILE); - if (!is_dir($logDir)) { - mkdir($logDir, 0755, true); - } - - // Append to log file - file_put_contents(LOG_FILE, $logEntry . PHP_EOL, FILE_APPEND); - - // Also log to PHP error log for server monitoring - // error_log("PAYMENT_VERIFICATION: {$logEntry}"); -} - -// Receive parameters from GET request -$user_id = filterRequest("user_id"); -$passengerId = filterRequest("passengerId"); -$paymentMethod = filterRequest("paymentMethod"); - -// Log initial request -// logError("0", "Request received", [ -// "user_id" => $user_id, -// "passengerId" => $passengerId -// ]); - -// Validate user_id and passengerId -if (!$user_id || !$passengerId) { - // logError("1", "Invalid parameters", [ - // "user_id" => $user_id, - // "passengerId" => $passengerId - // ]); - printFailure("Invalid user ID or passenger ID."); - exit; -} - -try { - // Step 1: Get the latest successful payment - // logError("1", "Querying latest payment", ["user_id" => $user_id]); - - $stmt = $con->prepare("SELECT * FROM paymentsLog WHERE user_id = :user_id AND created_at >= DATE_SUB(NOW(), INTERVAL 2 MINUTE) -ORDER BY created_at DESC -LIMIT 1"); - $stmt->bindParam(':user_id', $user_id, PDO::PARAM_STR); - $stmt->execute(); - - $payment = $stmt->fetch(PDO::FETCH_ASSOC); - - if (!$payment) { - logError("1", "No payment found", ["user_id" => $user_id]); - printFailure("No payment data found."); - exit; - } - - // logError("1", "Payment found", [ - // "payment_id" => $payment['id'] ?? 'unknown', - // "status" => $payment['status'], - // "amount" => $payment['amount']/100 ?? 'unknown' - // ]); - - // Step 2: Check payment status - if ($payment['status'] != 1) { - // logError("2", "Payment not successful", ["status" => $payment['status']]); - printFailure("Payment is not successful yet."); - exit; - } - - // logError("2", "Payment status verified", ["status" => $payment['status']]); - - $amount = $payment['amount']/100; // Paid amount - - // Step 3: Calculate bonus based on the paid amount - // logError("3", "Calculating bonus", ["amount" => $amount]); - $finalAmount = calculateBonus($amount); - - if ($finalAmount <= 0) { - // logError("3", "Bonus calculation failed", [ - // "original_amount" => $amount, - // "calculated_amount" => $finalAmount - // ]); - printFailure("Invalid amount for bonus calculation."); - exit; - } - - // logError("3", "Bonus calculated", [ - // "original_amount" => $amount, - // "final_amount" => $finalAmount - // ]); - - // // Step 4: Generate payment token - // logError("4", "Generating payment token", [ - // "passengerId" => $passengerId, - // "amount" => $finalAmount - // ]); - - $token = generatePaymentToken($passengerId, $finalAmount); - - if (!$token) { - // logError("4", "Token generation failed"); - printFailure("Payment verified, but failed to generate token."); - exit; - } - - // logError("4", "Token generated successfully", ["token_length" => strlen($token)]); - - // // Step 5: Add balance to passenger's wallet - // logError("5", "Adding balance to passenger wallet", [ - // "passengerId" => $passengerId, - // "amount" => $finalAmount - // ]); - - $walletResult = addToPassengerWallet($passengerId, $finalAmount, $token); - - if (!$walletResult || !isset($walletResult['status']) || $walletResult['status'] != "success") { - // logError("5", "Failed to add balance to passenger wallet", $walletResult); - printFailure("Payment verified, but failed to add balance to passenger wallet."); - exit; - } - - // logError("5", "Balance added to passenger wallet", $walletResult); - - // Step 6: Add balance to Sefer wallet - // logError("6", "Adding balance to Sefer wallet", [ - // "passengerId" => $passengerId, - // "amount" => $finalAmount, - // "paymentMethod" => $paymentMethod - // ]); - - $token = generatePaymentToken($passengerId, $finalAmount); - - if (!$token) { - // logError("4", "Token generation failed"); - printFailure("Payment verified, but failed to generate token."); - exit; - } - - // logError("4", "Token generated successfully", ["token_length" => strlen($token)]); - - $seferWalletResult = addToSeferWallet($passengerId, $amount, $paymentMethod); - - if (!$seferWalletResult || !isset($seferWalletResult['status']) || $seferWalletResult['status'] != "success") { - // logError("6", "Failed to add balance to Sefer wallet", $seferWalletResult); - printFailure("Payment verified, but failed to add balance to Sefer wallet."); - exit; - } - - // logError("6", "Balance added to Sefer wallet", $seferWalletResult); - - // // Final success - // logError("7", "Process completed successfully", [ - // "payment_id" => $payment['id'] ?? 'unknown', - // "amount" => $finalAmount, - // "passengerId" => $passengerId - // ]); - - printSuccess( "Payment data saved successfully"); - -} catch (PDOException $e) { - logError("ERROR", "Database error: " . $e->getMessage()); - printFailure("Database error occurred."); -} catch (Exception $e) { - logError("ERROR", "General error: " . $e->getMessage()); - printFailure("An error occurred during payment verification."); -} - -// 🎯 Function to generate payment token with error logging -function generatePaymentToken($passengerId, $amount) { - $url = BASE_URL . "/passengerWallet/addPaymentTokenPassenger.php"; - - $postData = [ - 'passengerId' => $passengerId, - 'amount' => $amount - ]; - - $ch = curl_init($url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData)); - - $response = curl_exec($ch); - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - $curlError = curl_error($ch); - curl_close($ch); - - if ($curlError) { - logError("4.1", "cURL error in token generation", [ - "error" => $curlError, - "url" => $url - ]); - return null; - } - - if ($httpCode != 200) { - logError("4.2", "HTTP error in token generation", [ - "http_code" => $httpCode, - "response" => $response - ]); - return null; - } - - $data = json_decode($response, true); - - if (!$data || !isset($data['message'])) { - logError("4.3", "Invalid response format in token generation", [ - "response" => $response - ]); - return null; - } - - return $data['message']; // ✅ Return token -} - -// 🎯 Function to add balance to passenger's wallet with error logging -function addToPassengerWallet($passengerId, $amount, $token) { - $url = BASE_URL . "/passengerWallet/add.php"; - - $postData = [ - 'passenger_id' => $passengerId, - 'balance' => $amount, - 'token' => $token - ]; - - $ch = curl_init($url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData)); - - $response = curl_exec($ch); - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - $curlError = curl_error($ch); - curl_close($ch); - - if ($curlError) { - logError("5.1", "cURL error in passenger wallet update", [ - "error" => $curlError, - "url" => $url - ]); - return null; - } - - if ($httpCode != 200) { - logError("5.2", "HTTP error in passenger wallet update", [ - "http_code" => $httpCode, - "response" => $response - ]); - return null; - } - - $data = json_decode($response, true); - - if (!$data) { - logError("5.3", "Invalid response format in passenger wallet update", [ - "response" => $response - ]); - return null; - } - - return $data; // ✅ Return result -} - -// 🎯 Function to add balance to Sefer wallet with error logging - - -function addToSeferWallet($passengerId, $amount, $paymentMethod) { - - - // Generate a new token specifically for the Sefer wallet - $seferToken = generatePaymentToken($passengerId, $amount); - - if (!$seferToken) { - logError("6.0.1", "Failed to generate Sefer token"); - return null; - } - - logError("6.0.2", "Generated new Sefer token", [ - "token_length" => ($seferToken) - ]); - - $url = BASE_URL . "/seferWallet/add.php"; - - $postData = [ - 'amount' => $amount, - 'paymentMethod' => $paymentMethod, - 'passengerId' => $passengerId, - 'token' => $seferToken, // Use the new Sefer-specific token - 'driverId' => 'passenger' - ]; - - $ch = curl_init($url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData)); - - $response = curl_exec($ch); - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - $curlError = curl_error($ch); - curl_close($ch); - - if ($curlError) { - logError("6.1", "cURL error in Sefer wallet update", [ - "error" => $curlError, - "url" => $url - ]); - return null; - } - - if ($httpCode != 200) { - logError("6.2", "HTTP error in Sefer wallet update", [ - "http_code" => $httpCode, - "response" => $response - ]); - return null; - } - - $data = json_decode($response, true); - - if (!$data) { - logError("6.3", "Invalid response format in Sefer wallet update", [ - "response" => $response - ]); - return null; - } - - return $data; // ✅ Return result -} - - -// 🎯 Function to calculate bonus -function calculateBonus($amount) { - logError("3.1", "Bonus calculation input", ["amount" => $amount]); - - $result = 0; - if ($amount == 100) $result = 100; - else if ($amount == 200) $result = 215; - else if ($amount == 400) $result = 450; - else if ($amount == 1000) $result = 1140; - - logError("3.2", "Bonus calculation result", [ - "input" => $amount, - "output" => $result - ]); - - return $result; -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymet_verfy.php.zip b/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymet_verfy.php.zip deleted file mode 100644 index b3aa417..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymet_verfy.php.zip and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymob_driver/payWithCard.php b/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymob_driver/payWithCard.php deleted file mode 100755 index dac9a6f..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymob_driver/payWithCard.php +++ /dev/null @@ -1,100 +0,0 @@ - -<?php -include "../../../connect.php"; -// 1. احصل على AUTH TOKEN -$api_key = getenv("payMobApiKey1"); // ضع API Key الخاص بك هنا -$email= filterRequest("amount"); -$first_name= filterRequest("first_name"); -$last_name= filterRequest("last_name"); -$phone_number= filterRequest("phone_number"); -$amount= filterRequest("amount"); - -$auth_url = "https://accept.paymob.com/api/auth/tokens"; -$auth_data = json_encode(["api_key" => $api_key]); - -$response = callAPI("POST", $auth_url, $auth_data); -// printResponse("AUTH TOKEN RESPONSE", $response); - -$auth_token = $response->token ?? null; -if (!$auth_token) { - die("❌ فشل الحصول على AUTH TOKEN!"); -} - $amount=$amount*100; -// 2. أنشئ الطلب ORDER -$order_url = "https://accept.paymob.com/api/ecommerce/orders"; -$order_data = [ - "auth_token" => $auth_token, - "delivery_needed" => false, - "amount_cents" => $amount, - "currency" => "EGP", - "merchant_order_id" => uniqid(), - "items" => [] -]; - -$response = callAPI("POST", $order_url, json_encode($order_data)); -// printResponse("ORDER RESPONSE", $response); - -$order_id = $response->id ?? null; -if (!$order_id) { - die("❌ فشل إنشاء الطلب!"); -} -$integration_id=getenv("paymobIntegratedIdCardDriver"); -// 3. احصل على Payment Key -$payment_key_url = "https://accept.paymob.com/api/acceptance/payment_keys"; -$payment_key_data = [ - "auth_token" => $auth_token, - "amount_cents" => $amount, - "expiration" => 3600, - "order_id" => $order_id, - "billing_data" => [ - "first_name" =>$first_name, - "last_name" => $last_name, - "email" => $email, - "phone_number" => $phone_number, - "country" => "EG", - "city" => "Cairo", - "state" => "shobra", - "street" => "Test St.", - "building" => "1", - "apartment" => "10", - "floor" => "2", - "postal_code" => "12345", - "shipping_method"=> 'card' - ], - "currency" => "EGP", - "integration_id" => $integration_id, // ضع الـ Integration ID الصحيح -]; - -$response = callAPI("POST", $payment_key_url, json_encode($payment_key_data)); -// printResponse("PAYMENT TOKEN RESPONSE", $response); - -$payment_token = $response->token ?? null; -if (!$payment_token) { - die("❌ فشل الحصول على PAYMENT TOKEN!"); -} - -// 4. إنشاء IFRAME URL -$iframe_id = "837992"; // ضع الـ Iframe ID الصحيح -$iframe_url = "https://accept.paymob.com/api/acceptance/iframes/$iframe_id?payment_token=$payment_token"; -if($payment_token){ - - printSuccess($iframe_url); -} -// دالة لطلب API عبر CURL -function callAPI($method, $url, $data) -{ - $curl = curl_init(); - - curl_setopt_array($curl, [ - CURLOPT_URL => $url, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_CUSTOMREQUEST => $method, - CURLOPT_POSTFIELDS => $data, - CURLOPT_HTTPHEADER => ["Content-Type: application/json"] - ]); - - $response = curl_exec($curl); - curl_close($curl); - - return json_decode($response); -} diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymob_driver/payWithWallet.php b/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymob_driver/payWithWallet.php deleted file mode 100755 index 17c12d7..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymob_driver/payWithWallet.php +++ /dev/null @@ -1,118 +0,0 @@ -<?php -include "../../../connect.php"; - -// 1️⃣ AUTH TOKEN -$api_key = getenv("payMobApiKey1"); -$integration_id = getenv("paymobIntegratedIdDriverWallet"); // 🔁 تأكد أنه خاص بالسائق - -$email = filterRequest("email"); -$first_name = filterRequest("first_name"); -$last_name = filterRequest("last_name"); -$phone_number = filterRequest("phone_number"); // هاتف السائق -$wallet_phone = '+2'.$phone_number; -$amount = filterRequest("amount"); - -$auth_url = "https://accept.paymob.com/api/auth/tokens"; -$auth_data = json_encode(["api_key" => $api_key]); - -$response = callAPI("POST", $auth_url, $auth_data); -$auth_token = $response->token ?? null; - -if (!$auth_token) { - error_log("❌ AUTH TOKEN retrieval failed!"); - die("❌ AUTH TOKEN retrieval failed!"); -} -$amount=$amount*100; -// 2️⃣ ORDER CREATE -$order_url = "https://accept.paymob.com/api/ecommerce/orders"; -$order_data = [ - "auth_token" => $auth_token, - "delivery_needed" => false, - "amount_cents" => $amount, - "currency" => "EGP", - "merchant_order_id" => uniqid("DRV_"), - "items" => [] -]; - -$response = callAPI("POST", $order_url, json_encode($order_data)); -$order_id = $response->id ?? null; - -if (!$order_id) { - error_log("❌ Failed to create order for driver wallet!"); - die("❌ Failed to create order for driver wallet!"); -} - -// 3️⃣ PAYMENT KEY -$payment_key_url = "https://accept.paymob.com/api/acceptance/payment_keys"; -$payment_key_data = [ - "auth_token" => $auth_token, - "amount_cents" => $amount, - "expiration" => 3600, - "order_id" => $order_id, - "billing_data" => [ - "first_name" => $first_name, - "last_name" => $last_name, - "email" => $email, - "phone_number" => $phone_number, - "country" => "EG", - "city" => "Cairo", - "state" => "Nasr City", - "street" => "Driver Zone", - "building" => "5", - "apartment" => "D1", - "floor" => "1", - "postal_code" => "11765", - "shipping_method" => "driver_wallet" - ], - "currency" => "EGP", - "integration_id" => $integration_id -]; - -$response = callAPI("POST", $payment_key_url, json_encode($payment_key_data)); -$payment_token = $response->token ?? null; - -if (!$payment_token) { - error_log("❌ Failed to get PAYMENT TOKEN for driver!"); - die("❌ Failed to get PAYMENT TOKEN for driver!"); -} - -// 4️⃣ Final Step: Pay with Wallet -$redirect_url = payWithWallet($payment_token, $wallet_phone); -if ($redirect_url) { - printSuccess($redirect_url); - error_log("✅ redirect_url (driver): " . $redirect_url); -} else { - error_log("❌ Driver wallet payment failed!"); - printFailure("Payment verified, but failed to redirect."); -} - - -// 🔁 Shared helper functions -function callAPI($method, $url, $data) -{ - $curl = curl_init(); - curl_setopt_array($curl, [ - CURLOPT_URL => $url, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_CUSTOMREQUEST => $method, - CURLOPT_POSTFIELDS => $data, - CURLOPT_HTTPHEADER => ["Content-Type: application/json"] - ]); - $response = curl_exec($curl); - curl_close($curl); - return json_decode($response); -} - -function payWithWallet($paymentToken, $walletPhone) -{ - $url = "https://accept.paymob.com/api/acceptance/payments/pay"; - $data = [ - "source" => [ - "identifier" => $walletPhone, - "subtype" => "WALLET" - ], - "payment_token" => $paymentToken - ]; - $response = callAPI("POST", $url, json_encode($data)); - return $response->redirect_url ?? null; -} \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymob_driver/paymet_verfy.php b/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymob_driver/paymet_verfy.php deleted file mode 100755 index b085550..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymob_driver/paymet_verfy.php +++ /dev/null @@ -1,146 +0,0 @@ -<?php - -include "../../../connect.php"; -define('BASE_URL', 'https://wl.tripz-egypt.com/v1/main/ride'); - -try { - $driverId = filterRequest('driverID'); - $user_id = filterRequest('user_id'); - $paymentMethod = filterRequest('paymentMethod'); - - if (empty($user_id) || empty($driverId)) { - printFailure('Missing user_id or driverID.'); - exit; - } - - // 1️⃣ تحقق من سجل الدفع خلال آخر دقيقتين - $stmt = $con->prepare( - 'SELECT * FROM payment_log_driver - WHERE user_id = :uid - AND created_at >= DATE_SUB(NOW(), INTERVAL 2 MINUTE) - ORDER BY created_at DESC LIMIT 1' - ); - $stmt->execute([':uid' => $user_id]); - $payment = $stmt->fetch(PDO::FETCH_ASSOC); - - if (!$payment || $payment['status'] != 1) { - printFailure('No valid payment found.'); - exit; - } - - $originalAmount = floatval($payment['amount']); - $bonus = match ((int)$originalAmount) { - 80 => 80.0, - 200 => 215.0, - 400 => 450.0, - 1000 => 1140.0, - default => $originalAmount, - }; - - // 2️⃣ توكن لـ DriverWallet - $tokenDriver = generateToken($con, $driverId, $bonus); - if (!$tokenDriver) { - printFailure('Failed to generate token for driver wallet.'); - exit; - } - - // 3️⃣ توكن مستقل لـ SeferWallet - $tokenSefer = generateToken($con, $driverId, $originalAmount); - if (!$tokenSefer) { - printFailure('Failed to generate token for sefer wallet.'); - exit; - } - - // 4️⃣ Payment ID - $paymentID = generatePaymentID($con, $driverId, $bonus, $paymentMethod); - if (!$paymentID) { - printFailure('Failed to generate payment ID.'); - exit; - } - - // 5️⃣ Insert into driverWallet - $insertDriver = $con->prepare("INSERT INTO driverWallet (driverID, paymentID, amount, paymentMethod) VALUES (:driverID, :paymentID, :amount, :paymentMethod)"); - $insertDriver->execute([ - ':driverID' => $driverId, - ':paymentID' => $paymentID, - ':amount' => $bonus, - ':paymentMethod' => $paymentMethod - ]); - - if ($insertDriver->rowCount() === 0) { - printFailure('Failed to insert into driverWallet.'); - exit; - } - - // 6️⃣ Update tokenDriver to isUsed = TRUE - $markTokenDriver = $con->prepare("UPDATE payment_tokens SET isUsed = TRUE WHERE token = :token"); - $markTokenDriver->execute([':token' => $tokenDriver]); - - // 7️⃣ Insert into seferWallet - $insertSefer = $con->prepare("INSERT INTO seferWallet (driverId, passengerId, amount, paymentMethod, token, createdAt) - VALUES (:driverId, :passengerId, :amount, :paymentMethod, :token, CURRENT_TIMESTAMP)"); - $insertSefer->execute([ - ':driverId' => $driverId, - ':passengerId' => 'driver', - ':amount' => $originalAmount, - ':paymentMethod' => $paymentMethod, - ':token' => $tokenSefer - ]); - - // 8️⃣ Update tokenSefer to isUsed = TRUE - $markTokenSefer = $con->prepare("UPDATE payment_tokens SET isUsed = TRUE WHERE token = :token"); - $markTokenSefer->execute([':token' => $tokenSefer]); - - // 🎉 Success response - printSuccess([ - 'message' => 'Payment verified and all wallets updated successfully.', - 'amount' => $originalAmount, - 'bonus' => $bonus, - 'paymentID' => $paymentID, - 'tokenUsed' => [ - 'driverWalletToken' => $tokenDriver, - 'seferWalletToken' => $tokenSefer - ] - ]); - -} catch (Throwable $e) { - printFailure("Server error: " . $e->getMessage()); -} - - -// ─────────────────────────── -// FUNCTIONS -// ─────────────────────────── - -function generateToken($con, $driverId, $amount): ?string { - global $secretKey; - - // نفس المنطق من سكربتك - $data = $driverId . $amount . time(); - $data .= $secretKey; - $hash = hash('sha256', $data); - $randomBytes = bin2hex(random_bytes(16)); - $token = substr($hash . $randomBytes, 0, 64); - // تخزين التوكن في قاعدة البيانات - $stmt = $con->prepare("INSERT INTO payment_tokens (token, driverID, dateCreated, amount) - VALUES (:token, :driverID, NOW(), :amount)"); - $stmt->execute([ - ':token' => $token, - ':driverID' => $driverId, - ':amount' => $amount - ]); - - return $stmt->rowCount() > 0 ? $token : null; -} - -function generatePaymentID($con, $driverId, $amount, $method): ?string { - - $stmt = $con->prepare("INSERT INTO paymentsDriverPoints (`amount`, `payment_method`, `driverID`) - VALUES (:amount, :method, :driverID)"); - $stmt->execute([ - ':driverID' => $driverId, - ':amount' => $amount, - ':method' => $method - ]); - return $stmt->rowCount() > 0 ? $con->lastInsertId() : null; -} diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymob_driver/paymob_payout.php b/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymob_driver/paymob_payout.php deleted file mode 100755 index 91f9857..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymob_driver/paymob_payout.php +++ /dev/null @@ -1,110 +0,0 @@ -<?php -// paymob_payout.php -// سكريبت بي ات بي لمعاملات Paymob Payout (محفظة وبنك) بدون تخزين في قاعدة البيانات - -declare(strict_types=1); -include '../../../connect.php'; // يعطيك $con، filterRequest(), printSuccess(), printFailure() - -// 1) جلب باراميترات الطلب عبر filterRequest -$driverId = filterRequest('driverID'); -$amount = filterRequest('amount'); -$method = filterRequest('method'); // 'wallet' أو 'bank' -$msisdn = filterRequest('msisdn'); -$bankCard = filterRequest('bankCard'); // يُستعمل عند method == 'bank' -$bankCode = filterRequest('bankCode'); // يُستعمل عند method == 'bank' - -if (empty($driverId) || empty($amount) || empty($method)) { - printFailure('Missing parameters'); - exit; -} - -// 2) جلب بيانات Paymob من البيئة (Environment Variables) -$pmUser = getenv('payMobOutUserName'); -$pmPass = getenv('payMobOutPassword'); -$pmClientId = getenv('PAYMOBOUTCLIENT_ID'); // من static const pmobid -$pmSecret = getenv('PAYMOBOUTCLIENTSECRET'); // من static const pmobsec - -// 3) دالة للحصول على OAuth Token من Paymob -function fetchPaymobToken(string $user, string $pass, string $cid, string $secret): ?string { - $ch = curl_init('https://payouts.paymobsolutions.com/api/secure/o/token/'); - curl_setopt_array($ch, [ - CURLOPT_POST => true, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HTTPHEADER => ['Content-Type: application/x-www-form-urlencoded'], - CURLOPT_POSTFIELDS => http_build_query([ - 'grant_type' => 'password', - 'username' => $user, - 'password' => $pass, - 'client_id' => $cid, - 'client_secret' => $secret, - ]), - ]); - $resp = curl_exec($ch); - if (!$resp) return null; - $data = json_decode($resp, true); - return $data['access_token'] ?? null; -} - -$oauthToken = fetchPaymobToken($pmUser, $pmPass, $pmClientId, $pmSecret); -if (!$oauthToken) { - printFailure('Failed to retrieve Paymob token'); - exit; -} - -// 4) دوال صرف الأموال -function disburseWallet(string $token, string $amt, string $msisdn): array { - $ch = curl_init('https://payouts.paymobsolutions.com/api/secure/disburse/'); - curl_setopt_array($ch, [ - CURLOPT_POST => true, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HTTPHEADER => [ - "Authorization: Bearer $token", - 'Content-Type: application/json', - ], - CURLOPT_POSTFIELDS => json_encode([ - 'amount' => $amt, - 'issuer' => 'wallet', - 'msisdn' => $msisdn, - ]), - ]); - $resp = curl_exec($ch); - return $resp ? json_decode($resp, true) : []; -} - -function disburseBank(string $token, string $amt, string $card, string $code): array { - $ch = curl_init('https://payouts.paymobsolutions.com/api/secure/disburse/'); - curl_setopt_array($ch, [ - CURLOPT_POST => true, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HTTPHEADER => [ - "Authorization: Bearer $token", - 'Content-Type: application/json', - ], - CURLOPT_POSTFIELDS => json_encode([ - 'amount' => $amt, - 'issuer' => 'bank_card', - 'bank_card_number' => $card, - 'bank_code' => $code, - 'bank_transaction_type' => 'cash_transfer', - ]), - ]); - $resp = curl_exec($ch); - return $resp ? json_decode($resp, true) : []; -} - -// 5) استدعاء الدالة المناسبة وتنفيذ الصرف -if ($method === 'wallet') { - $result = disburseWallet($oauthToken, $amount, $msisdn); -} else { - $result = disburseBank($oauthToken, $amount, $bankCard, $bankCode); -} - -// 6) التحقق من نجاح الصرف وإرجاع النتيجة -if (empty($result) || ($result['disbursement_status'] ?? '') !== 'successful') { - printFailure('Disbursement failed'); - exit; -} - -// 7) إرجاع التوكن والنتيجة للعميل بدون تخزين في DB -printSuccess( $result); -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymob_driver/paymob_webHookWallet.php b/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymob_driver/paymob_webHookWallet.php deleted file mode 100755 index 583c752..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymob_driver/paymob_webHookWallet.php +++ /dev/null @@ -1,142 +0,0 @@ -<?php -include "../../../jwtconnect.php"; - -// ------------------------------ -// قراءة HMAC من الهيدر أو من الـ query -// ------------------------------ -$received_hmac = $_SERVER['HTTP_HMAC'] ?? ($_GET['hmac'] ?? ''); -$received_hmac = trim($received_hmac); - -// ------------------------------ -// قراءة البيانات القادمة من Paymob -// ------------------------------ -$raw_body = file_get_contents("php://input"); -$data = json_decode($raw_body, true); - -// ------------------------------ -// المفتاح السري -// ------------------------------ -$secret_key = getenv('hmacPaymob'); - -// ------------------------------ -// دالة لتحويل القيم إلى النصوص -// ------------------------------ -function normalize($value) { - if ($value === true) return 'true'; - if ($value === false) return 'false'; - if (is_null($value)) return ''; - return (string)$value; -} - -// ------------------------------ -// التحقق من صحة HMAC -// ------------------------------ -function isValidHmac($data, $secret_key, $received_hmac) { - if (!isset($data['obj'])) return false; - - $obj = $data['obj']; - - // دمج جميع الحقول بشكل متسلسل - $fields = [ - normalize($obj['amount_cents'] ?? ''), - normalize($obj['created_at'] ?? ''), - normalize($obj['currency'] ?? ''), - normalize($obj['error_occured'] ?? false), - normalize($obj['has_parent_transaction'] ?? false), - normalize($obj['id'] ?? ''), - normalize($obj['integration_id'] ?? ''), - normalize($obj['is_3d_secure'] ?? false), - normalize($obj['is_auth'] ?? false), - normalize($obj['is_capture'] ?? false), - normalize($obj['is_refunded'] ?? false), - normalize($obj['is_standalone_payment'] ?? false), - normalize($obj['is_voided'] ?? false), - normalize($obj['order']['id'] ?? ''), - normalize($obj['owner'] ?? ''), - normalize($obj['pending'] ?? false), - normalize($obj['source_data']['pan'] ?? ''), - normalize($obj['source_data']['sub_type'] ?? ''), - normalize($obj['source_data']['type'] ?? ''), - normalize($obj['success'] ?? false) - ]; - - // دمج الحقول في رسالة واحدة - $message = implode('', $fields); - - // حساب HMAC باستخدام المفتاح السري - $calculated_hmac = hash_hmac('sha512', $message, $secret_key); - - // - /*طباعة الرسائل لأغراض التصحيح - error_log("🔐 Message used for HMAC: " . $message); - error_log("🔐 Calculated HMAC: " . $calculated_hmac); - error_log("📩 Received HMAC: " . $received_hmac); - error_log("Calculated HMAC length: " . strlen($calculated_hmac)); - error_log("Received HMAC length: " . strlen($received_hmac)); - */ - // التحقق من تطابق HMAC - if (hash_equals($calculated_hmac, $received_hmac)) { - error_log("✅ Valid HMAC signature verified."); - return $calculated_hmac; - } else { - http_response_code(401); - echo json_encode(["error" => "Unauthorized – Invalid HMAC"]); - exit; - } -} -isValidHmac($data, $secret_key, $received_hmac); -// ------------------------------ -// إذا كانت HMAC صحيحة، نتابع العملية -// ------------------------------ -if ($data && isset($data['obj'])) { - $transaction = $data['obj']; - - $payment_id = $transaction['id'] ?? null; - $amount = $transaction['amount_cents'] ?? 0; - $status = $transaction['success'] ?? false; - $is_voided = $transaction['is_voided'] ?? false; - $is_refunded = $transaction['is_refunded'] ?? false; - $order_id = $transaction['order']['id'] ?? null; - $merchant_order_id = $transaction['order']['merchant_order_id'] ?? null; - $payment_method = $transaction['source_data']['type'] ?? 'unknown'; - $card_last4 = $transaction['source_data']['pan'] ?? '****'; - $transaction_type = $transaction['data']['migs_transaction']['type'] ?? 'UNKNOWN'; - $created_at = $transaction['created_at'] ?? date("Y-m-d H:i:s"); - $user_id = $transaction['order']['shipping_data']['phone_number']; - - $user_id='+2'. $user_id; - $amount=$amount/100; - - // التحقق من حالة الدفع - if (!$status) { - error_log("❌ Invalid payment status: " . $status); - echo json_encode(["error" => "Invalid payment status"]); - exit; - } - - // إضافة البيانات إلى قاعدة البيانات - $query = "INSERT INTO payment_log_driver (`payment_id`, `user_id`, `amount`, `status`) - VALUES (:payment_id, :user_id, :amount, :status)"; - - $stmt = $con->prepare($query); - $stmt->bindParam(':payment_id', $payment_id); - $stmt->bindParam(':user_id', $user_id); - $stmt->bindParam(':amount', $amount); - $stmt->bindParam(':status', $status); - - try { - $stmt->execute(); - if ($stmt->rowCount() > 0) { - http_response_code(200); - echo json_encode(["success" => true, "message" => "Payment data saved successfully"]); - error_log("Payment data saved successfully" . $status); - } else { - http_response_code(200); - echo json_encode(["success" => false, "message" => "Payment data already up to date."]); - } - } catch (PDOException $e) { - http_response_code(500); - echo json_encode(["error" => "Failed to execute the query: " . $e->getMessage()]); - } -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymob_driver/paymob_webhook.php b/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymob_driver/paymob_webhook.php deleted file mode 100755 index acc6d10..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymob_driver/paymob_webhook.php +++ /dev/null @@ -1,142 +0,0 @@ -<?php -include "../../../jwtconnect.php"; - -// ------------------------------ -// قراءة HMAC من الهيدر أو من الـ query -// ------------------------------ -$received_hmac = $_SERVER['HTTP_HMAC'] ?? ($_GET['hmac'] ?? ''); -$received_hmac = trim($received_hmac); - -// ------------------------------ -// قراءة البيانات القادمة من Paymob -// ------------------------------ -$raw_body = file_get_contents("php://input"); -$data = json_decode($raw_body, true); - -// ------------------------------ -// المفتاح السري -// ------------------------------ -$secret_key = getenv('hmacPaymob'); - -// ------------------------------ -// دالة لتحويل القيم إلى النصوص -// ------------------------------ -function normalize($value) { - if ($value === true) return 'true'; - if ($value === false) return 'false'; - if (is_null($value)) return ''; - return (string)$value; -} - -// ------------------------------ -// التحقق من صحة HMAC -// ------------------------------ -function isValidHmac($data, $secret_key, $received_hmac) { - if (!isset($data['obj'])) return false; - - $obj = $data['obj']; - - // دمج جميع الحقول بشكل متسلسل - $fields = [ - normalize($obj['amount_cents'] ?? ''), - normalize($obj['created_at'] ?? ''), - normalize($obj['currency'] ?? ''), - normalize($obj['error_occured'] ?? false), - normalize($obj['has_parent_transaction'] ?? false), - normalize($obj['id'] ?? ''), - normalize($obj['integration_id'] ?? ''), - normalize($obj['is_3d_secure'] ?? false), - normalize($obj['is_auth'] ?? false), - normalize($obj['is_capture'] ?? false), - normalize($obj['is_refunded'] ?? false), - normalize($obj['is_standalone_payment'] ?? false), - normalize($obj['is_voided'] ?? false), - normalize($obj['order']['id'] ?? ''), - normalize($obj['owner'] ?? ''), - normalize($obj['pending'] ?? false), - normalize($obj['source_data']['pan'] ?? ''), - normalize($obj['source_data']['sub_type'] ?? ''), - normalize($obj['source_data']['type'] ?? ''), - normalize($obj['success'] ?? false) - ]; - - // دمج الحقول في رسالة واحدة - $message = implode('', $fields); - - // حساب HMAC باستخدام المفتاح السري - $calculated_hmac = hash_hmac('sha512', $message, $secret_key); - - // - /*طباعة الرسائل لأغراض التصحيح - error_log("🔐 Message used for HMAC: " . $message); - error_log("🔐 Calculated HMAC: " . $calculated_hmac); - error_log("📩 Received HMAC: " . $received_hmac); - error_log("Calculated HMAC length: " . strlen($calculated_hmac)); - error_log("Received HMAC length: " . strlen($received_hmac)); - */ - // التحقق من تطابق HMAC - if (hash_equals($calculated_hmac, $received_hmac)) { - error_log("✅ Valid HMAC signature verified."); - return $calculated_hmac; - } else { - http_response_code(401); - echo json_encode(["error" => "Unauthorized – Invalid HMAC"]); - exit; - } -} -isValidHmac($data, $secret_key, $received_hmac); -// ------------------------------ -// إذا كانت HMAC صحيحة، نتابع العملية -// ------------------------------ -if ($data && isset($data['obj'])) { - $transaction = $data['obj']; - - $payment_id = $transaction['id'] ?? null; - $amount = $transaction['amount_cents'] ?? 0; - $status = $transaction['success'] ?? false; - $is_voided = $transaction['is_voided'] ?? false; - $is_refunded = $transaction['is_refunded'] ?? false; - $order_id = $transaction['order']['id'] ?? null; - $merchant_order_id = $transaction['order']['merchant_order_id'] ?? null; - $payment_method = $transaction['source_data']['type'] ?? 'unknown'; - $card_last4 = $transaction['source_data']['pan'] ?? '****'; - $transaction_type = $transaction['data']['migs_transaction']['type'] ?? 'UNKNOWN'; - $created_at = $transaction['created_at'] ?? date("Y-m-d H:i:s"); - $user_id = $transaction['order']['shipping_data']['phone_number']; - - $user_id='+'. $user_id; - $amount=$amount/100; - - // التحقق من حالة الدفع - if (!$status) { - error_log("❌ Invalid payment status: " . $status); - echo json_encode(["error" => "Invalid payment status"]); - exit; - } - - // إضافة البيانات إلى قاعدة البيانات - $query = "INSERT INTO payment_log_driver (`payment_id`, `user_id`, `amount`, `status`) - VALUES (:payment_id, :user_id, :amount, :status)"; - - $stmt = $con->prepare($query); - $stmt->bindParam(':payment_id', $payment_id); - $stmt->bindParam(':user_id', $user_id); - $stmt->bindParam(':amount', $amount); - $stmt->bindParam(':status', $status); - - try { - $stmt->execute(); - if ($stmt->rowCount() > 0) { - http_response_code(200); - echo json_encode(["success" => true, "message" => "Payment data saved successfully"]); - error_log("Payment data saved successfully" . $status); - } else { - http_response_code(200); - echo json_encode(["success" => false, "message" => "Payment data already up to date."]); - } - } catch (PDOException $e) { - http_response_code(500); - echo json_encode(["error" => "Failed to execute the query: " . $e->getMessage()]); - } -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymob_webhook.log b/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymob_webhook.log deleted file mode 100644 index e3a76cb..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymob_webhook.log +++ /dev/null @@ -1,33 +0,0 @@ -Transaction ID: 275749381 -Amount (EGP): 25 -Order ID: 308769116 -Merchant Order ID: 67db4baf5ad92 -Payment Method: card (Last 4: 2346) -Transaction Type: PAYMENT -Success: Yes -Voided: No -Refunded: No -Created At: 2025-03-20T00:57:04.742244 ----------------------------- -Transaction ID: 275751796 -Amount (EGP): 25 -Order ID: 308771809 -Merchant Order ID: 67db4dc9f0427 -Payment Method: card (Last 4: 2346) -Transaction Type: PAYMENT -Success: Yes -Voided: No -Refunded: No -Created At: 2025-03-20T01:06:02.249734 ----------------------------- -Transaction ID: 275752145 -Amount (EGP): 25 -Order ID: 308772211 -Merchant Order ID: 67db4e263aafe -Payment Method: card (Last 4: 2346) -Transaction Type: PAYMENT -Success: Yes -Voided: No -Refunded: No -Created At: 2025-03-20T01:07:31.653223 ----------------------------- diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymob_webhook.php b/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymob_webhook.php deleted file mode 100644 index e2e3537..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/paymob_webhook.php +++ /dev/null @@ -1,137 +0,0 @@ -<?php -include "../../jwtconnect.php"; - -// ------------------------------ -// قراءة HMAC من الهيدر أو من الـ query -// ------------------------------ -$received_hmac = $_SERVER['HTTP_HMAC'] ?? ($_GET['hmac'] ?? ''); -$received_hmac = trim($received_hmac); - -// ------------------------------ -// قراءة البيانات القادمة من Paymob -// ------------------------------ -$raw_body = file_get_contents("php://input"); -$data = json_decode($raw_body, true); - -// ------------------------------ -// المفتاح السري -// ------------------------------ -$secret_key = getenv('hmacPaymob'); - -// ------------------------------ -// دالة لتحويل القيم إلى النصوص -// ------------------------------ -function normalize($value) { - if ($value === true) return 'true'; - if ($value === false) return 'false'; - if (is_null($value)) return ''; - return (string)$value; -} - -// ------------------------------ -// التحقق من صحة HMAC -// ------------------------------ -function isValidHmac($data, $secret_key, $received_hmac) { - if (!isset($data['obj'])) return false; - - $obj = $data['obj']; - - // دمج جميع الحقول بشكل متسلسل - $fields = [ - normalize($obj['amount_cents'] ?? ''), - normalize($obj['created_at'] ?? ''), - normalize($obj['currency'] ?? ''), - normalize($obj['error_occured'] ?? false), - normalize($obj['has_parent_transaction'] ?? false), - normalize($obj['id'] ?? ''), - normalize($obj['integration_id'] ?? ''), - normalize($obj['is_3d_secure'] ?? false), - normalize($obj['is_auth'] ?? false), - normalize($obj['is_capture'] ?? false), - normalize($obj['is_refunded'] ?? false), - normalize($obj['is_standalone_payment'] ?? false), - normalize($obj['is_voided'] ?? false), - normalize($obj['order']['id'] ?? ''), - normalize($obj['owner'] ?? ''), - normalize($obj['pending'] ?? false), - normalize($obj['source_data']['pan'] ?? ''), - normalize($obj['source_data']['sub_type'] ?? ''), - normalize($obj['source_data']['type'] ?? ''), - normalize($obj['success'] ?? false) - ]; - - // دمج الحقول في رسالة واحدة - $message = implode('', $fields); - - // حساب HMAC باستخدام المفتاح السري - $calculated_hmac = hash_hmac('sha512', $message, $secret_key); - - // طباعة الرسائل لأغراض التصحيح - // error_log("🔐 Message used for HMAC: " . $message); - // error_log("🔐 Calculated HMAC: " . $calculated_hmac); - // error_log("📩 Received HMAC: " . $received_hmac); - // error_log("Calculated HMAC length: " . strlen($calculated_hmac)); - // error_log("Received HMAC length: " . strlen($received_hmac)); - - // التحقق من تطابق HMAC - if (hash_equals($calculated_hmac, $received_hmac)) { - error_log("✅ Valid HMAC signature verified."); - return $calculated_hmac; - } else { - http_response_code(401); - echo json_encode(["error" => "Unauthorized – Invalid HMAC"]); - exit; - } -} -isValidHmac($data, $secret_key, $received_hmac); -// ------------------------------ -// إذا كانت HMAC صحيحة، نتابع العملية -// ------------------------------ -if ($data && isset($data['obj'])) { - $transaction = $data['obj']; - - $payment_id = $transaction['id'] ?? null; - $amount = $transaction['amount_cents'] ?? 0; - $status = $transaction['success'] ?? false; - $is_voided = $transaction['is_voided'] ?? false; - $is_refunded = $transaction['is_refunded'] ?? false; - $order_id = $transaction['order']['id'] ?? null; - $merchant_order_id = $transaction['order']['merchant_order_id'] ?? null; - $payment_method = $transaction['source_data']['type'] ?? 'unknown'; - $card_last4 = $transaction['source_data']['pan'] ?? '****'; - $transaction_type = $transaction['data']['migs_transaction']['type'] ?? 'UNKNOWN'; - $created_at = $transaction['created_at'] ?? date("Y-m-d H:i:s"); - $user_id = $transaction['order']['shipping_data']['phone_number']; - - // التحقق من حالة الدفع - if (!$status) { - error_log("❌ Invalid payment status: " . $status); - echo json_encode(["error" => "Invalid payment status"]); - exit; - } - - // إضافة البيانات إلى قاعدة البيانات - $query = "INSERT INTO paymentsLog (`payment_id`, `user_id`, `amount`, `status`) - VALUES (:payment_id, :user_id, :amount, :status)"; - - $stmt = $con->prepare($query); - $stmt->bindParam(':payment_id', $payment_id); - $stmt->bindParam(':user_id', $user_id); - $stmt->bindParam(':amount', $amount); - $stmt->bindParam(':status', $status); - - try { - $stmt->execute(); - if ($stmt->rowCount() > 0) { - http_response_code(200); - echo json_encode(["success" => true, "message" => "Payment data saved successfully"]); - } else { - http_response_code(200); - echo json_encode(["success" => false, "message" => "Payment data already up to date."]); - } - } catch (PDOException $e) { - http_response_code(500); - echo json_encode(["error" => "Failed to execute the query: " . $e->getMessage()]); - } -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/wallet/error_log b/walletintaleq.intaleq.xyz/v2/main/ride/payMob/wallet/error_log deleted file mode 100644 index 8dd44f5..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/wallet/error_log +++ /dev/null @@ -1,27 +0,0 @@ -[21-Mar-2025 19:37:11 Europe/Berlin] PHP Notice: Array to string conversion in /home2/seferli1/wallet.sefer.live/seferpw.shop/sefer/ride/payMob/wallet/paymob_webhook.php on line 15 -[21-Mar-2025 19:37:11 Europe/Berlin] Data: Array -[21-Mar-2025 19:37:11 Europe/Berlin] ✅ Valid HMAC signature verified. -[21-Mar-2025 19:37:11 Europe/Berlin] ❌ Invalid payment status: -[21-Mar-2025 19:37:11 Europe/Berlin] ❌ فشل الدفع عبر المحفظة! -[21-Mar-2025 19:37:11 Europe/Berlin] -[21-Mar-2025 19:38:41 Europe/Berlin] PHP Notice: Array to string conversion in /home2/seferli1/wallet.sefer.live/seferpw.shop/sefer/ride/payMob/wallet/paymob_webhook.php on line 15 -[21-Mar-2025 19:38:41 Europe/Berlin] Data: Array -[21-Mar-2025 19:38:41 Europe/Berlin] ✅ Valid HMAC signature verified. -[21-Mar-2025 19:38:41 Europe/Berlin] ❌ Invalid payment status: -[21-Mar-2025 19:38:41 Europe/Berlin] ❌ فشل الدفع عبر المحفظة! -[21-Mar-2025 19:38:41 Europe/Berlin] -[21-Mar-2025 19:39:40 Europe/Berlin] PHP Notice: Array to string conversion in /home2/seferli1/wallet.sefer.live/seferpw.shop/sefer/ride/payMob/wallet/paymob_webhook.php on line 15 -[21-Mar-2025 19:39:40 Europe/Berlin] Data: Array -[21-Mar-2025 19:39:40 Europe/Berlin] ✅ Valid HMAC signature verified. -[21-Mar-2025 19:39:40 Europe/Berlin] ❌ Invalid payment status: -[21-Mar-2025 19:39:40 Europe/Berlin] ❌ فشل الدفع عبر المحفظة! -[21-Mar-2025 19:41:14 Europe/Berlin] ✅ Valid HMAC signature verified. -[21-Mar-2025 19:41:14 Europe/Berlin] ❌ Invalid payment status: -[21-Mar-2025 19:41:14 Europe/Berlin] ❌ فشل الدفع عبر المحفظة! -[21-Mar-2025 19:41:58 Europe/Berlin] ✅ Valid HMAC signature verified. -[21-Mar-2025 19:41:58 Europe/Berlin] ❌ Invalid payment status: -[21-Mar-2025 19:41:59 Europe/Berlin] ❌ فشل الدفع عبر المحفظة! -[21-Mar-2025 19:43:19 Europe/Berlin] redirect_url ishttps://vcheckout.paymobsolutions.com/checkout/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE3NDI1ODI4OTksImlkIjo2MTk5MDYyNzI0fQ.KH7jKKINyVzxJMH9IT2MyiAXRK_yMHVw-f4pIzyHzj0 -[22-Mar-2025 15:38:59 Europe/Berlin] ✅ Valid HMAC signature verified. -[22-Mar-2025 15:38:59 Europe/Berlin] ❌ Invalid payment status: -[22-Mar-2025 15:39:00 Europe/Berlin] ❌ فشل الدفع عبر المحفظة! diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/wallet/payWithPayMob.php b/walletintaleq.intaleq.xyz/v2/main/ride/payMob/wallet/payWithPayMob.php deleted file mode 100644 index 19ab356..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/wallet/payWithPayMob.php +++ /dev/null @@ -1,129 +0,0 @@ -<?php -include "../../../connect.php"; - -// 1. احصل على AUTH TOKEN -$api_key = getenv("payMobApiKey1"); -$integration_id = getenv("paymobIntegratedIdWallet"); -$email = filterRequest("email"); -$first_name = filterRequest("first_name"); -$last_name = filterRequest("last_name"); -$phone_number = filterRequest("phone_number"); -$wallet_phone = filterRequest("phone_number"); -$amount = filterRequest("amount"); - -$auth_url = "https://accept.paymob.com/api/auth/tokens"; -$auth_data = json_encode(["api_key" => $api_key]); - -$response = callAPI("POST", $auth_url, $auth_data); -$auth_token = $response->token ?? null; -if (!$auth_token) { - error_log("❌ فشل الحصول على AUTH TOKEN!"); - die("❌ فشل الحصول على AUTH TOKEN!"); -} - -// 2. أنشئ الطلب ORDER -$order_url = "https://accept.paymob.com/api/ecommerce/orders"; -$order_data = [ - "auth_token" => $auth_token, - "delivery_needed" => false, - "amount_cents" => $amount, - "currency" => "EGP", - "merchant_order_id" => uniqid(), - "items" => [] -]; - -$response = callAPI("POST", $order_url, json_encode($order_data)); -$order_id = $response->id ?? null; -if (!$order_id) { - error_log("❌ فشل إنشاء الطلب!"); - die("❌ فشل إنشاء الطلب!"); -} -// error_log("orde is" .$order_id); -// 3. احصل على Payment Key - -$payment_key_url = "https://accept.paymob.com/api/acceptance/payment_keys"; -$payment_key_data = [ - "auth_token" => $auth_token, - "amount_cents" => $amount, - "expiration" => 3600, - "order_id" => $order_id, - "billing_data" => [ - "first_name" => $first_name, - "last_name" => $last_name, - "email" => $email, - "phone_number" => $phone_number, - "country" => "EG", - "city" => "Cairo", - "state" => "shobra", - "street" => "Test St.", - "building" => "1", - "apartment" => "10", - "floor" => "2", - "postal_code" => "12345", - "shipping_method" => "wallet" - ], - "currency" => "EGP", - "integration_id" => $integration_id // إذا كان مضبوط -]; -$response = callAPI("POST", $payment_key_url, json_encode($payment_key_data)); -$payment_token = $response->token ?? null; -// error_log("payment_token is" .$payment_token); -if (!$payment_token) { - error_log("❌ فشل الحصول على PAYMENT TOKEN!"); - - die("❌ فشل الحصول على PAYMENT TOKEN!"); -} -// error_log("phone wallet is ".$wallet_phone); -// 4. الدفع عبر المحفظة Wallet -$redirect_url = payWithWallet($payment_token, $wallet_phone); -if ($redirect_url) { - printSuccess($redirect_url); - error_log("redirect_url is" .$redirect_url); -} else { - error_log("❌ فشل الدفع عبر المحفظة!"); - printFailure("Payment verified, but failed to generate token."); - // die("❌ فشل الدفع عبر المحفظة!"); -} - -// دالة لطلب API عبر CURL -function callAPI($method, $url, $data) -{ - $curl = curl_init(); - - curl_setopt_array($curl, [ - CURLOPT_URL => $url, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_CUSTOMREQUEST => $method, - CURLOPT_POSTFIELDS => $data, - CURLOPT_HTTPHEADER => ["Content-Type: application/json"] - ]); - - $response = curl_exec($curl); - curl_close($curl); - - return json_decode($response); -} - -// الدالة الخاصة بالدفع بالمحفظة -function payWithWallet($paymentToken, $walletPhone) -{ - $url = "https://accept.paymob.com/api/acceptance/payments/pay"; - - $data = [ - "source" => [ - "identifier" => $walletPhone, - "subtype" => "WALLET" - ], - "payment_token" => $paymentToken - ]; - - // Log the full data being sent to Paymob - // error_log("Data being sent to Paymob: " . json_encode($data)); - - $response = callAPI("POST", $url, json_encode($data)); - - // Log the full response for debugging - // error_log("Payment response: " . print_r($response, true)); - - return $response->redirect_url ?? null; -} \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/wallet/paymet_verfy.php b/walletintaleq.intaleq.xyz/v2/main/ride/payMob/wallet/paymet_verfy.php deleted file mode 100644 index c6c4b37..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/wallet/paymet_verfy.php +++ /dev/null @@ -1,358 +0,0 @@ -<?php -include "../../../connect.php"; - -define("BASE_URL", "https://wl.tripz-egypt.com/v1/main/ride"); -define("LOG_FILE", "../logs/payment_verification.log"); // Define log file path - -// Function to write to error log -function logError($step, $message, $data = null) { - $timestamp = date('Y-m-d H:i:s'); - $logEntry = "[{$timestamp}] STEP {$step}: {$message}"; - - if ($data !== null) { - $logEntry .= " | Data: " . json_encode($data); - } - - // Ensure log directory exists - $logDir = dirname(LOG_FILE); - if (!is_dir($logDir)) { - mkdir($logDir, 0755, true); - } - - // Append to log file - file_put_contents(LOG_FILE, $logEntry . PHP_EOL, FILE_APPEND); - - // Also log to PHP error log for server monitoring - // error_log("PAYMENT_VERIFICATION: {$logEntry}"); -} - -// Receive parameters from GET request -$user_id = filterRequest("user_id"); -$passengerId = filterRequest("passengerId"); -$paymentMethod = filterRequest("paymentMethod"); - -// Log initial request -// logError("0", "Request received", [ -// "user_id" => $user_id, -// "passengerId" => $passengerId -// ]); - -// Validate user_id and passengerId -if (!$user_id || !$passengerId) { - // logError("1", "Invalid parameters", [ - // "user_id" => $user_id, - // "passengerId" => $passengerId - // ]); - printFailure("Invalid user ID or passenger ID."); - exit; -} - -try { - // Step 1: Get the latest successful payment - // logError("1", "Querying latest payment", ["user_id" => $user_id]); - - $stmt = $con->prepare("SELECT * FROM paymentsLog WHERE user_id = :user_id AND created_at >= DATE_SUB(NOW(), INTERVAL 2 MINUTE) -ORDER BY created_at DESC -LIMIT 1"); - $stmt->bindParam(':user_id', $user_id, PDO::PARAM_STR); - $stmt->execute(); - - $payment = $stmt->fetch(PDO::FETCH_ASSOC); - - if (!$payment) { - logError("1", "No payment found", ["user_id" => $user_id]); - printFailure("No payment data found."); - exit; - } - - // logError("1", "Payment found", [ - // "payment_id" => $payment['id'] ?? 'unknown', - // "status" => $payment['status'], - // "amount" => $payment['amount']/100 ?? 'unknown' - // ]); - - // Step 2: Check payment status - if ($payment['status'] != 1) { - // logError("2", "Payment not successful", ["status" => $payment['status']]); - printFailure("Payment is not successful yet."); - exit; - } - - // logError("2", "Payment status verified", ["status" => $payment['status']]); - - $amount = $payment['amount']/100; // Paid amount - - // Step 3: Calculate bonus based on the paid amount - // logError("3", "Calculating bonus", ["amount" => $amount]); - $finalAmount = calculateBonus($amount); - - if ($finalAmount <= 0) { - // logError("3", "Bonus calculation failed", [ - // "original_amount" => $amount, - // "calculated_amount" => $finalAmount - // ]); - printFailure("Invalid amount for bonus calculation."); - exit; - } - - // logError("3", "Bonus calculated", [ - // "original_amount" => $amount, - // "final_amount" => $finalAmount - // ]); - - // // Step 4: Generate payment token - // logError("4", "Generating payment token", [ - // "passengerId" => $passengerId, - // "amount" => $finalAmount - // ]); - - $token = generatePaymentToken($passengerId, $finalAmount); - - if (!$token) { - // logError("4", "Token generation failed"); - printFailure("Payment verified, but failed to generate token."); - exit; - } - - // logError("4", "Token generated successfully", ["token_length" => strlen($token)]); - - // // Step 5: Add balance to passenger's wallet - // logError("5", "Adding balance to passenger wallet", [ - // "passengerId" => $passengerId, - // "amount" => $finalAmount - // ]); - - $walletResult = addToPassengerWallet($passengerId, $finalAmount, $token); - - if (!$walletResult || !isset($walletResult['status']) || $walletResult['status'] != "success") { - // logError("5", "Failed to add balance to passenger wallet", $walletResult); - printFailure("Payment verified, but failed to add balance to passenger wallet."); - exit; - } - - // logError("5", "Balance added to passenger wallet", $walletResult); - - // Step 6: Add balance to Sefer wallet - // logError("6", "Adding balance to Sefer wallet", [ - // "passengerId" => $passengerId, - // "amount" => $finalAmount, - // "paymentMethod" => $paymentMethod - // ]); - - $token = generatePaymentToken($passengerId, $finalAmount); - - if (!$token) { - // logError("4", "Token generation failed"); - printFailure("Payment verified, but failed to generate token."); - exit; - } - - // logError("4", "Token generated successfully", ["token_length" => strlen($token)]); - - $seferWalletResult = addToSeferWallet($passengerId, $amount, $paymentMethod); - - if (!$seferWalletResult || !isset($seferWalletResult['status']) || $seferWalletResult['status'] != "success") { - // logError("6", "Failed to add balance to Sefer wallet", $seferWalletResult); - printFailure("Payment verified, but failed to add balance to Sefer wallet."); - exit; - } - - // logError("6", "Balance added to Sefer wallet", $seferWalletResult); - - // // Final success - // logError("7", "Process completed successfully", [ - // "payment_id" => $payment['id'] ?? 'unknown', - // "amount" => $finalAmount, - // "passengerId" => $passengerId - // ]); - - printSuccess( "Payment data saved successfully"); - -} catch (PDOException $e) { - logError("ERROR", "Database error: " . $e->getMessage()); - printFailure("Database error occurred."); -} catch (Exception $e) { - logError("ERROR", "General error: " . $e->getMessage()); - printFailure("An error occurred during payment verification."); -} - -// 🎯 Function to generate payment token with error logging -function generatePaymentToken($passengerId, $amount) { - $url = BASE_URL . "/passengerWallet/addPaymentTokenPassenger.php"; - - $postData = [ - 'passengerId' => $passengerId, - 'amount' => $amount - ]; - - $ch = curl_init($url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData)); - - $response = curl_exec($ch); - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - $curlError = curl_error($ch); - curl_close($ch); - - if ($curlError) { - logError("4.1", "cURL error in token generation", [ - "error" => $curlError, - "url" => $url - ]); - return null; - } - - if ($httpCode != 200) { - logError("4.2", "HTTP error in token generation", [ - "http_code" => $httpCode, - "response" => $response - ]); - return null; - } - - $data = json_decode($response, true); - - if (!$data || !isset($data['message'])) { - logError("4.3", "Invalid response format in token generation", [ - "response" => $response - ]); - return null; - } - - return $data['message']; // ✅ Return token -} - -// 🎯 Function to add balance to passenger's wallet with error logging -function addToPassengerWallet($passengerId, $amount, $token) { - $url = BASE_URL . "/passengerWallet/add.php"; - - $postData = [ - 'passenger_id' => $passengerId, - 'balance' => $amount, - 'token' => $token - ]; - - $ch = curl_init($url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData)); - - $response = curl_exec($ch); - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - $curlError = curl_error($ch); - curl_close($ch); - - if ($curlError) { - logError("5.1", "cURL error in passenger wallet update", [ - "error" => $curlError, - "url" => $url - ]); - return null; - } - - if ($httpCode != 200) { - logError("5.2", "HTTP error in passenger wallet update", [ - "http_code" => $httpCode, - "response" => $response - ]); - return null; - } - - $data = json_decode($response, true); - - if (!$data) { - logError("5.3", "Invalid response format in passenger wallet update", [ - "response" => $response - ]); - return null; - } - - return $data; // ✅ Return result -} - -// 🎯 Function to add balance to Sefer wallet with error logging - - -function addToSeferWallet($passengerId, $amount, $paymentMethod) { - - - // Generate a new token specifically for the Sefer wallet - $seferToken = generatePaymentToken($passengerId, $amount); - - if (!$seferToken) { - logError("6.0.1", "Failed to generate Sefer token"); - return null; - } - - logError("6.0.2", "Generated new Sefer token", [ - "token_length" => ($seferToken) - ]); - - $url = BASE_URL . "/seferWallet/add.php"; - - $postData = [ - 'amount' => $amount, - 'paymentMethod' => $paymentMethod, - 'passengerId' => $passengerId, - 'token' => $seferToken, // Use the new Sefer-specific token - 'driverId' => 'passenger' - ]; - - $ch = curl_init($url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData)); - - $response = curl_exec($ch); - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - $curlError = curl_error($ch); - curl_close($ch); - - if ($curlError) { - logError("6.1", "cURL error in Sefer wallet update", [ - "error" => $curlError, - "url" => $url - ]); - return null; - } - - if ($httpCode != 200) { - logError("6.2", "HTTP error in Sefer wallet update", [ - "http_code" => $httpCode, - "response" => $response - ]); - return null; - } - - $data = json_decode($response, true); - - if (!$data) { - logError("6.3", "Invalid response format in Sefer wallet update", [ - "response" => $response - ]); - return null; - } - - return $data; // ✅ Return result -} - - -// 🎯 Function to calculate bonus -function calculateBonus($amount) { - logError("3.1", "Bonus calculation input", ["amount" => $amount]); - - $result = 0; - if ($amount == 100) $result = 100; - else if ($amount == 200) $result = 215; - else if ($amount == 400) $result = 450; - else if ($amount == 1000) $result = 1140; - - logError("3.2", "Bonus calculation result", [ - "input" => $amount, - "output" => $result - ]); - - return $result; -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/wallet/paymob_webhook.php b/walletintaleq.intaleq.xyz/v2/main/ride/payMob/wallet/paymob_webhook.php deleted file mode 100644 index ce0ce01..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/payMob/wallet/paymob_webhook.php +++ /dev/null @@ -1,137 +0,0 @@ -<?php -include "../../../jwtconnect.php"; - -// ------------------------------ -// قراءة HMAC من الهيدر أو من الـ query -// ------------------------------ -$received_hmac = $_SERVER['HTTP_HMAC'] ?? ($_GET['hmac'] ?? ''); -$received_hmac = trim($received_hmac); - -// ------------------------------ -// قراءة البيانات القادمة من Paymob -// ------------------------------ -$raw_body = file_get_contents("php://input"); -$data = json_decode($raw_body, true); - -// ------------------------------ -// المفتاح السري -// ------------------------------ -$secret_key = getenv('hmacPaymob'); - -// ------------------------------ -// دالة لتحويل القيم إلى النصوص -// ------------------------------ -function normalize($value) { - if ($value === true) return 'true'; - if ($value === false) return 'false'; - if (is_null($value)) return ''; - return (string)$value; -} - -// ------------------------------ -// التحقق من صحة HMAC -// ------------------------------ -function isValidHmac($data, $secret_key, $received_hmac) { - if (!isset($data['obj'])) return false; - - $obj = $data['obj']; - - // دمج جميع الحقول بشكل متسلسل - $fields = [ - normalize($obj['amount_cents'] ?? ''), - normalize($obj['created_at'] ?? ''), - normalize($obj['currency'] ?? ''), - normalize($obj['error_occured'] ?? false), - normalize($obj['has_parent_transaction'] ?? false), - normalize($obj['id'] ?? ''), - normalize($obj['integration_id'] ?? ''), - normalize($obj['is_3d_secure'] ?? false), - normalize($obj['is_auth'] ?? false), - normalize($obj['is_capture'] ?? false), - normalize($obj['is_refunded'] ?? false), - normalize($obj['is_standalone_payment'] ?? false), - normalize($obj['is_voided'] ?? false), - normalize($obj['order']['id'] ?? ''), - normalize($obj['owner'] ?? ''), - normalize($obj['pending'] ?? false), - normalize($obj['source_data']['pan'] ?? ''), - normalize($obj['source_data']['sub_type'] ?? ''), - normalize($obj['source_data']['type'] ?? ''), - normalize($obj['success'] ?? false) - ]; - - // دمج الحقول في رسالة واحدة - $message = implode('', $fields); - - // حساب HMAC باستخدام المفتاح السري - $calculated_hmac = hash_hmac('sha512', $message, $secret_key); - - // طباعة الرسائل لأغراض التصحيح - // error_log("🔐 Message used for HMAC: " . $message); - // error_log("🔐 Calculated HMAC: " . $calculated_hmac); - // error_log("📩 Received HMAC: " . $received_hmac); - // error_log("Calculated HMAC length: " . strlen($calculated_hmac)); - // error_log("Received HMAC length: " . strlen($received_hmac)); - - // التحقق من تطابق HMAC - if (hash_equals($calculated_hmac, $received_hmac)) { - error_log("✅ Valid HMAC signature verified."); - return $calculated_hmac; - } else { - http_response_code(401); - echo json_encode(["error" => "Unauthorized – Invalid HMAC"]); - exit; - } -} -isValidHmac($data, $secret_key, $received_hmac); -// ------------------------------ -// إذا كانت HMAC صحيحة، نتابع العملية -// ------------------------------ -if ($data && isset($data['obj'])) { - $transaction = $data['obj']; - - $payment_id = $transaction['id'] ?? null; - $amount = $transaction['amount_cents'] ?? 0; - $status = $transaction['success'] ?? false; - $is_voided = $transaction['is_voided'] ?? false; - $is_refunded = $transaction['is_refunded'] ?? false; - $order_id = $transaction['order']['id'] ?? null; - $merchant_order_id = $transaction['order']['merchant_order_id'] ?? null; - $payment_method = $transaction['source_data']['type'] ?? 'unknown'; - $card_last4 = $transaction['source_data']['pan'] ?? '****'; - $transaction_type = $transaction['data']['migs_transaction']['type'] ?? 'UNKNOWN'; - $created_at = $transaction['created_at'] ?? date("Y-m-d H:i:s"); - $user_id = $transaction['order']['shipping_data']['phone_number']; - - // التحقق من حالة الدفع - if (!$status) { - error_log("❌ Invalid payment status: " . $status); - echo json_encode(["error" => "Invalid payment status"]); - exit; - } - - // إضافة البيانات إلى قاعدة البيانات - $query = "INSERT INTO paymentsLog (`payment_id`, `user_id`, `amount`, `status`) - VALUES (:payment_id, :user_id, :amount, :status)"; - - $stmt = $con->prepare($query); - $stmt->bindParam(':payment_id', $payment_id); - $stmt->bindParam(':user_id', $user_id); - $stmt->bindParam(':amount', $amount); - $stmt->bindParam(':status', $status); - - try { - $stmt->execute(); - if ($stmt->rowCount() > 0) { - http_response_code(200); - echo json_encode(["success" => true, "message" => "Payment data saved successfully"]); - } else { - http_response_code(200); - echo json_encode(["success" => false, "message" => "Payment data already up to date."]); - } - } catch (PDOException $e) { - http_response_code(500); - echo json_encode(["error" => "Failed to execute the query: " . $e->getMessage()]); - } -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/payment/add.php b/walletintaleq.intaleq.xyz/v2/main/ride/payment/add.php index 59ce9b2..ad2503b 100644 --- a/walletintaleq.intaleq.xyz/v2/main/ride/payment/add.php +++ b/walletintaleq.intaleq.xyz/v2/main/ride/payment/add.php @@ -9,33 +9,45 @@ $rideId = filterRequest("rideId"); $driverID = filterRequest("driverID"); $token = filterRequest("token"); -// ✅ تحقق من التوكن -$stmt = $con->prepare("SELECT * FROM payment_tokens WHERE token = :token AND isUsed = FALSE"); -$stmt->execute([ ':token' => $token ]); -$tokenData = $stmt->fetch(); +try { + $con->beginTransaction(); -if ($tokenData) { - // ✅ إدخال الدفع بمفتاح قصير وخفيف - $sql = "INSERT INTO payments (id, amount, payment_method, passengerID, rideId, driverID) - VALUES (UUID_SHORT(), :amount, :payment_method, :passengerID, :rideId, :driverID)"; - $stmt = $con->prepare($sql); - $stmt->execute([ - ':amount' => $amount, - ':payment_method' => $payment_method, - ':passengerID' => $passengerID, - ':rideId' => $rideId, - ':driverID' => $driverID - ]); + // ✅ تحقق من التوكن مع قفل السجل (FOR UPDATE) لمنع ثغرة السباق (Race Condition) + $stmt = $con->prepare("SELECT * FROM payment_tokens WHERE token = :token AND isUsed = FALSE FOR UPDATE"); + $stmt->execute([ ':token' => $token ]); + $tokenData = $stmt->fetch(); - if ($stmt->rowCount() > 0) { - printSuccess("Payment record created successfully"); + if ($tokenData) { + // ✅ إدخال الدفع بمفتاح قصير وخفيف + $sql = "INSERT INTO payments (id, amount, payment_method, passengerID, rideId, driverID) + VALUES (UUID_SHORT(), :amount, :payment_method, :passengerID, :rideId, :driverID)"; + $stmtInsert = $con->prepare($sql); + $stmtInsert->execute([ + ':amount' => $amount, + ':payment_method' => $payment_method, + ':passengerID' => $passengerID, + ':rideId' => $rideId, + ':driverID' => $driverID + ]); - // ✅ تحديث حالة التوكن - $stmt = $con->prepare("UPDATE payment_tokens SET isUsed = TRUE WHERE id = :tokenID"); - $stmt->execute([ ':tokenID' => $tokenData['id'] ]); + if ($stmtInsert->rowCount() > 0) { + // ✅ تحديث حالة التوكن + $stmtUpdate = $con->prepare("UPDATE payment_tokens SET isUsed = TRUE WHERE id = :tokenID"); + $stmtUpdate->execute([ ':tokenID' => $tokenData['id'] ]); + + $con->commit(); + printSuccess("Payment record created successfully"); + } else { + $con->rollBack(); + printFailure("Failed to save record"); + } } else { - printFailure("Failed to save record"); + $con->rollBack(); + printFailure("Invalid or already used token"); } -} else { - printFailure("Invalid or already used token"); +} catch (Exception $e) { + if ($con->inTransaction()) { + $con->rollBack(); + } + printFailure("An error occurred: " . $e->getMessage()); } \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/promo/add.php b/walletintaleq.intaleq.xyz/v2/main/ride/promo/add.php deleted file mode 100644 index 997a4fd..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/promo/add.php +++ /dev/null @@ -1,33 +0,0 @@ -<?php -include "../../connect.php"; - -$promoCode = filterRequest("promoCode"); -$amount = filterRequest("amount"); -$description = filterRequest("description"); -$validityStartDate = filterRequest("validityStartDate"); -$validityEndDate = filterRequest("validityEndDate"); - -$sql = "INSERT INTO `promos` ( - `promo_code`, - `amount`, - `description`, - `validity_start_date`, - `validity_end_date` -) VALUES ( - '$promoCode', '$amount', - '$description', - '$validityStartDate', - '$validityEndDate' -)"; - -$stmt = $con->prepare($sql); -$stmt->execute(); - -if ($stmt->rowCount() > 0) { - // Print a success message - printSuccess($message = "Promo data saved successfully"); -} else { - // Print a failure message - printFailure($message = "Failed to save promo data"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/promo/delete.php b/walletintaleq.intaleq.xyz/v2/main/ride/promo/delete.php deleted file mode 100644 index 0f92110..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/promo/delete.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php -include "../../connect.php"; - -$id = filterRequest("id"); - -$sql = "DELETE FROM `promos` WHERE `id` = '$id'"; - -$stmt = $con->prepare($sql); -$stmt->execute(); - -if ($stmt->rowCount() > 0) { - // Print a success message - printSuccess($message = "Promo data deleted successfully"); -} else { - // Print a failure message - printFailure($message = "Failed to delete promo data"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/promo/error_log b/walletintaleq.intaleq.xyz/v2/main/ride/promo/error_log deleted file mode 100644 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/promo/get.php b/walletintaleq.intaleq.xyz/v2/main/ride/promo/get.php deleted file mode 100644 index 0812074..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/promo/get.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php -include "../../connect.php"; - - -$promo_code = filterRequest("promo_code"); - -$sql = "SELECT - `id`, - `promo_code`, - `amount`, - `description`, - `validity_start_date`, - `validity_end_date` -FROM - `promos` -WHERE - `promo_code` = '$promo_code' AND CURDATE() BETWEEN validity_start_date AND validity_end_date;"; - -$stmt = $con->prepare($sql); -$stmt->execute(); -$result = $stmt->fetchAll(PDO::FETCH_ASSOC); - -if ($result) { - // Print all promo records - printSuccess( $result); -} else { - // Print a failure message - printFailure($message = "Failed to retrieve promo records"); - -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/promo/getPromoBytody.php b/walletintaleq.intaleq.xyz/v2/main/ride/promo/getPromoBytody.php deleted file mode 100644 index a38dbb4..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/promo/getPromoBytody.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php -include "../../connect.php"; - - -// $promo_code = filterRequest("promo_code"); - -$sql = "SELECT `id`, `promo_code`, `amount`, `description`, `validity_start_date`, `validity_end_date` FROM `promos` WHERE `validity_start_date`=CURDATE();"; - -$stmt = $con->prepare($sql); -$stmt->execute(); -$result = $stmt->fetchAll(PDO::FETCH_ASSOC); - -if ($result) { - // Print all promo records - printSuccess( $result); -} else { - // Print a failure message - printFailure($message = "Failed to retrieve promo records"); - -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/promo/update.php b/walletintaleq.intaleq.xyz/v2/main/ride/promo/update.php deleted file mode 100644 index fd1f4d6..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/promo/update.php +++ /dev/null @@ -1,27 +0,0 @@ -<?php -include "../../connect.php"; - -$id = filterRequest("id"); -$promoCode = filterRequest("promoCode"); -$description = filterRequest("description"); -$validityStartDate = filterRequest("validityStartDate"); -$validityEndDate = filterRequest("validityEndDate"); - -$sql = "UPDATE `promos` SET - `promo_code` = '$promoCode', - `description` = '$description', - `validity_start_date` = '$validityStartDate', - `validity_end_date` = '$validityEndDate' -WHERE `id` = '$id'"; - -$stmt = $con->prepare($sql); -$stmt->execute(); - -if ($stmt->rowCount() > 0) { - // Print a success message - printSuccess($message = "Promo data updated successfully"); -} else { - // Print a failure message - printFailure($message = "Failed to update promo data"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/check_status.php b/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/check_status.php deleted file mode 100755 index 7b8e290..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/check_status.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -// shamcash/check_status.php -include "../../connect.php"; - -$invoice_number = filterRequest("invoice_number"); - -if (empty($invoice_number)) { printFailure("invoice_number required"); exit; } - -try { - $stmt = $con->prepare("SELECT status FROM invoices_shamcash WHERE invoice_number = :inv LIMIT 1"); - $stmt->execute(['inv' => $invoice_number]); - $res = $stmt->fetch(PDO::FETCH_ASSOC); - - if ($res) { - echo json_encode(["status" => "success", "invoice_status" => $res['status']]); - } else { - printFailure("Invoice not found"); - } -} catch (PDOException $e) { - printFailure("Error: " . $e->getMessage()); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/create_invoice_shamcash.php b/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/create_invoice_shamcash.php deleted file mode 100755 index be4d1ce..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/create_invoice_shamcash.php +++ /dev/null @@ -1,45 +0,0 @@ -<?php -// shamcash/create_invoice_shamcash.php -// ينشئ الفاتورة ويعيد رقمها للسائق ليكتبه في الملاحظات - -include "../../connect.php"; - -try { - $driverID = filterRequest("driverID"); - $amount_raw = filterRequest("amount"); - - $amount = is_numeric($amount_raw) ? (float) $amount_raw : 0.0; - - if (empty($driverID) || $amount <= 0) { - printFailure("Required: driverID, amount"); - exit; - } - - // البحث عن فاتورة معلقة لنفس السائق والمبلغ (لتجنب التكرار) - $stmt = $con->prepare("SELECT id, invoice_number FROM invoices_shamcash WHERE driverID = ? AND amount = ? AND status = 'pending' LIMIT 1"); - $stmt->execute([$driverID, $amount]); - $existing = $stmt->fetch(PDO::FETCH_ASSOC); - - $invoice_number = 0; - - if ($existing) { - // استخدام الفاتورة الموجودة وتحديث وقتها - $invoice_number = $existing['invoice_number']; - $con->prepare("UPDATE invoices_shamcash SET created_at=NOW() WHERE id=?")->execute([$existing['id']]); - } else { - // إنشاء فاتورة جديدة برقم عشوائي - $invoice_number = random_int(100000, 999999); - $stmtIns = $con->prepare("INSERT INTO invoices_shamcash (invoice_number, driverID, amount, status, created_at) VALUES (?, ?, ?, 'pending', NOW())"); - $stmtIns->execute([$invoice_number, $driverID, $amount]); - } - - echo json_encode([ - "status" => "success", - "message" => "Invoice created. Please use invoice_number in ShamCash Notes.", - "invoice_number" => $invoice_number - ]); - -} catch (PDOException $e) { - printFailure("DB Error: " . $e->getMessage()); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/deposit_errors.log b/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/deposit_errors.log deleted file mode 100644 index 07d1f21..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/deposit_errors.log +++ /dev/null @@ -1,7 +0,0 @@ -[2025-12-09 06:20:37] STEP SUCCESS: Transaction finalized for Invoice #18 -[2025-12-15 08:34:59] STEP SUCCESS: Transaction finalized for Invoice #22 -[2025-12-15 15:30:46] STEP SUCCESS: Transaction finalized for Invoice #27 -[2025-12-15 15:42:50] STEP SUCCESS: Transaction finalized for Invoice #28 -[2025-12-17 15:38:39] STEP SUCCESS: Transaction finalized for Invoice #32 -[2025-12-21 20:55:04] STEP SUCCESS: Transaction finalized for Invoice #39 -[2026-01-08 15:49:00] STEP SUCCESS: Transaction finalized for Invoice #48 diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/finalize_deposit.php b/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/finalize_deposit.php deleted file mode 100755 index 71d104c..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/finalize_deposit.php +++ /dev/null @@ -1,120 +0,0 @@ -<?php -// shamcash/finalize_deposit.php -// نظام الإيداع المتقدم (مع البونص وتسجيل الحركات المزدوجة) - -// مسار ملف السجلات -define("LOG_FILE_FINALIZE", __DIR__ . "/deposit_errors.log"); - -if (!function_exists('logError')) { - function logError($step, $message, $data = null) { - $logEntry = "[" . date('Y-m-d H:i:s') . "] STEP {$step}: {$message}"; - if ($data !== null) { $logEntry .= " | Data: " . json_encode($data, JSON_UNESCAPED_UNICODE); } - file_put_contents(LOG_FILE_FINALIZE, $logEntry . PHP_EOL, FILE_APPEND); - } -} - -if (!function_exists('generateToken')) { - function generateToken($con, $driverId, $amount) { - $data = $driverId . $amount . time() . 'shamcash_secret'; - $hash = hash('sha256', $data); - $randomBytes = bin2hex(random_bytes(16)); - $token = substr($hash . $randomBytes, 0, 64); - - $stmt = $con->prepare("INSERT INTO payment_tokens (token, driverID, dateCreated, amount) VALUES (:token, :driverID, NOW(), :amount)"); - $stmt->execute([':token' => $token, ':driverID' => $driverId, ':amount' => $amount]); - return $stmt->rowCount() > 0 ? $token : null; - } -} - -if (!function_exists('generatePaymentID')) { - function generatePaymentID($con, $driverId, $amount, $method) { - $stmt = $con->prepare("INSERT INTO paymentsDriverPoints (`amount`, `payment_method`, `driverID`) VALUES (:amount, :method, :driverID)"); - $stmt->execute([':driverID' => $driverId, ':amount' => $amount, ':method' => $method]); - return $stmt->rowCount() > 0 ? $con->lastInsertId() : null; - } -} - -if (!function_exists('finalizeShamCashDeposit')) { - function finalizeShamCashDeposit(PDO $con, $invoice_id) { - - // 1. جلب بيانات الفاتورة - $stmt = $con->prepare("SELECT * FROM invoices_shamcash WHERE id = :id AND status = 'processing' LIMIT 1"); - $stmt->execute([':id' => $invoice_id]); - $invoice = $stmt->fetch(PDO::FETCH_ASSOC); - - if (!$invoice) { - logError("INIT", "Invoice not found or not processing", ['id' => $invoice_id]); - return false; - } - - // بدء معاملة لضمان سلامة البيانات - $con->beginTransaction(); - - try { - $driverId = $invoice['driverID']; - $originalAmount = (float)$invoice['amount']; - $paymentMethod = 'shamcash'; - - // 2. حساب المكافأة (Bonus Calculation) - نفس المنطق المرسل - $bonusAmount = match ((int)$originalAmount) { - 100 => 100.0, - 200 => 210.0, - 400 => 450.0, - 1000 => 1100.0, - default => $originalAmount, - }; - - // 3. إنشاء التوكنات - $tokenDriver = generateToken($con, $driverId, $bonusAmount); - if (!$tokenDriver) throw new Exception('Failed to generate driver token'); - - $tokenSefer = generateToken($con, $driverId, $originalAmount); - if (!$tokenSefer) throw new Exception('Failed to generate sefer token'); - - // 4. إنشاء Payment ID - $paymentID = generatePaymentID($con, $driverId, $bonusAmount, $paymentMethod); - if (!$paymentID) throw new Exception('Failed to generate payment ID'); - - // 5. الإيداع في محفظة السائق (driverWallet) - المبلغ مع البونص - $insertDriver = $con->prepare("INSERT INTO driverWallet (driverID, paymentID, amount, paymentMethod) VALUES (:driverID, :paymentID, :amount, :paymentMethod)"); - $insertDriver->execute([ - ':driverID' => $driverId, - ':paymentID' => $paymentID, - ':amount' => $bonusAmount, - ':paymentMethod' => $paymentMethod - ]); - if ($insertDriver->rowCount() === 0) throw new Exception('Insert to driverWallet failed'); - - // حرق توكن السائق - $con->prepare("UPDATE payment_tokens SET isUsed = TRUE WHERE token = :token")->execute([':token' => $tokenDriver]); - - // 6. الإيداع في محفظة الشركة (seferWallet) - المبلغ الأصلي - $insertSefer = $con->prepare("INSERT INTO seferWallet (driverId, passengerId, amount, paymentMethod, token, createdAt) VALUES (:driverId, :passengerId, :amount, :paymentMethod, :token, CURRENT_TIMESTAMP)"); - $insertSefer->execute([ - ':driverId' => $driverId, - ':passengerId' => 'driver', - ':amount' => $originalAmount, - ':paymentMethod' => $paymentMethod, - ':token' => $tokenSefer - ]); - if ($insertSefer->rowCount() === 0) throw new Exception('Insert to seferWallet failed'); - - // حرق توكن الشركة - $con->prepare("UPDATE payment_tokens SET isUsed = TRUE WHERE token = :token")->execute([':token' => $tokenSefer]); - - // 7. تحديث حالة الفاتورة إلى مكتملة - $con->prepare("UPDATE invoices_shamcash SET status = 'completed', paid_at = NOW() WHERE id = :id")->execute([':id' => $invoice_id]); - - // اعتماد المعاملة - $con->commit(); - logError("SUCCESS", "Transaction finalized for Invoice #$invoice_id"); - return true; - - } catch (Throwable $e) { - $con->rollBack(); - logError("EXCEPTION", $e->getMessage(), ['invoice_id' => $invoice_id]); - return false; - } - } -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/last_id.txt b/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/last_id.txt deleted file mode 100644 index e0dfa7f..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/last_id.txt +++ /dev/null @@ -1 +0,0 @@ -120840498 \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/passenger/check_status.php b/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/passenger/check_status.php deleted file mode 100755 index 93cc5d9..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/passenger/check_status.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -// shamcash/passenger/check_status.php -include "../../../connect.php"; - -$invoice_number = filterRequest("invoice_number"); - -if (empty($invoice_number)) { printFailure("invoice_number required"); exit; } - -try { - $stmt = $con->prepare("SELECT status FROM invoices_shamcash_passenger WHERE invoice_number = :inv LIMIT 1"); - $stmt->execute(['inv' => $invoice_number]); - $res = $stmt->fetch(PDO::FETCH_ASSOC); - - if ($res) { - echo json_encode(["status" => "success", "invoice_status" => $res['status']]); - } else { - printFailure("Invoice not found"); - } -} catch (PDOException $e) { - printFailure("Error: " . $e->getMessage()); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/passenger/create_invoice.php b/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/passenger/create_invoice.php deleted file mode 100755 index 696c08f..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/passenger/create_invoice.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php -// shamcash/passenger/create_invoice.php - -include "../../../connect.php"; - -try { - $passengerID = filterRequest("passengerID"); - $amount_raw = filterRequest("amount"); - $amount = is_numeric($amount_raw) ? (float) $amount_raw : 0.0; - - if (empty($passengerID) || $amount <= 0) { - printFailure("Required: passengerID and valid amount"); - exit; - } - - // البحث عن فاتورة معلقة لنفس الراكب - $stmt = $con->prepare("SELECT id, invoice_number FROM invoices_shamcash_passenger WHERE passengerID = ? AND amount = ? AND status = 'pending' LIMIT 1"); - $stmt->execute([$passengerID, $amount]); - $existing = $stmt->fetch(PDO::FETCH_ASSOC); - - $invoice_number = 0; - - if ($existing) { - $invoice_number = $existing['invoice_number']; - $con->prepare("UPDATE invoices_shamcash_passenger SET created_at=NOW() WHERE id=?")->execute([$existing['id']]); - } else { - $invoice_number = random_int(100000, 999999); - $stmtIns = $con->prepare("INSERT INTO invoices_shamcash_passenger (invoice_number, passengerID, amount, status, created_at) VALUES (?, ?, ?, 'pending', NOW())"); - $stmtIns->execute([$invoice_number, $passengerID, $amount]); - } - - echo json_encode([ - "status" => "success", - "message" => "Invoice created", - "invoice_number" => $invoice_number - ]); - -} catch (PDOException $e) { - printFailure("DB Error: " . $e->getMessage()); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/passenger/finalize_deposit.php b/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/passenger/finalize_deposit.php deleted file mode 100755 index 7fb6eb9..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/passenger/finalize_deposit.php +++ /dev/null @@ -1,127 +0,0 @@ -<?php -// shamcash/passenger/finalize_deposit.php -// محرك الإيداع للركاب - شام كاش (مقتبس من منطق Syriatel/MTN) - -// ملف سجلات الأخطاء المالي -define("LOG_FILE_FINALIZE_PASSENGER", __DIR__ . "/deposit_financial_passenger.log"); - -if (!function_exists('logFinancialPassenger')) { - function logFinancialPassenger($step, $message, $data = null) { - $logDir = dirname(LOG_FILE_FINALIZE_PASSENGER); - if (!is_dir($logDir)) { mkdir($logDir, 0755, true); } - - $entry = "[" . date('Y-m-d H:i:s') . "] STEP {$step}: {$message}"; - if ($data) $entry .= " | Data: " . json_encode($data, JSON_UNESCAPED_UNICODE); - file_put_contents(LOG_FILE_FINALIZE_PASSENGER, $entry . PHP_EOL, FILE_APPEND); - } -} - -// دوال مساعدة (Helpers) - تحاكي دوال الـ API الموجودة في كودك القديم -// في بيئة الإنتاج، يفضل استدعاء ملفات الـ API الموجودة لديك بالفعل لضمان التوافق -// لكن هنا سنكتب المنطق المباشر لقاعدة البيانات للسرعة والوضوح - -if (!function_exists('calculateBonusPassenger')) { - function calculateBonusPassenger($amount) { - // نفس منطق البونص الذي أرسلته - return match ((int)$amount) { - - 500 => 530.0, - 1000 => 1000.0, - 2000 => 2180.0, - 5000 => 5700.0, - default => (float)$amount, - }; - } -} - -if (!function_exists('generatePassengerToken')) { - function generatePassengerToken(PDO $con, $passengerId, $amount) { - // إنشاء توكن فريد - $data = $passengerId . $amount . time() . 'shamcash_passenger_secret'; - $hash = hash('sha256', $data); - $token = substr($hash . bin2hex(random_bytes(16)), 0, 64); - - // حفظ التوكن (افترضنا وجود جدول payment_tokens_passenger أو استخدام الجدول العام) - // سأستخدم الجدول العام payment_tokens مع وضع passengerId مكان driverID مؤقتاً - // أو يفضل استخدام جدول خاص للركاب لتجنب الخلط - - // الخيار الأفضل: استخدام جدول `payment_tokens` ولكن تأكد من العمود (driverID) - // سأفترض أنك ستستخدم جدول `payment_tokens_passenger` الذي اقترحته في الـ SQL السابق - - $stmt = $con->prepare("INSERT INTO payment_tokens_passenger (token, passengerID, dateCreated, amount) VALUES (:token, :id, NOW(), :amount)"); - $stmt->execute([':token' => $token, ':id' => $passengerId, ':amount' => $amount]); - - return $stmt->rowCount() > 0 ? $token : null; - } -} - -if (!function_exists('finalizePassengerDeposit')) { - function finalizePassengerDeposit(PDO $con, $invoice_id) { - - // 1. جلب الفاتورة (يجب أن تكون في حالة processing) - $stmt = $con->prepare("SELECT * FROM invoices_shamcash_passenger WHERE id = :id AND status = 'processing' LIMIT 1"); - $stmt->execute([':id' => $invoice_id]); - $invoice = $stmt->fetch(PDO::FETCH_ASSOC); - - if (!$invoice) { - logFinancialPassenger("INIT", "Invoice not found or not processing", ['id' => $invoice_id]); - return false; - } - - $con->beginTransaction(); - - try { - $passengerId = $invoice['passengerID']; - $originalAmount = (float)$invoice['amount']; - $paymentMethod = 'shamcash'; - - // 2. حساب المكافأة (Bonus) - $finalAmount = calculateBonusPassenger($originalAmount); - - // 3. إنشاء التوكنات - $tokenPassenger = generatePassengerToken($con, $passengerId, $finalAmount); - $tokenSefer = generatePassengerToken($con, $passengerId, $originalAmount); - - if (!$tokenPassenger || !$tokenSefer) throw new Exception('Token generation failed'); - - // 4. الإيداع في محفظة الراكب (passengerWallet) - // نضيف المبلغ النهائي (مع البونص) - $stmtPassenger = $con->prepare("INSERT INTO passengerWallet (passenger_id, balance, type, create_at) VALUES (:pid, :amt, 'deposit', NOW())"); - // ملاحظة: تأكد من أسماء الأعمدة في جدول passengerWallet لديك - // في كودك القديم كان يستخدم API: /passengerWallet/add.php - // سأفترض هنا الإدخال المباشر أو تحديث الرصيد - - - // حرق توكن الراكب - $con->prepare("UPDATE payment_tokens_passenger SET isUsed = TRUE WHERE token = :t")->execute([':t' => $tokenPassenger]); - - // 5. الإيداع في محفظة الشركة (seferWallet) - // نسجل المبلغ الأصلي (بدون البونص) كإيراد - $insertSefer = $con->prepare("INSERT INTO seferWallet (driverId, passengerId, amount, paymentMethod, token, createdAt) VALUES ('passenger', :pid, :amt, :pm, :tok, NOW())"); - $insertSefer->execute([ - ':pid' => $passengerId, - ':amt' => $originalAmount, - ':pm' => $paymentMethod, - ':tok' => $tokenSefer - ]); - - if ($insertSefer->rowCount() === 0) throw new Exception('Insert to seferWallet failed'); - - // حرق توكن الشركة - $con->prepare("UPDATE payment_tokens_passenger SET isUsed = TRUE WHERE token = :t")->execute([':t' => $tokenSefer]); - - // 6. تحديث الفاتورة للنهاية - $con->prepare("UPDATE invoices_shamcash_passenger SET status = 'completed', paid_at = NOW() WHERE id = :id")->execute([':id' => $invoice_id]); - - $con->commit(); - logFinancialPassenger("SUCCESS", "Deposit finalized for Passenger Inv #$invoice_id | Amount: $finalAmount"); - return true; - - } catch (Throwable $e) { - $con->rollBack(); - logFinancialPassenger("EXCEPTION", $e->getMessage(), ['id' => $invoice_id]); - return false; - } - } -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/save_transactions.php b/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/save_transactions.php deleted file mode 100755 index 259ecc3..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/save_transactions.php +++ /dev/null @@ -1,121 +0,0 @@ -<?php -// shamcash/save_transactions.php (Debug Edition) - -ini_set('display_errors', 0); -error_reporting(E_ALL); -header("Access-Control-Allow-Origin: *"); -header("Content-Type: application/json"); - -$log_file = __DIR__ . '/transactions.log'; -$last_id_file = __DIR__ . '/last_id.txt'; - -function logMsg($msg) { - global $log_file; - $time = date('[Y-m-d H:i:s]'); - @file_put_contents($log_file, "$time $msg" . PHP_EOL, FILE_APPEND); -} - -if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') { http_response_code(200); exit; } - -// الاتصال بقاعدة البيانات -$paths = [__DIR__.'/../jwtconnect.php', __DIR__.'/../../jwtconnect.php', __DIR__.'/../../../jwtconnect.php']; -foreach ($paths as $p) { if (file_exists($p)) { include $p; if(isset($con)) break; } } -if (!isset($con)) { logMsg("CRITICAL: DB Connection Failed"); exit(json_encode(["status" => "error", "msg" => "DB Failed"])); } - -if (file_exists(__DIR__ . "/finalize_deposit.php")) include_once __DIR__ . "/finalize_deposit.php"; -if (file_exists(__DIR__ . "/passenger/finalize_deposit.php")) include_once __DIR__ . "/passenger/finalize_deposit.php"; - -// استلام البيانات -$raw_input = file_get_contents("php://input"); -$data = json_decode($raw_input, true); - -if (!$data) { - logMsg("WARNING: Received empty JSON"); - echo json_encode(["status" => "waiting"]); exit; -} - -$txns = []; -if (isset($data['id'])) { - $txns[] = $data; -} else if (is_array($data)) { - $txns = array_reverse($data); -} - -// قراءة آخر ID -if (!file_exists($last_id_file)) { @file_put_contents($last_id_file, "0"); } -$last_id_on_file = (int)@file_get_contents($last_id_file); -$max_id_processed = $last_id_on_file; -$processed_count = 0; - -foreach ($txns as $trx) { - $tid = isset($trx['id']) ? (int)preg_replace('/[^0-9]/', '', $trx['id']) : 0; - $amt = (float)($trx['amount'] ?? 0); - $note = $trx['note'] ?? ''; // الملاحظة الخام كما وصلت - - // 🔍🔍🔍 نقطة كشف الحقيقة: تسجيل البيانات فور وصولها 🔍🔍🔍 - // هذا السطر سيخبرك بالضبط ماذا وصل من الاندرويد قبل أي معالجة - logMsg("📥 RECEIVED -> ID:$tid | Amt:$amt | Note:$note"); - - // التحقق هل العملية جديدة - if ($tid > $last_id_on_file) { - - $invoice_num = preg_replace('/[^0-9]/', '', $note); - $status_log = "IGNORED"; - - if ($amt > 0 && !empty($invoice_num) && strlen($invoice_num) >= 4) { - - // 1. معالجة السائق - $stmt = $con->prepare("SELECT id FROM invoices_shamcash WHERE invoice_number = ? AND amount = ? AND status = 'pending' LIMIT 1"); - $stmt->execute([$invoice_num, $amt]); - $drvInv = $stmt->fetch(PDO::FETCH_ASSOC); - - if ($drvInv) { - $iid = $drvInv['id']; - $con->prepare("UPDATE invoices_shamcash SET status='processing', transaction_id=? WHERE id=?")->execute([$tid, $iid]); - - if (function_exists('finalizeShamCashDeposit') && finalizeShamCashDeposit($con, $iid)) { - $status_log = "SUCCESS_DRIVER (Inv#$iid)"; - } else { - $status_log = "FAILED_DRIVER_FINALIZE (Inv#$iid)"; - } - } - // 2. معالجة الراكب - else { - $stmtPass = $con->prepare("SELECT id FROM invoices_shamcash_passenger WHERE invoice_number = ? AND amount = ? AND status = 'pending' LIMIT 1"); - $stmtPass->execute([$invoice_num, $amt]); - $passInv = $stmtPass->fetch(PDO::FETCH_ASSOC); - - if ($passInv) { - $iid = $passInv['id']; - $con->prepare("UPDATE invoices_shamcash_passenger SET status='processing', transaction_id=? WHERE id=?")->execute([$tid, $iid]); - if (function_exists('finalizePassengerDeposit') && finalizePassengerDeposit($con, $iid)) { - $status_log = "SUCCESS_PASSENGER (Inv#$iid)"; - } else { - $status_log = "FAILED_PASSENGER_FINALIZE (Inv#$iid)"; - } - } else { - $status_log = "NO_MATCH (Inv:$invoice_num)"; - } - } - } else { - if (empty($invoice_num)) $status_log = "IGNORED_NO_INVOICE"; - } - - // تسجيل نتيجة المعالجة - logMsg("⚙️ PROCESSED -> ID:$tid | Status:$status_log"); - - if ($tid > $max_id_processed) $max_id_processed = $tid; - $processed_count++; - - } else { - // إذا كانت العملية قديمة - logMsg("⚠️ SKIPPED (OLD) -> ID:$tid is <= Last:$last_id_on_file"); - } -} - -if ($max_id_processed > $last_id_on_file) { - @file_put_contents($last_id_file, $max_id_processed); -} - -echo json_encode(["status" => "success", "processed" => $processed_count]); -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/save_transactions_new.php b/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/save_transactions_new.php deleted file mode 100755 index bba7195..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/save_transactions_new.php +++ /dev/null @@ -1,117 +0,0 @@ - - -<?php -// shamcash/save_transactions.php -// يعتمد حصرياً على Note (Invoice Number) - -ini_set('display_errors', 0); -error_reporting(E_ALL); - -header("Access-Control-Allow-Origin: *"); -header("Content-Type: application/json"); -header("Access-Control-Allow-Methods: POST, OPTIONS"); -header("Access-Control-Allow-Headers: Content-Type"); - -$log_file = __DIR__ . '/transactions.log'; -$last_id_file = __DIR__ . '/last_id.txt'; - -function logMsg($msg) { - global $log_file; - $time = date('[H:i:s]'); - @file_put_contents($log_file, "$time $msg" . PHP_EOL, FILE_APPEND); -} - -if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') { - http_response_code(200); exit; -} - -// --- 1. الاتصال بقاعدة البيانات --- -// البحث عن connect.php في المجلدات العلوية -$possible_paths = [__DIR__ . '/../jwtconnect.php', __DIR__ . '/../../jwtconnect.php']; -$db_connected = false; -foreach ($possible_paths as $path) { - if (file_exists($path)) { include $path; if(isset($con)){ $db_connected = true; break; } } -} - -if (!$db_connected) { - logMsg("CRITICAL: DB Connection Failed."); - echo json_encode(["status" => "error", "msg" => "DB Failed"]); exit; -} - -// تضمين ملف الإيداع المالي -if (file_exists(__DIR__ . "/finalize_deposit.php")) { - include __DIR__ . "/finalize_deposit.php"; -} else { - logMsg("CRITICAL: finalize_deposit.php missing"); exit; -} - -// --- 2. استقبال البيانات --- -$raw = file_get_contents("php://input"); -if (empty($raw)) { echo json_encode(["status" => "waiting"]); exit; } -$data = json_decode($raw, true); -if (!$data) { echo json_encode(["status" => "error"]); exit; } - -if (!file_exists($last_id_file)) { @file_put_contents($last_id_file, "0"); } -$last_id = (int)@file_get_contents($last_id_file); - -// --- 3. المعالجة --- -$processed = 0; -$txns = array_reverse($data); - -foreach ($txns as $trx) { - $tid = isset($trx['id']) ? (int)$trx['id'] : 0; - - if ($tid > $last_id) { - $amt = (float)($trx['amount'] ?? 0); - $note = $trx['note'] ?? ''; - $status_log = "IGNORED"; - - // شرط الإيداع: مبلغ موجب + وجود ملاحظة رقمية - // نستخرج الأرقام فقط من الملاحظة (رقم الفاتورة) - $invoice_num = preg_replace('/[^0-9]/', '', $note); - - if ($amt > 0 && !empty($invoice_num) && strlen($invoice_num) >= 5) { - - // البحث المباشر عن الفاتورة برقمها والمبلغ - $stmt = $con->prepare("SELECT id FROM invoices_shamcash WHERE invoice_number = :inv AND amount = :amt AND status = 'pending' LIMIT 1"); - $stmt->execute([':inv' => $invoice_num, ':amt' => $amt]); - $invoice = $stmt->fetch(PDO::FETCH_ASSOC); - - if ($invoice) { - $inv_id = $invoice['id']; - - // حجز الفاتورة فوراً - $upd = $con->prepare("UPDATE invoices_shamcash SET status = 'processing', transaction_id = :tid WHERE id = :id AND status = 'pending'"); - $upd->execute([':tid' => $tid, ':id' => $inv_id]); - - if ($upd->rowCount() > 0) { - // استدعاء الفاينلايز (مع البونص والتوكنات) - if (finalizeShamCashDeposit($con, $inv_id)) { - $status_log = "SUCCESS (Inv#$inv_id)"; - } else { - $status_log = "FAILED_FINALIZE (Inv#$inv_id)"; - // إعادة الحالة للفشل - $con->prepare("UPDATE invoices_shamcash SET status = 'failed' WHERE id = :id")->execute([':id' => $inv_id]); - } - } else { - $status_log = "RACE_CONDITION"; - } - } else { - $status_log = "NO_MATCHING_INVOICE ($invoice_num)"; - } - } elseif ($amt > 0) { - $status_log = "INVALID_NOTE"; - } - - logMsg("ID:$tid | Note:$note | Amt:$amt | $status_log"); - $last_id = $tid; - $processed++; - } -} - -if ($processed > 0) { - @file_put_contents($last_id_file, $last_id); -} - -echo json_encode(["status" => "success", "processed" => $processed]); -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/server_check.php b/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/server_check.php deleted file mode 100755 index 54e9a11..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/server_check.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php -// shamcash/server_check.php - V2 (The Doctor) - -ini_set('display_errors', 1); -error_reporting(E_ALL); -header("Content-Type: text/html; charset=utf-8"); - -echo "<h2>🔍 Server & File Diagnostics</h2>"; - -// 1. فحص المجلد -$dir = __DIR__; -echo "<strong>Current Dir:</strong> $dir <br>"; -if (is_writable($dir)) { - echo "<span style='color:green'>✅ Directory is Writable (777 OK)</span><br>"; -} else { - echo "<span style='color:red'>❌ Directory NOT Writable! Please set Permissions to 777.</span><br>"; -} - -// 2. فحص ملف save_transactions.php -$target_file = $dir . '/save_transactions.php'; -echo "<hr><h3>Testing 'save_transactions.php':</h3>"; - -if (!file_exists($target_file)) { - echo "<span style='color:red'>❌ File not found!</span>"; -} else { - // محاولة فحص الكود بحثاً عن أخطاء نحوية (Syntax Errors) - $content = file_get_contents($target_file); - - // فحص إذا كان المستخدم نسخ علامات Markdown بالخطأ - if (strpos($content, '```') !== false) { - echo "<span style='color:red'>❌ <b>CRITICAL ERROR FOUND:</b></span> Markdown tags (```) detected inside the PHP file!<br>"; - echo "👉 <b>Solution:</b> Open the file and remove the first/last lines containing ``` or ```php.<br>"; - } elseif (substr(trim($content), 0, 5) !== '<?php') { - echo "<span style='color:red'>❌ <b>START ERROR:</b></span> File does not start with <?php<br>"; - echo "Found instead: " . substr(trim($content), 0, 20) . "...<br>"; - } else { - echo "<span style='color:green'>✅ File structure looks clean (No Markdown tags).</span><br>"; - - // محاولة استدعاء الملف (سيظهر الخطأ إذا وجد) - echo "<b>Attempting to include file...</b><br><br>"; - echo "<div style='background:#f0f0f0; padding:10px; border:1px solid #ccc;'>"; - - // نحجز المخرجات لنرى إذا كان هناك خطأ - ob_start(); - try { - include $target_file; - } catch (Throwable $e) { - echo "<strong style='color:red'>Runtime Error:</strong> " . $e->getMessage(); - } - $output = ob_get_clean(); - - if (empty($output)) { - echo "File included successfully (No output is good in this context)."; - } else { - echo "<strong>Output/Error:</strong><br>" . $output; - } - echo "</div>"; - } -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/transactions.log b/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/transactions.log deleted file mode 100644 index 946a5ca..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/shamcash/transactions.log +++ /dev/null @@ -1,100 +0,0 @@ -[08:37:59] ID:54627270 | User:Ciedco Group | Note:مرتجع | Amt:475000 | Status:NO_MATCH -[08:37:59] ID:54847574 | User:خليل ابراهيم حسين الاحمد | Note: | Amt:-475000 | Status:IGNORED -[08:37:59] ID:60527547 | User:sameram | Note: | Amt:10000 | Status:NO_MATCH -[08:37:59] ID:60744509 | User:محمد منير عاشور | Note: | Amt:832000 | Status:NO_MATCH -[08:37:59] ID:60808239 | User:خليل ابراهيم حسين الاحمد | Note: | Amt:-830000 | Status:IGNORED -[08:37:59] ID:60906569 | User:أ.خالد محمد الخليل العمر | Note: | Amt:20000 | Status:NO_MATCH -[09:28:35] ID:64318914 | Note: | Amt:10000 | IGNORED -[12:21:45] ID:65719216 | Note: | Amt:1225000 | IGNORED -[13:12:39] ID:65755911 | Note: | Amt:10000 | IGNORED -[21:17:42] ID:65900994 | Note: | Amt:-1227000 | IGNORED -[07:52:04] ID:66228976 | Note: | Amt:1200000 | IGNORED -[12:50:53] ID:67956113 | Note: | Amt:250000 | IGNORED -[12:50:53] ID:68162721 | Note: | Amt:133000 | IGNORED -[12:50:53] ID:69061135 | Note:shahd intaleq | Amt:-325000 | IGNORED -[06:20:37] ID:70100919 | Note:969580 | Amt:10000 | SUCCESS_DRIVER (Inv#18) -[11:54:56] ID:71296296 | Note: | Amt:20000 | IGNORED -[08:34:59] ID:72614643 | Note:450448 | Amt:20000 | SUCCESS_DRIVER (Inv#22) -[15:30:46] ID:73604768 | Note: | Amt:-1358000 | IGNORED -[15:30:46] ID:73804278 | Note:127266 | Amt:20000 | SUCCESS_DRIVER (Inv#27) -[15:42:50] ID:73825611 | Note:646898 | Amt:40000 | SUCCESS_DRIVER (Inv#28) -[11:20:12] ID:74281823 | Note: | Amt:-20000 | IGNORED -[12:21:36] ID:74331105 | Note: | Amt:350000 | IGNORED -[07:55:11] ID:74889079 | Note: | Amt:1039000 | IGNORED -[15:38:39] ID:75103283 | Note: | Amt:10000 | IGNORED -[15:38:39] ID:75104422 | Note:493193 | Amt:10000 | SUCCESS_DRIVER (Inv#32) -[15:38:39] ID:75107242 | Note:493193 | Amt:10000 | NO_MATCH (493193) -[2025-12-21 20:54:28] INFO: Received single transaction ID: 74889079 -[2025-12-21 20:54:28] INFO: Received single transaction ID: 75104422 -[2025-12-21 20:54:28] INFO: Received single transaction ID: 74331105 -[2025-12-21 20:54:28] INFO: Received single transaction ID: 75103283 -[2025-12-21 20:55:04] INFO: Received single transaction ID: 77893875 -[2025-12-21 20:55:04] TXN:77893875 | Amt:467000 | Note: | Inv: | Status:IGNORED -[2025-12-21 20:55:04] INFO: Received single transaction ID: 77539683 -[2025-12-21 20:55:04] INFO: Received single transaction ID: 77532472 -[2025-12-21 20:55:04] INFO: Received single transaction ID: 78325873 -[2025-12-21 20:55:04] TXN:78325873 | Amt:10000 | Note:994127 | Inv:994127 | Status:SUCCESS_DRIVER (Inv#39) -[2025-12-21 20:55:04] INFO: Received single transaction ID: 77971899 -[2025-12-21 20:55:04] INFO: Received single transaction ID: 75107242 -[2025-12-21 20:56:42] INFO: Received single transaction ID: 77893875 -[2025-12-21 20:56:42] INFO: Received single transaction ID: 77971899 -[2025-12-21 20:56:42] INFO: Received single transaction ID: 77532472 -[2025-12-21 20:56:42] INFO: Received single transaction ID: 78325873 -[2025-12-21 20:56:42] INFO: Received single transaction ID: 77539683 -[2025-12-21 20:56:42] INFO: Received single transaction ID: 75107242 -[2025-12-26 09:31:24] INFO: Received single transaction ID: 81285522 -[2025-12-26 09:31:24] TXN:81285522 | Amt:1300000 | Note: | Inv: | Status:IGNORED -[2025-12-26 09:31:24] INFO: Received single transaction ID: 80139845 -[2025-12-26 09:31:24] INFO: Received single transaction ID: 81285582 -[2025-12-26 09:31:24] INFO: Received single transaction ID: 80197899 -[2025-12-26 09:31:24] TXN:81285582 | Amt:1300000 | Note: | Inv: | Status:IGNORED -[2025-12-26 09:31:24] INFO: Received single transaction ID: 81285625 -[2025-12-26 09:31:24] TXN:81285625 | Amt:1300000 | Note: | Inv: | Status:IGNORED -[2025-12-26 09:31:24] INFO: Received single transaction ID: 77971899 -[2025-12-26 09:31:24] INFO: Received single transaction ID: 78325873 -[2025-12-28 22:09:18] INFO: Received single transaction ID: 82265340 -[2025-12-28 22:09:18] INFO: Received single transaction ID: 82260577 -[2025-12-28 22:09:18] TXN:82265340 | Amt:1000 | Note: | Inv: | Status:IGNORED -[2025-12-28 22:09:18] TXN:82260577 | Amt:20000 | Note: | Inv: | Status:IGNORED -[2025-12-30 16:46:08] INFO: Received single transaction ID: 81285522 -[2025-12-30 16:46:08] INFO: Received single transaction ID: 81285582 -[2025-12-30 16:46:08] INFO: Received single transaction ID: 81285625 -[2025-12-30 16:46:08] INFO: Received single transaction ID: 82260577 -[2025-12-30 16:46:08] INFO: Received single transaction ID: 82265340 -[2025-12-30 16:46:08] INFO: Received single transaction ID: 78325873 -[2025-12-30 16:46:08] INFO: Received single transaction ID: 80197899 -[2025-12-30 16:46:08] INFO: Received single transaction ID: 80139845 -[2026-01-08 15:49:00] INFO: Received single transaction ID: 82260577 -[2026-01-08 15:49:00] INFO: Received single transaction ID: 84322399 -[2026-01-08 15:49:00] INFO: Received single transaction ID: 82265340 -[2026-01-08 15:49:00] INFO: Received single transaction ID: 84319368 -[2026-01-08 15:49:00] TXN:84319368 | Amt:20000 | Note: | Inv: | Status:IGNORED -[2026-01-08 15:49:00] INFO: Received single transaction ID: 81285625 -[2026-01-08 15:49:00] TXN:84322399 | Amt:20000 | Note:869354 | Inv:869354 | Status:SUCCESS_DRIVER (Inv#48) -[2026-01-08 15:49:01] INFO: Received single transaction ID: 81285582 -[2026-01-08 15:49:01] INFO: Received single transaction ID: 81285522[2026-02-16 14:02:39] INFO: Received single transaction ID: 843193682000020251230210701 - -[2026-02-16 18:56:11] 📥 RECEIVED -> ID:120329324 | Amt:20 | Note:377746 -[2026-02-16 18:56:11] 📥 RECEIVED -> ID:105354653 | Amt:100 | Note: -[2026-02-16 18:56:11] ⚙️ PROCESSED -> ID:105354653 | Status:IGNORED_NO_INVOICE -[2026-02-16 18:56:11] 📥 RECEIVED -> ID:84322399 | Amt:20000 | Note:869354 -[2026-02-16 18:56:11] ⚠️ SKIPPED (OLD) -> ID:84322399 is <= Last:105354653 -[2026-02-16 18:56:11] 📥 RECEIVED -> ID:120840498 | Amt:5 | Note: -[2026-02-16 18:56:11] ⚙️ PROCESSED -> ID:120840498 | Status:IGNORED_NO_INVOICE -[2026-02-16 18:56:12] 📥 RECEIVED -> ID:120327019 | Amt:500 | Note: -[2026-02-16 18:56:12] ⚠️ SKIPPED (OLD) -> ID:120327019 is <= Last:120840498 -[2026-02-16 18:56:12] ⚙️ PROCESSED -> ID:120329324 | Status:NO_MATCH (Inv:377746) -[2026-02-16 18:56:12] 📥 RECEIVED -> ID:84319368 | Amt:20000 | Note: -[2026-02-16 18:56:12] ⚠️ SKIPPED (OLD) -> ID:84319368 is <= Last:120329324 -[2026-02-25 18:13:33] 📥 RECEIVED -> ID:120327019 | Amt:500 | Note: -[2026-02-25 18:13:33] 📥 RECEIVED -> ID:120840498 | Amt:5 | Note: -[2026-02-25 18:13:33] ⚠️ SKIPPED (OLD) -> ID:120327019 is <= Last:120329324 -[2026-02-25 18:13:33] ⚙️ PROCESSED -> ID:120840498 | Status:IGNORED_NO_INVOICE -[2026-02-25 18:13:33] 📥 RECEIVED -> ID:84322399 | Amt:20000 | Note:869354 -[2026-02-25 18:13:33] ⚠️ SKIPPED (OLD) -> ID:84322399 is <= Last:120840498 -[2026-02-25 18:13:33] 📥 RECEIVED -> ID:120329324 | Amt:20 | Note:377746 -[2026-02-25 18:13:33] ⚠️ SKIPPED (OLD) -> ID:120329324 is <= Last:120840498 -[2026-02-25 18:13:33] 📥 RECEIVED -> ID:105354653 | Amt:100 | Note: -[2026-02-25 18:13:33] ⚠️ SKIPPED (OLD) -> ID:105354653 is <= Last:120840498 -[2026-02-25 18:13:33] 📥 RECEIVED -> ID:84319368 | Amt:20000 | Note: -[2026-02-25 18:13:33] ⚠️ SKIPPED (OLD) -> ID:84319368 is <= Last:120840498 diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/archive.zip b/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/archive.zip deleted file mode 100755 index c922a89..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/archive.zip and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/driver/confirm_payment.php b/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/driver/confirm_payment.php deleted file mode 100755 index 5bcb838..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/driver/confirm_payment.php +++ /dev/null @@ -1,237 +0,0 @@ -<?php -// /v1/main/ride/syriatel/driver/confirm_payment.php -// يعتمد على connect.php و syriatel_token_handler.php فقط -include_once "../../../connect.php"; -include_once "./syriatel_token_handler.php"; - -header('Content-Type: application/json; charset=utf-8'); - -// ================== Helpers (طباعة/لوج) ================== -if (!function_exists('printSuccess')) { - function printSuccess($data = null, $message = "success") { - echo json_encode(["status" => "success", "message" => $message, "data" => $data], JSON_UNESCAPED_UNICODE); - exit; - } -} -if (!function_exists('printFailure')) { - function printFailure($message = "failure", $code = null) { - $resp = ["status" => "failure", "message" => $message]; - if ($code !== null) $resp["code"] = $code; - echo json_encode($resp, JSON_UNESCAPED_UNICODE); - exit; - } -} - -define("WALLET_LOG", __DIR__ . "/../logs/payment_verification.log"); -function wlog($step, $msg, $data = null) { - $dir = dirname(WALLET_LOG); - if (!is_dir($dir)) { @mkdir($dir, 0755, true); } - $line = "[".date('Y-m-d H:i:s')."] STEP {$step}: {$msg}"; - if ($data !== null) $line .= " | Data: ".json_encode($data, JSON_UNESCAPED_UNICODE); - file_put_contents(WALLET_LOG, $line.PHP_EOL, FILE_APPEND); -} - -// ================== منطق التوكن/المعرف ================== -function generateToken(PDO $con, string $driverId, float $amount): ?string { - // secretKey يُفترض قادم من connect/env - global $secretKey; - $data = $driverId.$amount.time().($secretKey ?? 'default_secret'); - $hash = hash('sha256', $data); - $rand = bin2hex(random_bytes(16)); - $token = substr($hash.$rand, 0, 64); - - $stmt = $con->prepare("INSERT INTO payment_tokens (token, driverID, dateCreated, amount) - VALUES (:t, :d, NOW(), :a)"); - $stmt->execute([':t'=>$token, ':d'=>$driverId, ':a'=>$amount]); - return $stmt->rowCount() ? $token : null; -} - -function generatePaymentID(PDO $con, string $driverId, float $amount, string $method): ?string { - $stmt = $con->prepare("INSERT INTO paymentsDriverPoints (amount, payment_method, driverID) - VALUES (:a, :m, :d)"); - $stmt->execute([':a'=>$amount, ':m'=>$method, ':d'=>$driverId]); - return $stmt->rowCount() ? $con->lastInsertId() : null; -} - -// ================== منطق إنهاء الدفع (مضمَّن) ================== -function finalizeWalletPaymentInline(PDO $con, string $orderRef): void { - // نقفل الصف لمنع السباقات - $stmt = $con->prepare("SELECT * FROM paymentsLogSyriaDriver - WHERE order_ref = :r LIMIT 1 FOR UPDATE"); - $stmt->execute([':r'=>$orderRef]); - $payment = $stmt->fetch(PDO::FETCH_ASSOC); - - if (!$payment) { - wlog("FINALIZE", "Payment row not found", ['orderRef'=>$orderRef]); - throw new RuntimeException("Payment not found."); - } - - // نتأكد من نجاح مزود الدفع - if ((int)$payment['status'] !== 1) { - wlog("FINALIZE", "Payment not completed yet", ['orderRef'=>$orderRef, 'status'=>$payment['status']]); - throw new RuntimeException("Payment not completed."); - } - - // حارس التكرار: إذا تمّت معالجة المحفظة سابقاً لا نكرر - if (!empty($payment['processed_wallet']) && (int)$payment['processed_wallet'] === 1) { - wlog("FINALIZE", "Already processed_wallet=1, skip.", ['orderRef'=>$orderRef]); - return; // لا نرمي استثناء؛ العملية سبق احتسابها - } - - $driverId = $payment['user_id']; // This is now correctly handled as a string - $originalAmount = (float)$payment['amount']; - $paymentMethod = $payment['payment_method'] ?: 'ecash'; - - // البونص - $bonusAmount = match ((int)$originalAmount) { - 100 => 100.0, - 200 => 210.0, - 400 => 450.0, - 1000 => 1100.0, - default => $originalAmount, - }; - - // تنفيذ ككل داخل معاملة - $con->beginTransaction(); - try { - // توليد التوكنات/المعرف - $tokenDriver = generateToken($con, $driverId, $bonusAmount); - if (!$tokenDriver) throw new RuntimeException("Failed to generate driver token"); - - $tokenSefer = generateToken($con, $driverId, $originalAmount); - if (!$tokenSefer) throw new RuntimeException("Failed to generate sefer token"); - - $paymentID = generatePaymentID($con, $driverId, $bonusAmount, $paymentMethod); - if (!$paymentID) throw new RuntimeException("Failed to create payment ID"); - - // driverWallet - $q = $con->prepare("INSERT INTO driverWallet (driverID, paymentID, amount, paymentMethod) - VALUES (:d, :r, :a, :m)"); - $q->execute([ - ':d'=>$driverId, ':a'=>$bonusAmount, - ':m'=>$paymentMethod, ':r'=>$orderRef - ]); - if ($q->rowCount() === 0) throw new RuntimeException("Insert driverWallet failed"); - - // وسم التوكن كمستخدم - $con->prepare("UPDATE payment_tokens SET isUsed = 1 WHERE token = :t")->execute([':t'=>$tokenDriver]); - - // seferWallet - $q2 = $con->prepare("INSERT INTO seferWallet (driverId, passengerId, amount, paymentMethod, token, createdAt) - VALUES (:d, :p, :a, :m, :t, CURRENT_TIMESTAMP)"); - $q2->execute([ - ':d'=>$driverId, ':p'=>'driver', ':a'=>$originalAmount, - ':m'=>$paymentMethod, ':t'=>$tokenSefer - ]); - if ($q2->rowCount() === 0) throw new RuntimeException("Insert seferWallet failed"); - - $con->prepare("UPDATE payment_tokens SET isUsed = 1 WHERE token = :t")->execute([':t'=>$tokenSefer]); - - // تأشير السجل كمنتهٍ للمحفظة - $con->prepare("UPDATE paymentsLogSyriaDriver - SET processed_wallet = 1, updated_at = NOW() - WHERE order_ref = :r")->execute([':r'=>$orderRef]); - - $con->commit(); - wlog("FINALIZE", "Wallets updated successfully", ['orderRef'=>$orderRef, 'driverId'=>$driverId]); - } catch (Throwable $e) { - $con->rollBack(); - wlog("FINALIZE", "Exception: ".$e->getMessage(), ['orderRef'=>$orderRef]); - throw $e; - } -} - -// ================== مدخل تأكيد الدفع ================== -$transactionID = filterRequest('transactionID'); -$otp = filterRequest('otp'); - -error_log("Syriatel Confirm: Request for transaction {$transactionID}"); - -if (!$transactionID || !$otp) { - printFailure("Missing transaction ID or OTP."); -} - -// بيئة -$baseUrl = rtrim((string)getenv('SYRIATEL_API_BASE_URL'), '/'); -$merchantMSISDN = (string)getenv('SYRIATEL_MERCHANT_MSISDN'); -if ($baseUrl === '' || $merchantMSISDN === '') { - error_log("Syriatel Confirm: Missing SYRIATEL envs"); - printFailure("Server configuration error."); -} - -try { - // 1) Auth token - $token = function_exists('GetSerialToken') ? GetSerialToken() : getSyriatelToken(); - if (!$token) { printFailure("Could not authenticate with the payment provider."); } - - // 2) Call provider - $body = [ - "OTP" => $otp, - "merchantMSISDN" => $merchantMSISDN, - "transactionID" => $transactionID, - "token" => $token - ]; - $url = "{$baseUrl}/ePaymentExternalModule/paymentConfirmation"; - $ch = curl_init($url); - curl_setopt_array($ch, [ - CURLOPT_POST => true, - CURLOPT_POSTFIELDS => json_encode($body, JSON_UNESCAPED_UNICODE), - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HTTPHEADER => [ - "Content-Type: application/json", - "Accept: application/json", - "User-Agent: Mozilla/5.0", - ], - CURLOPT_CONNECTTIMEOUT => 8, - CURLOPT_TIMEOUT => 40, - CURLOPT_SSL_VERIFYPEER => true, - CURLOPT_SSL_VERIFYHOST => 2, - ]); - $response = curl_exec($ch); - $errno = curl_errno($ch); - $httpCode = (int)curl_getinfo($ch, CURLINFO_HTTP_CODE); - curl_close($ch); - - error_log("Syriatel Confirm: HTTP {$httpCode} - ".substr((string)$response, 0, 300)); - - if ($errno) { printFailure("Payment gateway communication error.", $errno); } - if ($httpCode !== 200 || !$response) { printFailure("Payment gateway communication error (HTTP {$httpCode})."); } - - $responseData = json_decode($response, true); - if (!is_array($responseData)) { printFailure("Invalid provider response."); } - - $ok = (isset($responseData['errorDesc']) && $responseData['errorDesc'] === "Success"); - - if ($ok) { - // نحدّث حالة الدفع، ونُتم المحفظة بشكل آمن داخل نفس الطلب - $con->prepare("UPDATE paymentsLogSyriaDriver - SET status = 1, updated_at = NOW() - WHERE order_ref = :r")->execute([':r'=>$transactionID]); - - // إنهاء المحفظة (داخلية) - $walletOk = true; $walletMsg = null; - try { - finalizeWalletPaymentInline($con, $transactionID); - } catch (Throwable $ex) { - $walletOk = false; $walletMsg = $ex->getMessage(); - } - - $payload = [ - 'message' => 'Payment confirmed.', - 'transactionID' => $transactionID, - 'provider' => $responseData - ]; - if (!$walletOk && $walletMsg) { - $payload['walletNotice'] = "Payment successful, but wallet update failed: ".$walletMsg; - } - - printSuccess($payload); - } - - $errorMessage = $responseData['errorDesc'] ?? 'Unknown provider error'; - printFailure($errorMessage); - -} catch (Throwable $e) { - error_log("Syriatel Confirm: Exception - ".$e->getMessage()); - printFailure("An unexpected server error occurred."); -} \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/driver/finalize_wallet_payment.php b/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/driver/finalize_wallet_payment.php deleted file mode 100755 index d0a4fd2..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/driver/finalize_wallet_payment.php +++ /dev/null @@ -1,127 +0,0 @@ -<?php -// wallet/finalize_wallet_payment.php - -// تم حذف include_once من هنا لأنه يُفترض أن ملف الاتصال قد تم تحميله بالفعل -// بواسطة الملف الذي يستدعي هذه الدالة (confirm_payment.php). -// include_once "../../../jwtconnect.php"; - -define("LOG_FILE", __DIR__ . "/../logs/payment_verification.log"); - -if (!function_exists('logError')) { - function logError($step, $message, $data = null) { - $logDir = dirname(LOG_FILE); - if (!is_dir($logDir)) { mkdir($logDir, 0755, true); } - $logEntry = "[" . date('Y-m-d H:i:s') . "] STEP {$step}: {$message}"; - if ($data !== null) { $logEntry .= " | Data: " . json_encode($data, JSON_UNESCAPED_UNICODE); } - file_put_contents(LOG_FILE, $logEntry . PHP_EOL, FILE_APPEND); - } -} - -if (!function_exists('generateToken')) { - function generateToken($con, $driverId, $amount): ?string { - global $secretKey; - $data = $driverId . $amount . time() . ($secretKey ?? 'default_secret'); - $hash = hash('sha256', $data); - $randomBytes = bin2hex(random_bytes(16)); - $token = substr($hash . $randomBytes, 0, 64); - - $stmt = $con->prepare("INSERT INTO payment_tokens (token, driverID, dateCreated, amount) VALUES (:token, :driverID, NOW(), :amount)"); - $stmt->execute([':token' => $token, ':driverID' => $driverId, ':amount' => $amount]); - return $stmt->rowCount() > 0 ? $token : null; - } -} - -if (!function_exists('generatePaymentID')) { - function generatePaymentID($con, $driverId, $amount, $method): ?string { - $stmt = $con->prepare("INSERT INTO paymentsDriverPoints (`amount`, `payment_method`, `driverID`) VALUES (:amount, :method, :driverID)"); - $stmt->execute([':driverID' => $driverId, ':amount' => $amount, ':method' => $method]); - return $stmt->rowCount() > 0 ? $con->lastInsertId() : null; - } -} - - -if (!function_exists('finalizeWalletPayment')) { - function finalizeWalletPayment($con) { - $orderRef = $_GET['orderRef'] ?? null; - if (empty($orderRef)) { - logError("FINALIZE", "Missing orderRef"); - return; // لا نستخدم throw هنا لأن الخطأ داخلي - } - - // 1. تحقق من الدفع - $stmt = $con->prepare("SELECT * FROM `paymentsLogSyriaDriver` WHERE order_ref = :order_ref AND status = 1 LIMIT 1"); - $stmt->execute([':order_ref' => $orderRef]); - $payment = $stmt->fetch(PDO::FETCH_ASSOC); - - if (!$payment) { - logError("FINALIZE", "Payment not found or not completed", ['orderRef' => $orderRef]); - return; - } - - // [تحسين] استخدام معاملات لضمان سلامة البيانات - $con->beginTransaction(); - try { - $driverId = $payment['user_id']; - $originalAmount = floatval($payment['amount']); - $paymentMethod = $payment['payment_method'] ?? 'ecash'; - - // حساب المكافأة - $bonusAmount = match ((int)$originalAmount) { - 100 => 100.0, - 200 => 210.0, - 400 => 450.0, - 1000 => 1100.0, - default => $originalAmount, - }; - - // إنشاء التوكنات - $tokenDriver = generateToken($con, $driverId, $bonusAmount); - if (!$tokenDriver) throw new Exception('Failed to generate driver token'); - - $tokenSefer = generateToken($con, $driverId, $originalAmount); - if (!$tokenSefer) throw new Exception('Failed to generate sefer token'); - - $paymentID = generatePaymentID($con, $driverId, $bonusAmount, $paymentMethod); - if (!$paymentID) throw new Exception('Failed to generate payment ID'); - - // driverWallet - $insertDriver = $con->prepare("INSERT INTO driverWallet (driverID, paymentID, amount, paymentMethod) VALUES (:driverID, :paymentID, :amount, :paymentMethod)"); - $insertDriver->execute([ - ':driverID' => $driverId, - ':paymentID' => $paymentID, - ':amount' => $bonusAmount, - ':paymentMethod' => $paymentMethod - ]); - if ($insertDriver->rowCount() === 0) throw new Exception('Insert to driverWallet failed'); - - $con->prepare("UPDATE payment_tokens SET isUsed = TRUE WHERE token = :token")->execute([':token' => $tokenDriver]); - - // seferWallet - $insertSefer = $con->prepare("INSERT INTO seferWallet (driverId, passengerId, amount, paymentMethod, token, createdAt) - VALUES (:driverId, :passengerId, :amount, :paymentMethod, :token, CURRENT_TIMESTAMP)"); - $insertSefer->execute([ - ':driverId' => $driverId, - ':passengerId' => 'driver', - ':amount' => $originalAmount, - ':paymentMethod' => $paymentMethod, - ':token' => $tokenSefer - ]); - if ($insertSefer->rowCount() === 0) throw new Exception('Insert to seferWallet failed'); - - $con->prepare("UPDATE payment_tokens SET isUsed = TRUE WHERE token = :token")->execute([':token' => $tokenSefer]); - - // إذا نجحت كل العمليات، قم بتثبيتها في قاعدة البيانات - $con->commit(); - - logError("FINALIZE", "Wallets updated successfully", ['orderRef' => $orderRef]); - // لا نطبع نجاح هنا، الملف المستدعي هو المسؤول عن إرسال الرد النهائي - - } catch (Throwable $e) { - // في حالة حدوث أي خطأ، تراجع عن كل التغييرات - $con->rollBack(); - logError("FINALIZE", "Exception during finalization: " . $e->getMessage(), ['orderRef' => $orderRef]); - // نمرر الخطأ للملف الأعلى ليعالجه - throw $e; - } - } -} diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/driver/start_payment.php b/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/driver/start_payment.php deleted file mode 100755 index c77f8b2..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/driver/start_payment.php +++ /dev/null @@ -1,141 +0,0 @@ -<?php -// /v1/main/ride/syriatel/driver/start_payment.php -include "../../../connect.php"; -include_once "./syriatel_token_handler.php"; - -header('Content-Type: application/json; charset=utf-8'); - -/** دوال الطباعة (لو موجودة أصلاً في connect.php تجاهل هذه) */ -if (!function_exists('printSuccess')) { - function printSuccess($data = null, $message = "success") { - echo json_encode(["status"=>"success","message"=>$message,"data"=>$data], JSON_UNESCAPED_UNICODE); exit; - } -} -if (!function_exists('printFailure')) { - function printFailure($message = "failure", $code = null) { - $resp = ["status"=>"failure","message"=>$message]; if ($code!==null) $resp["code"]=$code; - echo json_encode($resp, JSON_UNESCAPED_UNICODE); exit; - } -} - -/** مولّد مرجع الطلب (TransactionID) */ -function generate_order_ref(): string { - // مرجع مقروء + فريد: INT-YYYYMMDDHHMMSS-6digits - $ts = date('YmdHis'); - $rand = str_pad((string)random_int(0, 999999), 6, '0', STR_PAD_LEFT); - return "INT-$ts-$rand"; -} - -// --- Input Parameters --- -$amount = filterRequest('amount'); -$driverId = filterRequest('driverId'); -$phone = filterRequest('phone'); // customerMSISDN -$lang = filterRequest('lang') ?? 'ar'; - -error_log("Syriatel Start: Request received for driver {$driverId} with amount {$amount}"); - -if (!$amount || !$driverId || !$phone) { - printFailure("Missing required parameters."); -} - -// --- Environment Variables --- -$baseUrl = rtrim((string)getenv('SYRIATEL_API_BASE_URL'), '/'); -$merchantMSISDN = (string)getenv('SYRIATEL_MERCHANT_MSISDN'); - -if ($baseUrl === '' || $merchantMSISDN === '') { - error_log("Syriatel Start: Missing SYRIATEL_API_BASE_URL or SYRIATEL_MERCHANT_MSISDN"); - printFailure("Server configuration error."); -} - -// --- Logic --- -try { - // 1) Token - $token = getSyriatelToken(); - error_log("Syriatel Start: token=" . ($token ? substr($token,0,8).'...' : 'NULL')); - - if (!$token) { - printFailure("Could not authenticate with the payment provider."); - } - - // 2) Transaction ID + log DB - $transactionID = generate_order_ref(); - $stmt = $con->prepare( - "INSERT INTO `paymentsLogSyriaDriver` (user_id, amount, status, order_ref, payment_method, created_at) - VALUES (:user_id, :amount, 0, :order_ref, 'syriatel', NOW())" - ); - $stmt->execute([ - ':user_id' => $driverId, - ':amount' => $amount, - ':order_ref' => $transactionID - ]); - error_log("Syriatel Start: Logged transaction {$transactionID} for driver {$driverId}"); - - // 3) Payment Request → Syriatel - $body = [ - "customerMSISDN" => $phone, // مثال: 09xxxxxxxx (حسب وثيقتهم) - "merchantMSISDN" => $merchantMSISDN, // من env - "amount" => $amount, - "transactionID" => $transactionID, - "token" => $token - ]; -error_log("Syriatel Start: customerMSISDN {$phone} merchantMSISDN {$merchantMSISDN}"); - $url = "{$baseUrl}/ePaymentExternalModule/paymentRequest"; - $ch = curl_init($url); - curl_setopt_array($ch, [ - CURLOPT_POST => true, - CURLOPT_POSTFIELDS => json_encode($body, JSON_UNESCAPED_UNICODE), - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HTTPHEADER => [ - "Content-Type: application/json", - "User-Agent: Mozilla/5.0", - "Accept: application/json" - ], - CURLOPT_CONNECTTIMEOUT => 8, - CURLOPT_TIMEOUT => 40, - CURLOPT_SSL_VERIFYPEER => true, - CURLOPT_SSL_VERIFYHOST => 2, - ]); - $response = curl_exec($ch); - $errno = curl_errno($ch); - $errstr = curl_error($ch); - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - curl_close($ch); - - error_log("Syriatel Start: paymentRequest HTTP {$httpCode} errno={$errno} resp=" . substr((string)$response,0,300)); - - if ($errno) { - printFailure("Payment gateway communication error.", $errno); - } - if ($httpCode !== 200) { - printFailure("Payment gateway communication error (HTTP {$httpCode})."); - } - - $responseData = json_decode($response, true); - - // حسب الدوكيومنت: resultCode = 1 يعني OTP انرسل بنجاح - //errorCode = 0 => Success -if (isset($responseData['errorCode']) && (string)$responseData['errorCode'] === "0") { - printSuccess([ - 'message' => 'OTP sent successfully.', - 'transactionID' => $transactionID, - ]); -} -// 2) إذا resultCode = 1 => OTP sent -elseif (isset($responseData['resultCode']) && (int)$responseData['resultCode'] === 1) { - printSuccess([ - 'message' => 'OTP sent successfully.', - 'transactionID' => $transactionID, - ]); -} -// 3) أي شيء آخر => فشل -else { - $errorMessage = $responseData['resultDescription'] - ?? $responseData['errorDesc'] - ?? 'Failed to initiate payment.'; - printFailure($errorMessage); -} - -} catch (Throwable $e) { - error_log("Syriatel Start: Exception - " . $e->getMessage()); - printFailure("An unexpected server error occurred."); -} \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/driver/syriatel_token_handler.php b/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/driver/syriatel_token_handler.php deleted file mode 100755 index ba53ae6..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/driver/syriatel_token_handler.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php // syriatel_token_handler -function getSyriatelToken(): ?string { - // اضبط البيئة: prod أو stage (افتراضي prod) - $env = getenv("SYRIATEL_ENV") ?: "prod"; - - // Base URLs من Postman - $baseStage = "https://merchants.syriatel.sy:1443/ePayment_external_Json_test/rs/ePaymentExternalModule"; - $baseProd = "https://merchants.syriatel.sy:1443/ePayment_external_Json/rs/ePaymentExternalModule"; - - $baseUrl = ($env === "stage") ? $baseStage : $baseProd; - $url = $baseUrl . "/getToken"; - - // ⚠️ لا تضع قيم افتراضية حساسة Hardcoded - $username = getenv("SYRIATEL_USERNAME"); - $password = getenv("SYRIATEL_PASSWORD"); - - if (!$username || !$password) { - error_log("[GetSyriatelToken] Missing credentials in ENV"); - printFailure("Payment provider credentials are missing."); - return null; - } - - error_log("[GetSyriatelToken] Env={$env} | URL={$url} | user={$username}"); - - $payload = [ - "username" => $username, - "password" => $password - ]; - - $ch = curl_init($url); - curl_setopt_array($ch, [ - CURLOPT_POST => true, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HTTPHEADER => [ - "Content-Type: application/json", - "User-Agent: Mozilla/5.0", - ], - CURLOPT_POSTFIELDS => json_encode($payload, JSON_UNESCAPED_UNICODE), - CURLOPT_CONNECTTIMEOUT => 8, - CURLOPT_TIMEOUT => 40, - CURLOPT_SSL_VERIFYPEER => true, - CURLOPT_SSL_VERIFYHOST => 2, - ]); - - $response = curl_exec($ch); - $errno = curl_errno($ch); - $errstr = curl_error($ch); - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - curl_close($ch); - - if ($errno) { - error_log("[GetSyriatelToken] cURL error {$errno}: {$errstr}"); - printFailure("Could not connect to the payment provider.", $errno); - return null; - } - - if ($httpCode !== 200 || !$response) { - error_log("[GetSyriatelToken] HTTP {$httpCode} | Empty/invalid response"); - printFailure("Could not authenticate with the payment provider."); - return null; - } - - $data = json_decode($response, true); - $token = $data["token"] ?? null; - - if (!$token) { - error_log("[GetSyriatelToken] Token not found in response: " . substr($response, 0, 300)); - printFailure("Could not authenticate with the payment provider."); - return null; - } - - error_log("[GetSyriatelToken] Token received successfully"); - return $token; -} \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/logs/payment_verification.log b/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/logs/payment_verification.log deleted file mode 100644 index 0ef1101..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/logs/payment_verification.log +++ /dev/null @@ -1,25 +0,0 @@ -[2025-11-04 11:16:27] STEP FINALIZE: Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'orderRef' in 'field list' | Data: {"orderRef":"INT-20251104111538-994380"} -[2025-11-05 11:36:24] STEP FINALIZE: Exception: SQLSTATE[HY093]: Invalid parameter number: parameter was not defined | Data: {"orderRef":"INT-20251105113557-052588"} -[2025-11-08 07:24:27] STEP FINALIZE: Exception: generateToken(): Argument #2 ($driverId) must be of type int, string given, called in /home/intaleq-wallet/htdocs/walletintaleq.intaleq.xyz/v1/main/ride/syriatel/driver/confirm_payment.php on line 98 | Data: {"orderRef":"INT-20251108072402-591731"} -[2025-11-15 03:12:44] STEP FINALIZE: Wallets updated successfully | Data: {"orderRef":"INT-20251115031225-211431","driverId":"1031b1b342a9a9e20b95"} -[2025-11-16 23:34:48] STEP FINALIZE: Wallets updated successfully | Data: {"orderRef":"INT-20251116233429-590104","driverId":"048e59b0737d7ad85370"} -[2025-11-17 07:48:33] STEP FINALIZE: Wallets updated successfully | Data: {"orderRef":"INT-20251117074803-798991","driverId":"28b3b16129d555cafb9b"} -[2025-11-22 16:35:44] STEP FINALIZE: Wallets updated successfully | Data: {"orderRef":"INT-20251122163518-755824","driverId":"986bf7b2242410647d05"} -[2025-11-25 11:50:26] STEP FINALIZE: Wallets updated successfully | Data: {"orderRef":"INT-20251125114917-921160","driverId":"7b437f291b5330536488"} -[2025-11-25 22:53:31] STEP FINALIZE: Wallets updated successfully | Data: {"orderRef":"INT-20251125225306-092996","driverId":"aec6f1335b72b5976dea"} -[2025-11-25 23:38:09] STEP FINALIZE: Wallets updated successfully | Data: {"orderRef":"INT-20251125233750-436593","driverId":"aec6f1335b72b5976dea"} -[2025-11-26 16:24:04] STEP FINALIZE: Wallets updated successfully | Data: {"orderRef":"INT-20251126162327-487255","driverId":"7a30afbb9b33d68a8b78"} -[2025-11-27 11:13:43] STEP FINALIZE: Wallets updated successfully | Data: {"orderRef":"INT-20251127111247-519577","driverId":"92e2fd19f4be30c3c727"} -[2025-11-27 16:48:44] STEP FINALIZE: Wallets updated successfully | Data: {"orderRef":"INT-20251127164535-525644","driverId":"e49604074b0b27710516"} -[2025-11-29 17:23:58] STEP FINALIZE: Wallets updated successfully | Data: {"orderRef":"INT-20251129172343-124569","driverId":"2870ec487be28f0929c7"} -[2025-11-30 21:34:28] STEP FINALIZE: Wallets updated successfully | Data: {"orderRef":"INT-20251130213350-345293","driverId":"3de8047aee520ff6555f"} -[2025-12-02 14:52:41] STEP FINALIZE: Wallets updated successfully | Data: {"orderRef":"INT-20251202145224-318083","driverId":"590c719b3aaefb07d001"} -[2025-12-13 13:33:03] STEP FINALIZE: Wallets updated successfully | Data: {"orderRef":"INT-20251213133220-085952","driverId":"94973848bd46ab517fa4"} -[2025-12-14 21:59:36] STEP FINALIZE: Wallets updated successfully | Data: {"orderRef":"INT-20251214215921-864193","driverId":"e0d0a6a92804240482fc"} -[2025-12-16 20:05:03] STEP FINALIZE: Wallets updated successfully | Data: {"orderRef":"INT-20251216200446-674525","driverId":"793ebf9e18327a828c55"} -[2025-12-18 11:20:20] STEP FINALIZE: Wallets updated successfully | Data: {"orderRef":"INT-20251218111954-420209","driverId":"df4e0e0cb135ac836e68"} -[2025-12-18 11:22:21] STEP FINALIZE: Wallets updated successfully | Data: {"orderRef":"INT-20251218112152-679624","driverId":"df4e0e0cb135ac836e68"} -[2025-12-18 21:25:11] STEP FINALIZE: Wallets updated successfully | Data: {"orderRef":"INT-20251218212432-696061","driverId":"64bfc098a99342c0c729"} -[2025-12-21 13:03:16] STEP FINALIZE: Wallets updated successfully | Data: {"orderRef":"INT-20251221130240-780780","driverId":"527c0a89cdf35841e4eb"} -[2025-12-21 13:14:09] STEP FINALIZE: Wallets updated successfully | Data: {"orderRef":"INT-20251221131302-717915","driverId":"527c0a89cdf35841e4eb"} -[2025-12-31 10:56:16] STEP FINALIZE: Wallets updated successfully | Data: {"orderRef":"INT-20251231105523-483044","driverId":"d881d416c9d712c9b222"} diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/passenger/confirm_payment.php b/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/passenger/confirm_payment.php deleted file mode 100755 index fe8c79e..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/passenger/confirm_payment.php +++ /dev/null @@ -1,201 +0,0 @@ -<?php -// /v1/main/ride/syriatel/passenger/confirm_payment.php -include "../../../connect.php"; -include_once __DIR__ . "/syriatel_token_handler.php"; -header('Content-Type: application/json; charset=utf-8'); - -/** Helpers **/ -function mlog(string $msg) { error_log($msg); } - -// تعريف دالة توليد التوكن محلياً (نفس منطق السائق ولكن للراكب) -if (!function_exists('generateLocalToken')) { - function generateLocalToken($con, $userId, $amount) { - // مفتاح سري بسيط للتشفير (يمكنك تغييره أو جلبه من ملف الإعدادات) - $secretKey = 'Tripz_Passenger_Secret_Key'; - $data = $userId . $amount . time() . $secretKey; - $hash = hash('sha256', $data); - $randomBytes = bin2hex(random_bytes(16)); - $token = substr($hash . $randomBytes, 0, 64); - - $stmt = $con->prepare("INSERT INTO payment_tokens (token, passengerID, dateCreated, amount) VALUES (:token, :passengerID, NOW(), :amount)"); - // لاحظ: استخدمنا passengerID هنا بدلاً من driverID بناء على الجدول، إذا كان الجدول موحداً استخدم العمود المناسب - // غالباً الجدول يحتوي user_id أو يتم استخدام driverID للكل. - // سأفترض هنا أن الجدول يقبل التوكن، وسأقوم بربطه بالراكب. - // إذا كان عمود driverID هو الوحيد الموجود، يمكن تمرير الراكب فيه أو تعديل الجدول. - // **للتوافق مع السائق:** سأستخدم الحقل العام أو أتجاوز الـ foreign key إذا وجد. - // لكن الأضمن: - $stmt->execute([':token' => $token, ':passengerID' => $userId, ':amount' => $amount]); - return $stmt->rowCount() > 0 ? $token : null; - } -} - -// --- المدخلات --- -$transactionID = filterRequest('transactionID'); // يقابل order_ref -$otp = filterRequest('otp'); // كود التأكيد -$lang = filterRequest('lang'); // اختياري - -mlog("Syriatel Confirm (Passenger): Start tx={$transactionID}"); - -if (!$transactionID || !$otp) { - printFailure($lang === 'ar' ? "رقم العملية أو رمز OTP مفقود." : "Missing transaction ID or OTP."); - exit; -} - -// --- المتغيرات البيئية --- -$baseUrl = rtrim(getenv('SYRIATEL_API_BASE_URL'), '/'); -$merchantMSISDN = getenv('SYRIATEL_MERCHANT_MSISDN'); - -if (!$baseUrl || !$merchantMSISDN) { - printFailure($lang === 'ar' ? "خطأ في إعدادات الخادم." : "Server configuration error."); - exit; -} - -try { - // 1) توكن المصادقة من Syriatel - $token = getSyriatelToken(); - if (!$token) { - printFailure($lang === 'ar' ? "تعذّر المصادقة مع مزوّد الدفع." : "Could not authenticate with the payment provider."); - exit; - } - - // 2) تحضير وإرسال طلب التأكيد لشركة سيريتل - $body = [ - "OTP" => $otp, - "merchantMSISDN" => $merchantMSISDN, - "transactionID" => $transactionID, - "token" => $token - ]; - - $ch = curl_init("{$baseUrl}/ePaymentExternalModule/paymentConfirmation"); - curl_setopt_array($ch, [ - CURLOPT_POST => true, - CURLOPT_POSTFIELDS => json_encode($body, JSON_UNESCAPED_UNICODE), - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HTTPHEADER => ["Content-Type: application/json"], - CURLOPT_TIMEOUT => 25, - ]); - - $response = curl_exec($ch); - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - curl_close($ch); - - $res = json_decode($response ?: '{}', true); - if (!is_array($res)) { $res = []; } - $errCode = isset($res['errorCode']) ? (string)$res['errorCode'] : null; - - // التحقق من رد سيريتل - if ($httpCode !== 200 || $errCode !== "0") { - $errText = $res['errorDesc'] ?? $res['resultDescription'] ?? 'Payment failed'; - mlog("Syriatel Confirm (Passenger): Failed - " . json_encode($res, JSON_UNESCAPED_UNICODE)); - printFailure(['message' => $errText, 'syriatel' => $res]); - exit; - } - - // ============================================================ - // ✅ هنا يبدأ التعديل: التحديث المباشر لقاعدة البيانات (بدون cURL) - // ============================================================ - global $con; - - // 4) التحقق من السجل في قاعدة البيانات - $chk = $con->prepare("SELECT status, user_id, amount, payment_method FROM paymentsLogSyria WHERE order_ref = :ref LIMIT 1"); - $chk->execute([':ref' => $transactionID]); - $payment = $chk->fetch(PDO::FETCH_ASSOC); - - if (!$payment) { - printFailure($lang === 'ar' ? "لم يتم العثور على السجل." : "Payment row not found"); - exit; - } - - if ((int)$payment['status'] === 1) { - printSuccess(['message' => 'Already confirmed', 'data' => ['order_ref' => $transactionID]]); - exit; - } - - // بدء المعاملة (Transaction) - $con->beginTransaction(); - - try { - // أ) تحديث حالة الدفع في السجل - $stmtUpdate = $con->prepare("UPDATE `paymentsLogSyria` SET status = 1, updated_at = NOW() WHERE order_ref = :ref"); - $stmtUpdate->execute([':ref' => $transactionID]); - - $passengerId = $payment['user_id']; - $originalAmount = floatval($payment['amount']); - $paymentMethod = $payment['payment_method'] ?? 'syriatel'; - - // ب) حساب المكافأة (نفس المنطق القديم) - $bonusAmount = match ((int)$originalAmount) { - 500 => 530.0, - 1000 => 1070.0, - 2000 => 2180.0, - 5000 => 5700.0, - default => $originalAmount, - }; - - // ج) إنشاء التوكنات مباشرة (بدون دالة خارجية) - // 1. توكن لمحفظة الراكب (بالمبلغ مع البونص) - $tokenPassenger = generateLocalToken($con, $passengerId, $bonusAmount); - if (!$tokenPassenger) throw new Exception('Failed to generate passenger token'); - - // 2. توكن لمحفظة السفر/الإيرادات (بالمبلغ الأصلي) - $tokenSefer = generateLocalToken($con, $passengerId, $originalAmount); - if (!$tokenSefer) throw new Exception('Failed to generate sefer token'); - - // د) الإضافة إلى passengerWallet مباشرة - // ملاحظة: تأكد من أسماء الأعمدة في جدول passengerWallet - $insertPassWallet = $con->prepare("INSERT INTO passengerWallet (passenger_id, balance, token, created_at) VALUES (:pid, :amount, :token, NOW())"); - $insertPassWallet->execute([ - ':pid' => $passengerId, - ':amount' => $bonusAmount, - ':token' => $tokenPassenger - ]); - if ($insertPassWallet->rowCount() === 0) throw new Exception('Insert to passengerWallet failed'); - - // هـ) الإضافة إلى seferWallet مباشرة - // ملاحظة: في الراكب، يكون driverId عادة هو 'passenger' لتمييز أن الدفع جاء من تطبيق الراكب - $insertSefer = $con->prepare("INSERT INTO seferWallet (driverId, passengerId, amount, paymentMethod, token, createdAt) - VALUES (:did, :pid, :amount, :method, :token, NOW())"); - $insertSefer->execute([ - ':did' => 'passenger', // كما في السكربت القديم - ':pid' => $passengerId, - ':amount' => $originalAmount, - ':method' => $paymentMethod, - ':token' => $tokenSefer - ]); - if ($insertSefer->rowCount() === 0) throw new Exception('Insert to seferWallet failed'); - - // و) تحديث التوكنات لتصبح مستخدمة (isUsed = TRUE) - $updateToken = $con->prepare("UPDATE payment_tokens SET isUsed = TRUE WHERE token = :token"); - $updateToken->execute([':token' => $tokenPassenger]); - $updateToken->execute([':token' => $tokenSefer]); - - // ز) تثبيت المعاملة - $con->commit(); - - mlog("Syriatel Confirm (Passenger): Success DB Transaction for user {$passengerId}"); - - // إرجاع رد النجاح - printSuccess([ - 'message' => 'Syriatel Confirm Success', - 'data' => [ - 'order_ref' => $transactionID, - 'finalAmount' => $bonusAmount, - 'syriatel' => $res - ] - ]); - exit; - - } catch (Throwable $e) { - // في حال حدوث خطأ، تراجع عن كل شيء - $con->rollBack(); - mlog("Syriatel Confirm (Passenger): Transaction Error - " . $e->getMessage()); - printFailure($lang === 'ar' ? "فشل تحديث المحفظة." : "Wallet update failed."); - exit; - } - -} catch (Throwable $e) { - mlog("Syriatel Confirm (Passenger): General Exception - " . $e->getMessage()); - printFailure($lang === 'ar' ? "خطأ في الخادم." : "Server error"); - exit; -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/passenger/start_payment.php b/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/passenger/start_payment.php deleted file mode 100755 index 9d4f7f5..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/passenger/start_payment.php +++ /dev/null @@ -1,124 +0,0 @@ -<?php -// /v1/main/ride/syriatel/passenger/start_payment.php -include "../../../connect.php"; -include_once "./syriatel_token_handler.php"; - -header('Content-Type: application/json; charset=utf-8'); - -// --- Input Parameters --- -$amount = filterRequest('amount'); -$passengerId = filterRequest('passengerId'); // بدل driverId -$phone = filterRequest('phone'); // رقم الراكب (customerMSISDN) -$lang = filterRequest('lang') ?? 'ar'; - -error_log("Syriatel Start (Passenger): Request received for passenger {$passengerId} with amount {$amount}"); - -if (!$amount || !$passengerId || !$phone) { - printFailure($lang === 'ar' ? "بيانات ناقصة." : "Missing required parameters."); - exit; -} -function generate_order_ref(): string { - // مرجع مقروء + فريد: INT-YYYYMMDDHHMMSS-6digits - $ts = date('YmdHis'); - $rand = str_pad((string)random_int(0, 999999), 6, '0', STR_PAD_LEFT); - return "INT-$ts-$rand"; -} - -// --- Environment Variables --- -$baseUrl = rtrim(getenv('SYRIATEL_API_BASE_URL'), '/'); -$merchantMSISDN = getenv('SYRIATEL_MERCHANT_MSISDN'); - -if (!$baseUrl || !$merchantMSISDN) { - error_log("Syriatel Start (Passenger): Missing SYRIATEL_API_BASE_URL or SYRIATEL_MERCHANT_MSISDN env variables."); - printFailure($lang === 'ar' ? "خطأ إعدادات الخادم." : "Server configuration error."); - exit; -} - -try { - // 1) Get Authentication Token - $token = getSyriatelToken(); - error_log("Syriatel Start (Passenger):token= .$token"); - if (!$token) { - printFailure($lang === 'ar' ? "تعذّر المصادقة مع مزوّد الدفع." : "Could not authenticate with the payment provider."); - exit; - } - - // 2) Generate transaction ID + log - $transactionID = generate_order_ref(); // موجود لديك مسبقًا - // ملاحظة: استخدم جدول منفصل للركاب، أو وحّد الجدول مع حقل user_type. هنا نفترض جدول خاص بالراكب. - $stmt = $con->prepare( - "INSERT INTO `paymentsLogSyria` - (user_id, amount, status, order_ref, payment_method, created_at) - VALUES - (:user_id, :amount, 0, :order_ref, 'syriatel', NOW())" - ); - $stmt->execute([ - ':user_id' => $passengerId, - ':amount' => $amount, - ':order_ref' => $transactionID - ]); - error_log("Syriatel Start (Passenger): Logged transaction {$transactionID} for passenger {$passengerId}"); - - // 3) Call Syriatel paymentRequest - $body = [ - "customerMSISDN" => $phone, // هاتف الراكب - "merchantMSISDN" => $merchantMSISDN, // هاتف التاجر (المحفظة) - "amount" => $amount, - "transactionID" => $transactionID, - "token" => $token - ]; - - $ch = curl_init("{$baseUrl}/ePaymentExternalModule/paymentRequest"); - curl_setopt_array($ch, [ - CURLOPT_POST => true, - CURLOPT_POSTFIELDS => json_encode($body, JSON_UNESCAPED_UNICODE), - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HTTPHEADER => ["Content-Type: application/json"], - CURLOPT_TIMEOUT => 25, - ]); - - $response = curl_exec($ch); - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - $curlErr = curl_error($ch); - curl_close($ch); - - if ($curlErr) { - error_log("Syriatel Start (Passenger): cURL Error - {$curlErr}"); - } - - error_log("Syriatel Start (Passenger): API Response HTTP {$httpCode} - {$response}"); - - if ($httpCode !== 200) { - printFailure($lang === 'ar' ? "خطأ اتصال ببوابة الدفع." : "Payment gateway communication error."); - exit; - } - - $responseData = json_decode($response, true); - - // حسب الدوكيومنت: resultCode = 1 يعني OTP انرسل بنجاح - //errorCode = 0 => Success -if (isset($responseData['errorCode']) && (string)$responseData['errorCode'] === "0") { - printSuccess([ - 'message' => 'OTP sent successfully.', - 'transactionID' => $transactionID, - ]); -} -// 2) إذا resultCode = 1 => OTP sent -elseif (isset($responseData['resultCode']) && (int)$responseData['resultCode'] === 1) { - printSuccess([ - 'message' => 'OTP sent successfully.', - 'transactionID' => $transactionID, - ]); -} -// 3) أي شيء آخر => فشل -else { - $errorMessage = $responseData['resultDescription'] - ?? $responseData['errorDesc'] - ?? 'Failed to initiate payment.'; - printFailure($errorMessage); -} - -} catch (Throwable $e) { - error_log("Syriatel Start: Exception - " . $e->getMessage()); - printFailure("An unexpected server error occurred."); -} \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/passenger/syriatel_token.cache b/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/passenger/syriatel_token.cache deleted file mode 100644 index 3877044..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/passenger/syriatel_token.cache +++ /dev/null @@ -1 +0,0 @@ -{"token":"E964A84D88C9A2306016886254475A49BE2BC95AFB6F4C30CD24857F5EFACDD2173D59A4B951CCEEE311AEFD3E40ABBF3E70BD2B1B8B3F0703E094C419E6291A6CFEA5C3CCD3B57E093FD58E6BB09ECF","expires_at":1759998218} \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/passenger/syriatel_token_handler.php b/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/passenger/syriatel_token_handler.php deleted file mode 100755 index ba53ae6..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/ride/syriatel/passenger/syriatel_token_handler.php +++ /dev/null @@ -1,74 +0,0 @@ -<?php // syriatel_token_handler -function getSyriatelToken(): ?string { - // اضبط البيئة: prod أو stage (افتراضي prod) - $env = getenv("SYRIATEL_ENV") ?: "prod"; - - // Base URLs من Postman - $baseStage = "https://merchants.syriatel.sy:1443/ePayment_external_Json_test/rs/ePaymentExternalModule"; - $baseProd = "https://merchants.syriatel.sy:1443/ePayment_external_Json/rs/ePaymentExternalModule"; - - $baseUrl = ($env === "stage") ? $baseStage : $baseProd; - $url = $baseUrl . "/getToken"; - - // ⚠️ لا تضع قيم افتراضية حساسة Hardcoded - $username = getenv("SYRIATEL_USERNAME"); - $password = getenv("SYRIATEL_PASSWORD"); - - if (!$username || !$password) { - error_log("[GetSyriatelToken] Missing credentials in ENV"); - printFailure("Payment provider credentials are missing."); - return null; - } - - error_log("[GetSyriatelToken] Env={$env} | URL={$url} | user={$username}"); - - $payload = [ - "username" => $username, - "password" => $password - ]; - - $ch = curl_init($url); - curl_setopt_array($ch, [ - CURLOPT_POST => true, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_HTTPHEADER => [ - "Content-Type: application/json", - "User-Agent: Mozilla/5.0", - ], - CURLOPT_POSTFIELDS => json_encode($payload, JSON_UNESCAPED_UNICODE), - CURLOPT_CONNECTTIMEOUT => 8, - CURLOPT_TIMEOUT => 40, - CURLOPT_SSL_VERIFYPEER => true, - CURLOPT_SSL_VERIFYHOST => 2, - ]); - - $response = curl_exec($ch); - $errno = curl_errno($ch); - $errstr = curl_error($ch); - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - curl_close($ch); - - if ($errno) { - error_log("[GetSyriatelToken] cURL error {$errno}: {$errstr}"); - printFailure("Could not connect to the payment provider.", $errno); - return null; - } - - if ($httpCode !== 200 || !$response) { - error_log("[GetSyriatelToken] HTTP {$httpCode} | Empty/invalid response"); - printFailure("Could not authenticate with the payment provider."); - return null; - } - - $data = json_decode($response, true); - $token = $data["token"] ?? null; - - if (!$token) { - error_log("[GetSyriatelToken] Token not found in response: " . substr($response, 0, 300)); - printFailure("Could not authenticate with the payment provider."); - return null; - } - - error_log("[GetSyriatelToken] Token received successfully"); - return $token; -} \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/serviceApp/addNotesDriver.php b/walletintaleq.intaleq.xyz/v2/main/serviceApp/addNotesDriver.php deleted file mode 100644 index c10e60c..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/serviceApp/addNotesDriver.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -include "../connect.php"; - -// Retrieve and sanitize input parameters -$phone = filterRequest("phone"); -$note = filterRequest("note"); -$editor = filterRequest("editor"); - -// SQL query to insert a new note into the notesForDriverService table -$sql = "INSERT INTO `notesForDriverService` ( `phone`, `note`, `editor`) - VALUES (:phone, :note, :editor)"; - -// Prepare the SQL statement -$stmt = $con->prepare($sql); - -// Bind the parameters -$stmt->bindParam(':phone', $phone); -$stmt->bindParam(':note', $note); -$stmt->bindParam(':editor', $editor); - -$stmt->execute(); - -if ($stmt->rowCount() > 0) { - // Print a success message - printSuccess($message = "note inserted successfully"); -} else { - // Print a failure message - printFailure($message = "Failed to insert note"); -} -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/serviceApp/addNotesPassenger.php b/walletintaleq.intaleq.xyz/v2/main/serviceApp/addNotesPassenger.php deleted file mode 100644 index ce18529..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/serviceApp/addNotesPassenger.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -include "../connect.php"; - -// Retrieve and sanitize input parameters -$phone = filterRequest("phone"); -$note = filterRequest("note"); -$editor = filterRequest("editor"); - -// SQL query to insert a new note into the notesForDriverService table -$sql = "INSERT INTO `notesForPassengerService` ( `phone`, `note`, `editor`) - VALUES (:phone, :note, :editor)"; - -// Prepare the SQL statement -$stmt = $con->prepare($sql); - -// Bind the parameters -$stmt->bindParam(':phone', $phone); -$stmt->bindParam(':note', $note); -$stmt->bindParam(':editor', $editor); - -$stmt->execute(); - -if ($stmt->rowCount() > 0) { - // Print a success message - printSuccess($message = "note inserted successfully"); -} else { - // Print a failure message - printFailure($message = "Failed to insert note"); -} -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/serviceApp/addWelcomeDriverNote.php b/walletintaleq.intaleq.xyz/v2/main/serviceApp/addWelcomeDriverNote.php deleted file mode 100644 index c0be64e..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/serviceApp/addWelcomeDriverNote.php +++ /dev/null @@ -1,26 +0,0 @@ -<?php - -include "../connect.php"; - -// Retrieve and sanitize input parameters -$driverId = filterRequest("driverId"); -$notes = filterRequest("notes"); - - -// SQL query to insert a new note into the notesForDriverService table -$sql = "INSERT INTO `welcomeDriverCall`( `driverId`, `isCall`, `notes`) VALUES ('$driverId','1','$notes')"; - -// Prepare the SQL statement -$stmt = $con->prepare($sql); - - -$stmt->execute(); - -if ($stmt->rowCount() > 0) { - // Print a success message - printSuccess($message = "note inserted successfully"); -} else { - // Print a failure message - printFailure($message = "Failed to insert note"); -} -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/serviceApp/driverWhoregisterFfterCall.php b/walletintaleq.intaleq.xyz/v2/main/serviceApp/driverWhoregisterFfterCall.php deleted file mode 100644 index 0a3226b..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/serviceApp/driverWhoregisterFfterCall.php +++ /dev/null @@ -1,30 +0,0 @@ -<?php -include "../connect.php"; -// $driverID = filterRequest("driverID"); - -$sql = "SELECT - * -FROM - `driver` -LEFT JOIN `notesForDriverService` ON `notesForDriverService`.`phone` = driver.phone -WHERE - `notesForDriverService`.phone = driver.phone - AND MONTH(`driver`.`created_at`) = MONTH(CURRENT_DATE()) -ORDER BY - `driver`.`created_at` -DESC;"; -$stmt = $con->prepare($sql); -$stmt->execute(); - -if ($stmt->rowCount() > 0) { - // Fetch the record - $row = $stmt->fetchAll(PDO::FETCH_ASSOC); - - printSuccess( $row); - -} - else{ - // Print a failure message - printFailure($message = "No wallet record found"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/serviceApp/editCarPlate.php b/walletintaleq.intaleq.xyz/v2/main/serviceApp/editCarPlate.php deleted file mode 100644 index fcdf44a..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/serviceApp/editCarPlate.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php -include "../connect.php"; - -// Retrieve and sanitize input parameters -$driverId = filterRequest("driverId"); -$carPlate = filterRequest("carPlate"); - -// Start a transaction -$con->beginTransaction(); - -try { - // Update CarRegistration table - $sqlUpdate = "UPDATE `CarRegistration` SET `car_plate` = :carPlate WHERE `driverID` = :driverId"; - $stmtUpdate = $con->prepare($sqlUpdate); - $stmtUpdate->bindParam(':carPlate', $carPlate); - $stmtUpdate->bindParam(':driverId', $driverId); - $stmtUpdate->execute(); - - // Check if the update was successful - if ($stmtUpdate->rowCount() > 0) { - // Insert into carPlateEdit table - $sqlInsert = "INSERT INTO `carPlateEdit` (`driverId`, `carPlate`, `isEdit`) VALUES (:driverId, :carPlate, 1)"; - $stmtInsert = $con->prepare($sqlInsert); - $stmtInsert->bindParam(':driverId', $driverId); - $stmtInsert->bindParam(':carPlate', $carPlate); - $stmtInsert->execute(); - - // Commit the transaction - $con->commit(); - - // Print a success message - printSuccess("Car plate updated and edit record inserted successfully"); - } else { - // Rollback the transaction if update failed - $con->rollBack(); - printFailure("Failed to update car plate. No matching record found."); - } -} catch (PDOException $e) { - // Rollback the transaction if any error occurred - $con->rollBack(); - printFailure("An error occurred: " . $e->getMessage()); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/serviceApp/error_log b/walletintaleq.intaleq.xyz/v2/main/serviceApp/error_log deleted file mode 100644 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/serviceApp/getCarPlateNotEdit.php b/walletintaleq.intaleq.xyz/v2/main/serviceApp/getCarPlateNotEdit.php deleted file mode 100755 index a06f55d..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/serviceApp/getCarPlateNotEdit.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php - -include "../connect.php"; -$phoneNumber = filterRequest("phone_number"); - -$sql = "SELECT - CR.`id`, - CR.`driverID`, - CR.`vin`, - CR.`car_plate`, - CR.`make`, - CR.`model`, - CR.`year`, - CR.`expiration_date`, - CR.`color`, - CR.`owner`, - CR.`color_hex`, - CR.`address`, - CR.`displacement`, - CR.`fuel`, - CR.`registration_date`, - CR.`created_at` -FROM - `CarRegistration` CR -WHERE - CR.`driverID` NOT IN( - SELECT DISTINCT - CPE.`driverId` - FROM - `carPlateEdit` CPE -) -LIMIT 10; -"; -$stmt = $con->prepare($sql); -$stmt->execute(); - -if ($stmt->rowCount() > 0) { - // Fetch the records - $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); - - printSuccess($rows); - -} else { - // Print a failure message - printFailure($message = "No Car verified yet found"); -} - -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/serviceApp/getComplaintAllData.php b/walletintaleq.intaleq.xyz/v2/main/serviceApp/getComplaintAllData.php deleted file mode 100644 index 108ca04..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/serviceApp/getComplaintAllData.php +++ /dev/null @@ -1,169 +0,0 @@ -<?php -include "../connect.php"; -// $driverID = filterRequest("driverID"); - -$sql = "SELECT - cm.`id`, - cm.`ride_id`, - cm.`passenger_id`, - cm.`driver_id`, - cm.`complaint_type`, - cm.`description`, - cm.`date_filed`, - cm.`statusComplaint`, - cm.`resolution`, - cm.`date_resolved`, - p.first_name AS passengerName, - d.name_arabic AS driverName, - d.gender, - ride.price AS priceOfRide, - ride.status AS rideStatus, - ride.carType ascarType, - ride.paymentMethod AS ridePaymentMethod, - ride.rideTimeFinish AS rideTimeFinish, - payments.amount as paymentFromPaymentTable, - payments.created_at as timeFromPaymentTable, - ( - SELECT - AVG(rd.rating) - FROM - ratingDriver rd - WHERE - rd.driver_id = cm.driver_id -) AS avgRatingDriverFromPassengers, -( - SELECT - COUNT(*) - FROM - ratingDriver rd - WHERE - rd.driver_id = cm.driver_id -) AS countratingDriverFromPassengers, -( - SELECT - AVG(rp.rating) - FROM - ratingPassenger rp - WHERE - rp.passenger_id = cm.passenger_id -) AS avgRatingPassengerFromDrivers, -( - SELECT - COUNT(*) - FROM - ratingPassenger rp - WHERE - rp.passenger_id = cm.passenger_id -) AS countRatingPassengerFromDrivers, -( - SELECT - COUNT(*) - FROM - ride - WHERE - ride.driver_id = cm.driver_id -) countDriverRide, -( - SELECT - COUNT(*) - FROM - ride - WHERE - ride.passenger_id = cm.passenger_id -) countPassengerRide, -( - SELECT - COALESCE(SUM(amount), - 0) AS visaDriver - FROM - payments - WHERE - isGiven = 'waiting' AND `payment_method` IN( - 'visa-in', - 'visa', - 'visaRide', - 'TransferFrom', - 'payout', - 'TransferTo' - ) AND payments.`driverID` = cm.driver_id -) AS driverVisa, -( - SELECT - COALESCE(SUM(amount), - 0) AS pointDriver - FROM - driverWallet dw - WHERE - dw.paymentMethod IN( - 'visa-in', - 'visa', - 'visaRide', - 'TransferFrom', - 'payout', - 'TransferTo' - ) AND dw.`driverID` = cm.driver_id -) AS driverWallet, -( - SELECT - COALESCE(SUM(pw.balance), - 0) - FROM - passengerWallet pw - WHERE - pw.passenger_id = cm.passenger_id -) AS passengerWallet, -( - SELECT - token - FROM - driverToken - WHERE - driverToken.captain_id = cm.driver_id -) AS driverToken, -( - SELECT - token - FROM - tokens - WHERE - tokens.passengerID = cm.passenger_id -) AS passengerToken, -( - SELECT - COUNT(*) - FROM - complaint - WHERE - complaint.passenger_id = cm.passenger_id AND cm.complaint_type = 'Passenger' -) AS countOfComplaintFromPassenger, -( - SELECT - COUNT(*) - FROM - complaint - WHERE - complaint.driver_id = cm.driver_id AND cm.complaint_type = 'Driver' -) AS countOfComplaintFromDriver -FROM - `complaint` cm -LEFT JOIN passengers p ON - p.id = cm.`passenger_id` -LEFT JOIN driver d ON - d.id = cm.driver_id -LEFT JOIN ride ON ride.id = cm.ride_id -left join payments on payments.rideId=cm.ride_id"; -$stmt = $con->prepare($sql); -$stmt->execute(); - -if ($stmt->rowCount() > 0) { - // Fetch the record - $row = $stmt->fetchAll(PDO::FETCH_ASSOC); - - printSuccess( $row); - -} - else{ - // Print a failure message - printFailure($message = "No wallet record found"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/serviceApp/getComplaintAllDataForDriver.php b/walletintaleq.intaleq.xyz/v2/main/serviceApp/getComplaintAllDataForDriver.php deleted file mode 100644 index 00d0963..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/serviceApp/getComplaintAllDataForDriver.php +++ /dev/null @@ -1,171 +0,0 @@ -<?php -include "../connect.php"; -$driverID = filterRequest("driver_id"); - -$sql = "SELECT - cm.`id`, - cm.`ride_id`, - cm.`passenger_id`, - cm.`driver_id`, - cm.`complaint_type`, - cm.`description`, - cm.`date_filed`, - cm.`statusComplaint`, - cm.`resolution`, - cm.`date_resolved`, - p.first_name AS passengerName, - d.name_arabic AS driverName, - d.gender, - ride.price AS priceOfRide, - ride.status AS rideStatus, - ride.carType AS carType, - ride.paymentMethod AS ridePaymentMethod, - ride.rideTimeFinish AS rideTimeFinish, - payments.amount AS paymentFromPaymentTable, - payments.created_at AS timeFromPaymentTable, - ( - SELECT - AVG(rd.rating) - FROM - ratingDriver rd - WHERE - rd.driver_id = cm.driver_id -) AS avgRatingDriverFromPassengers, -( - SELECT - COUNT(*) - FROM - ratingDriver rd - WHERE - rd.driver_id = cm.driver_id -) AS countratingDriverFromPassengers, -( - SELECT - AVG(rp.rating) - FROM - ratingPassenger rp - WHERE - rp.passenger_id = cm.passenger_id -) AS avgRatingPassengerFromDrivers, -( - SELECT - COUNT(*) - FROM - ratingPassenger rp - WHERE - rp.passenger_id = cm.passenger_id -) AS countRatingPassengerFromDrivers, -( - SELECT - COUNT(*) - FROM - ride - WHERE - ride.driver_id = cm.driver_id -) countDriverRide, -( - SELECT - COUNT(*) - FROM - ride - WHERE - ride.passenger_id = cm.passenger_id -) countPassengerRide, -( - SELECT - COALESCE(SUM(amount), - 0) AS visaDriver - FROM - payments - WHERE - isGiven = 'waiting' AND `payment_method` IN( - 'visa-in', - 'visa', - 'visaRide', - 'TransferFrom', - 'payout', - 'TransferTo' - ) AND payments.`driverID` = cm.driver_id -) AS driverVisa, -( - SELECT - COALESCE(SUM(amount), - 0) AS pointDriver - FROM - driverWallet dw - WHERE - dw.paymentMethod IN( - 'visa-in', - 'visa', - 'visaRide', - 'TransferFrom', - 'payout', - 'TransferTo' - ) AND dw.`driverID` = cm.driver_id -) AS driverWallet, -( - SELECT - COALESCE(SUM(pw.balance), - 0) - FROM - passengerWallet pw - WHERE - pw.passenger_id = cm.passenger_id -) AS passengerWallet, -( - SELECT - token - FROM - driverToken - WHERE - driverToken.captain_id = cm.driver_id -) AS driverToken, -( - SELECT - token - FROM - tokens - WHERE - tokens.passengerID = cm.passenger_id -) AS passengerToken, -( - SELECT - COUNT(*) - FROM - complaint - WHERE - complaint.passenger_id = cm.passenger_id AND cm.complaint_type = 'Passenger' -) AS countOfComplaintFromPassenger, -( - SELECT - COUNT(*) - FROM - complaint - WHERE - complaint.driver_id = cm.driver_id AND cm.complaint_type = 'Driver' -) AS countOfComplaintFromDriver -FROM - `complaint` cm -LEFT JOIN passengers p ON - p.id = cm.`passenger_id` -LEFT JOIN driver d ON - d.id = cm.driver_id -LEFT JOIN ride ON ride.id = cm.ride_id -LEFT JOIN payments ON payments.rideId = cm.ride_id -WHERE - cm.driver_id = '$driverID'"; -$stmt = $con->prepare($sql); -$stmt->execute(); - -if ($stmt->rowCount() > 0) { - // Fetch the record - $row = $stmt->fetchAll(PDO::FETCH_ASSOC); - - printSuccess( $row); - -} - else{ - // Print a failure message - printFailure($message = $sql); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/serviceApp/getDriverByPhone.php b/walletintaleq.intaleq.xyz/v2/main/serviceApp/getDriverByPhone.php deleted file mode 100644 index 7a34453..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/serviceApp/getDriverByPhone.php +++ /dev/null @@ -1,131 +0,0 @@ -<?php -include "../connect.php"; -$phone = filterRequest("phone"); - -$sql = "SELECT - COALESCE( - ( - SELECT - COUNT(*) - FROM - `ride` - WHERE - `ride`.`driver_id` = d.id - ), - 0 - ) AS countRide, - COALESCE( - ( - SELECT - AVG(`ratingDriver`.`rating`) - FROM - ratingDriver - WHERE - `ratingDriver`.`driver_id` = d.id - ), - 0 - ) AS rating, - COALESCE( - ( - SELECT - SUM(pd.amount) - FROM - `payments` pd - WHERE - pd.driverID = d.id - ), - 0 - ) AS totalPayment, - COALESCE( - ( - SELECT - SUM(dw.amount) - FROM - `driverWallet` dw - WHERE - dw.driverID = d.id - ), - 0 - ) AS totalDriverWallet, - COALESCE( - ( - SELECT - COUNT(*) - FROM - complaint - WHERE - complaint.driver_id = d.id - ), - 0 - ) AS countComplaint, - COALESCE( - ( - SELECT - COUNT(*) - FROM - driver_ride_scam scam - WHERE - scam.driverID = d.id - ), - 0 - ) AS countScam, - COALESCE( - ( - SELECT - complaint.description - FROM - complaint - WHERE - complaint.driver_id = d.id - ORDER BY - complaint.date_resolved - DESC - LIMIT 1 - ), - '' - ) AS complaint, COALESCE( - ( - SELECT - COUNT(*) - FROM - ratingPassenger - WHERE - ratingPassenger.driverID = d.id - ), - 0 - ) AS DRatingPassengersCount, - COALESCE( - ( - SELECT - AVG(ratingPassenger.rating) - FROM - ratingPassenger - WHERE - ratingPassenger.driverID = d.id - ), - 0 - ) AS avgDRatingPassenger, - cr.*, - d.* -FROM - driver d -LEFT JOIN CarRegistration cr ON - cr.driverID = d.id -WHERE - d.`phone` = '$phone'; -"; -$stmt = $con->prepare($sql); -$stmt->execute(); - -if ($stmt->rowCount() > 0) { - // Fetch the record - $row = $stmt->fetchAll(PDO::FETCH_ASSOC); - - printSuccess( $row); - -} - else{ - // Print a failure message - printFailure($message = "No wallet record found"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/serviceApp/getDriverNotCompleteRegistration.php b/walletintaleq.intaleq.xyz/v2/main/serviceApp/getDriverNotCompleteRegistration.php deleted file mode 100755 index 84c7478..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/serviceApp/getDriverNotCompleteRegistration.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php - -include "../connect.php"; - -$sql = "SELECT - * -FROM - phone_verification -LEFT JOIN `notesForDriverService` -ON - `notesForDriverService`.`phone` = `phone_verification`.`phone_number` -WHERE - phone_verification.phone_number NOT IN( - SELECT - phone - FROM - driver - WHERE - phone IS NOT NULL -) AND phone_verification.created_at >= DATE_SUB(CURDATE(), INTERVAL 18 DAY) -ORDER BY - created_at -DESC -LIMIT 0, 200; -"; -$stmt = $con->prepare($sql); -$stmt->execute(); - -if ($stmt->rowCount() > 0) { - // Fetch the records - $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); - - printSuccess($rows); - -} else { - // Print a failure message - printFailure($message = "No Phone verified yet found"); -} - -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/serviceApp/getNewDriverRegister.php b/walletintaleq.intaleq.xyz/v2/main/serviceApp/getNewDriverRegister.php deleted file mode 100644 index d79b645..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/serviceApp/getNewDriverRegister.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -include "../connect.php"; - -$sql = "SELECT - d.id, - d.phone, - d.email, - d.gender, - d.license_type, - d.national_number, - d.name_arabic, - d.name_english, - d.issue_date, - d.expiry_date, - d.license_categories, - d.address, - d.card_id, - d.occupation, - d.licenseIssueDate, - d.religion, - d.status, - d.birthdate, - d.site, - d.first_name, - d.last_name, - d.accountBank, - d.bankCode, - d.education, - d.employmentType, - d.maritalStatus, - d.fullNameMaritial, - d.expirationDate, - d.created_at, - d.updated_at, - wdc.id AS welcomId, - wdc.isCall, - wdc.notes, - wdc.createdAt AS welcomeCreatedAt -FROM - driver d -LEFT JOIN welcomeDriverCall wdc ON - wdc.driverId = d.id -WHERE - d.created_at BETWEEN DATE_SUB(CURDATE(), INTERVAL 1 DAY) AND CURDATE() + INTERVAL 1 DAY -ORDER BY - d.created_at DESC; - - -"; -$stmt = $con->prepare($sql); -$stmt->execute(); - -if ($stmt->rowCount() > 0) { - // Fetch the records - $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); - - printSuccess($rows); - -} else { - // Print a failure message - printFailure($message = "No Phone verified yet found"); -} - -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/serviceApp/getPassengersByPhone.php b/walletintaleq.intaleq.xyz/v2/main/serviceApp/getPassengersByPhone.php deleted file mode 100644 index 7aadbb3..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/serviceApp/getPassengersByPhone.php +++ /dev/null @@ -1,65 +0,0 @@ -<?php -include "../connect.php"; -$phone = filterRequest("phone"); - -$sql = "SELECT - p.*, - COALESCE(r.id, 0) AS ride_id, - COALESCE(r.start_location, '') AS start_location, - COALESCE(r.end_location, '') AS end_location, - COALESCE(r.date, '1970-01-01') AS ride_date, - COALESCE(r.time, '00:00:00') AS ride_time, - COALESCE(r.endtime, '00:00:00') AS ride_endtime, - COALESCE(r.price, 0) AS price, - COALESCE(r.passenger_id, 0) AS ride_passenger_id, - COALESCE(r.driver_id, 0) AS driver_id, - COALESCE(r.status, '') AS ride_status, - COALESCE(r.paymentMethod, '') AS ride_payment_method, - COALESCE(r.carType, '') AS car_type, - COALESCE(r.created_at, '1970-01-01 00:00:00') AS ride_created_at, - COALESCE(r.updated_at, '1970-01-01 00:00:00') AS ride_updated_at, - COALESCE(r.DriverIsGoingToPassenger, 0) AS driver_is_going_to_passenger, - COALESCE(r.rideTimeStart, '1970-01-01 00:00:00') AS ride_time_start, - COALESCE(r.rideTimeFinish, '1970-01-01 00:00:00') AS ride_time_finish, - COALESCE(r.price_for_driver, 0) AS price_for_driver, - COALESCE(r.price_for_passenger, 0) AS price_for_passenger, - COALESCE(r.distance, 0) AS distance, - COALESCE(pw.balance, 0) AS passenger_wallet_balance, - COALESCE(pay.amount, 0) AS passenger_payment_amount, - COALESCE(pay.payment_method, '') AS passenger_payment_method, - COALESCE(dw.amount, 0) AS driver_payment_amount, - COALESCE(dw.paymentMethod, '') AS driver_payment_method -FROM - passengers p -LEFT JOIN - ride r ON p.id = r.passenger_id -LEFT JOIN - passengerWallet pw ON p.id = pw.passenger_id -LEFT JOIN - payments pay ON r.id = pay.rideId -LEFT JOIN - driverWallet dw ON r.driver_id = dw.driverID AND pay.id = dw.paymentID -WHERE - p.phone = '$phone' - AND r.id = ( - SELECT id - FROM ride - WHERE passenger_id = p.id - ORDER BY date DESC, time DESC - LIMIT 1 - )"; -$stmt = $con->prepare($sql); -$stmt->execute(); - -if ($stmt->rowCount() > 0) { - // Fetch the record - $row = $stmt->fetchAll(PDO::FETCH_ASSOC); - - printSuccess( $row); - -} - else{ - // Print a failure message - printFailure($message = "No wallet record found"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/serviceApp/getPassengersNotCompleteRegistration.php b/walletintaleq.intaleq.xyz/v2/main/serviceApp/getPassengersNotCompleteRegistration.php deleted file mode 100644 index 7528cc9..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/serviceApp/getPassengersNotCompleteRegistration.php +++ /dev/null @@ -1,41 +0,0 @@ -<?php - -include "../connect.php"; - -$sql = "SELECT - * - -FROM - phone_verification_passenger - LEFT JOIN `notesForPassengerService` -ON - `notesForPassengerService`.`phone` = `notesForPassengerService`.`phone` -WHERE - phone_verification_passenger.phone_number NOT IN( - SELECT - phone - FROM - passengers - WHERE - phone IS NOT NULL -) AND phone_verification_passenger.created_at >= DATE_SUB(CURDATE(), INTERVAL 4 DAY) -ORDER BY - created_at -DESC -LIMIT 0, 25; -"; -$stmt = $con->prepare($sql); -$stmt->execute(); - -if ($stmt->rowCount() > 0) { - // Fetch the records - $rows = $stmt->fetchAll(PDO::FETCH_ASSOC); - - printSuccess($rows); - -} else { - // Print a failure message - printFailure($message = "No Phone verified yet found"); -} - -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/serviceApp/getPassengersStatic.php b/walletintaleq.intaleq.xyz/v2/main/serviceApp/getPassengersStatic.php deleted file mode 100644 index 7b42847..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/serviceApp/getPassengersStatic.php +++ /dev/null @@ -1,48 +0,0 @@ -<?php -include "../connect.php"; -$current_month = date('m'); -$current_year = date('Y'); -// Get the first and last days of the current month. -$first_day_of_month = date('Y-m-d', strtotime($current_year . '-' . $current_month . '-01')); -$last_day_of_month = date('Y-m-d', strtotime($current_year . '-' . $current_month . '-' . cal_days_in_month(CAL_GREGORIAN, $current_month, $current_year))); - -// Create a SQL query to select the total passengers for each day in the current month. -$sql = " -WITH RECURSIVE date_series AS ( - SELECT '$first_day_of_month' AS date - UNION ALL - SELECT DATE_ADD(date, INTERVAL 1 DAY) - FROM date_series - WHERE date < LEAST(CURDATE(), DATE_SUB('$last_day_of_month', INTERVAL 1 DAY)) -) -SELECT - date_series.date AS day, - COALESCE(COUNT(passengers.id), 0) AS totalPassengers, - (SELECT COUNT(*) FROM passengers - WHERE passengers.created_at >= '$first_day_of_month' - AND passengers.created_at < '$last_day_of_month') AS totalMonthly -FROM - date_series -LEFT JOIN - passengers ON DATE(passengers.created_at) = date_series.date -WHERE - date_series.date >= '$first_day_of_month' - AND date_series.date < '$last_day_of_month' -GROUP BY - date_series.date -ORDER BY - date_series.date DESC -"; - -$stmt = $con->prepare($sql); -$stmt->execute(); -$passenger_data = $stmt->fetchAll(PDO::FETCH_ASSOC); - -if ($passenger_data) { - // Print the passenger data as JSON - printSuccess($data = $passenger_data); -} else { - // Print a failure message - printFailure($message = "No passenger data found"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/serviceApp/getdriverstotalMonthly.php b/walletintaleq.intaleq.xyz/v2/main/serviceApp/getdriverstotalMonthly.php deleted file mode 100644 index 42b90e3..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/serviceApp/getdriverstotalMonthly.php +++ /dev/null @@ -1,114 +0,0 @@ -<?php -include "../connect.php"; -$current_month = date('m'); -$current_year = date('Y'); -// Get the first and last days of the current month. -$first_day_of_month = date('Y-m-d', strtotime($current_year . '-' . $current_month . '-01')); -$last_day_of_month = date('Y-m-t', strtotime($first_day_of_month)); - -// Create a SQL query to select the total duration for the driver for each day in the current month. -$sql = "WITH - RECURSIVE date_series AS( - SELECT - '$first_day_of_month' AS DATE - UNION ALL -SELECT - DATE_ADD(DATE, INTERVAL 1 DAY) -FROM - date_series -WHERE - DATE < LEAST( - CURDATE(), DATE_SUB('$last_day_of_month', INTERVAL 1 DAY)) - ) -SELECT - date_series.date AS day, - ( -SELECT - COUNT(*) -FROM - `driver` -) AS totalDrivers, -( - SELECT - COUNT(*) - FROM - driver - WHERE - DATE(driver.created_at) = date_series.date -) AS dailyTotalDrivers, -( - SELECT - COUNT(*) - FROM - notesForDriverService - WHERE - DATE( - notesForDriverService.createdAt - ) = date_series.date -) AS dailyTotalCallingDrivers, -( - SELECT - COUNT(*) - FROM - notesForDriverService n - JOIN driver d ON - n.phone = d.phone - WHERE - DATE(n.createdAt) = date_series.date -) AS dailyMatchingNotes, -( - SELECT - COUNT(*) - FROM - driver - WHERE - driver.created_at >= '$first_day_of_month' AND driver.created_at < '$last_day_of_month' -) AS totalMonthlyDrivers, -( - SELECT - COUNT(*) - FROM - notesForDriverService - WHERE - notesForDriverService.createdAt >= '$first_day_of_month' AND notesForDriverService.createdAt < '$last_day_of_month' -) AS totalMonthlyCallingDrivers, -( - SELECT - COUNT(*) - FROM - notesForDriverService n - JOIN driver d ON - n.phone = d.phone - WHERE - n.createdAt >= '$first_day_of_month' AND n.createdAt < '$last_day_of_month' -) AS totalMonthlyMatchingNotes -FROM - date_series -LEFT JOIN driver ON DATE(driver.created_at) = date_series.date -LEFT JOIN notesForDriverService ON DATE( - notesForDriverService.createdAt - ) = date_series.date AND notesForDriverService.phone = driver.phone -WHERE - date_series.date >= '$first_day_of_month' AND date_series.date <= LEAST( - CURDATE(), DATE_SUB('$last_day_of_month', INTERVAL 1 DAY)) - GROUP BY - date_series.date - ORDER BY - date_series.date - DESC - ; - -"; - -$stmt = $con->prepare($sql); -$stmt->execute(); -$car_locations = $stmt->fetchAll(PDO::FETCH_ASSOC); - -if ($car_locations) { - // Print the car location data as JSON - printSuccess($data = $car_locations); -} else { - // Print a failure message - printFailure($message = "No car locations found"); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/serviceApp/login.php b/walletintaleq.intaleq.xyz/v2/main/serviceApp/login.php deleted file mode 100644 index e26c4e3..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/serviceApp/login.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php -include "../connect.php"; - -// Get email and password from the request -$email = filterRequest('email'); -$password = filterRequest('password'); - -// Check if email and password are provided -if (empty($email) || empty($password)) { - echo json_encode([ - "status" => "failure", - "message" => "Email and password are required." - ]); - exit(); -} - -// SQL to check for user with provided email -$sql = "SELECT * FROM `users` WHERE `email` = :email"; - -$stmt = $con->prepare($sql); -$stmt->bindParam(':email', $email); -$stmt->execute(); - -$user = $stmt->fetch(PDO::FETCH_ASSOC); - -header('Content-Type: application/json'); // Ensure the response is JSON - -if ($user) { - // Verify the password - if ($password=== $user['password']) { - // Password is correct - unset($user['password']); // Remove password from the response - echo json_encode([ - "status" => "success", - "message" => "Login successful", - "data" => $user - ]); - } else { - // Password is incorrect - echo json_encode([ - "status" => "failure", - "message" => "Incorrect password", - "password"=>$password, - "password1"=>$user['password'], - ]); - } -} else { - // User not found - echo json_encode([ - "status" => "failure", - "message" => "User not found" - ]); -} - -$stmt = null; // Close the statement -$con = null; // Close the connection -exit(); // Ensure no further output \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/sms_webhook/archive.zip b/walletintaleq.intaleq.xyz/v2/main/sms_webhook/archive.zip deleted file mode 100755 index fc138a6..0000000 Binary files a/walletintaleq.intaleq.xyz/v2/main/sms_webhook/archive.zip and /dev/null differ diff --git a/walletintaleq.intaleq.xyz/v2/main/sms_webhook/check_invoice_status.php b/walletintaleq.intaleq.xyz/v2/main/sms_webhook/check_invoice_status.php deleted file mode 100755 index 4c06ab1..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/sms_webhook/check_invoice_status.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php -//check_invoice_status.php -// تضمين ملف الاتصال والإعدادات الخاص بك -// يفترض أن هذا الملف يقوم بالاتصال بقاعدة البيانات ($con) -include "../connect.php"; - -// --- 1. استقبال البيانات من تطبيق فلاتر --- -$invoice_number = filterRequest("invoice_number"); - -// التحقق من أن رقم القسيمة قد تم إرساله -if (empty($invoice_number)) { - printFailure("invoice_number is required."); - exit(); -} - -// --- 2. البحث عن الفاتورة في قاعدة البيانات --- -try { - // إعداد الاستعلام للبحث عن حالة الفاتورة - $sql = "SELECT status FROM `invoices_sms` WHERE invoice_number = :invoice_number LIMIT 1"; - - $stmt = $con->prepare($sql); - $stmt->execute([ - ':invoice_number' => $invoice_number - ]); - - // جلب نتيجة الاستعلام - $invoice = $stmt->fetch(PDO::FETCH_ASSOC); - - if ($invoice) { - // تم العثور على الفاتورة، أرجع حالتها الحالية - echo json_encode([ - "status" => "success", - "invoice_status" => $invoice['status'] // سيكون "pending" أو "completed" - ]); - } else { - // لم يتم العثور على فاتورة بهذا الرقم - printFailure("Invoice not found."); - } - -} catch (PDOException $e) { - // في حال حدوث خطأ في قاعدة البيانات - printFailure("Database error: " . $e->getMessage()); -} -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/sms_webhook/check_invoice_status_passenger.php b/walletintaleq.intaleq.xyz/v2/main/sms_webhook/check_invoice_status_passenger.php deleted file mode 100755 index 7a312ae..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/sms_webhook/check_invoice_status_passenger.php +++ /dev/null @@ -1,36 +0,0 @@ -<?php -// check_invoice_status_passenger.php -header('Content-Type: application/json; charset=utf-8'); - -// تضمين الاتصال بقاعدة البيانات ($con) -include "../connect.php"; - -// 1) استقبال رقم الفاتورة -$invoice_number = filterRequest("invoice_number"); - -// التحقق من المدخلات -if (empty($invoice_number)) { - printFailure("invoice_number is required."); - exit(); -} - -try { - // 2) البحث عن حالة الفاتورة في جدول الركّاب - $sql = "SELECT status FROM `invoices_sms_passenger` WHERE invoice_number = :invoice_number LIMIT 1"; - $stmt = $con->prepare($sql); - $stmt->execute([':invoice_number' => $invoice_number]); - - $invoice = $stmt->fetch(PDO::FETCH_ASSOC); - - if ($invoice) { - echo json_encode([ - "status" => "success", - "invoice_status" => $invoice['status'] // "pending" أو "completed" أو "failed" - ]); - } else { - printFailure("Invoice not found."); - } - -} catch (PDOException $e) { - printFailure("Database error: " . $e->getMessage()); -} \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/sms_webhook/create_invoice.php b/walletintaleq.intaleq.xyz/v2/main/sms_webhook/create_invoice.php deleted file mode 100755 index db3d816..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/sms_webhook/create_invoice.php +++ /dev/null @@ -1,103 +0,0 @@ -<?php -// create_invoice.php - -// --- بداية التسجيل: تأكيد بدء تشغيل السكربت --- -//error_log("[CreateInvoice] --- Request Started ---"); - -// تضمين ملف الاتصال والإعدادات الخاص بك -// تأكد من أن هذا الملف لا يحتوي على أخطاء قد تسبب مشكلة Parse -include "../connect.php"; -//error_log("[CreateInvoice] Included 'connect.php'"); - -try { - // --- 1. تسجيل واستقبال المدخلات --- - // تسجيل البيانات الخام القادمة من الطلب لمعرفة ما يصل بالضبط - // error_log("[CreateInvoice] Raw POST data: " . json_encode($_POST)); - - $driverID = filterRequest("driverID"); - $user_phone = filterRequest("user_phone"); - $amount_raw = filterRequest("amount"); - - // تسجيل البيانات بعد الفلترة - //error_log("[CreateInvoice] Filtered Input: driverID={$driverID}, user_phone={$user_phone}, amount_raw={$amount_raw}"); - - // تأكيد المبلغ كرقم - $amount = is_numeric($amount_raw) ? (float) $amount_raw : 0.0; - - // --- 2. التحقق الأساسي من المدخلات --- - if (empty($driverID) || empty($user_phone) || $amount <= 0) { - error_log("[CreateInvoice] Validation Failed: Missing or invalid required parameters."); - printFailure("driverID, user_phone and a valid amount are required."); - exit; - } - // error_log("[CreateInvoice] Input validation passed."); - - // --- 3. التحقق من وجود فاتورة معلقة --- - // error_log("[CreateInvoice] Checking for existing pending invoice for driverID: {$driverID}"); - $sql_check = "SELECT id, invoice_number FROM invoices_sms WHERE driverID = :driverID AND user_phone = :user_phone AND status = 'pending' ORDER BY created_at DESC LIMIT 1"; - $stmt_check = $con->prepare($sql_check); - $stmt_check->execute(['driverID' => $driverID, 'user_phone' => $user_phone]); - $existing = $stmt_check->fetch(PDO::FETCH_ASSOC); - - // إنشاء رقم فاتورة جديد ومميز - $new_invoice_number = random_int(100000, 999999); - - if ($existing) { - // --- 4a. تحديث الفاتورة المعلقة الحالية --- - // error_log("[CreateInvoice] Found existing pending invoice (ID: {$existing['id']}). Updating it."); - - $sql_update = "UPDATE invoices_sms SET invoice_number = :invoice_number, amount = :amount, created_at = NOW() WHERE id = :id"; - $stmt_update = $con->prepare($sql_update); - $stmt_update->execute([ - ':invoice_number' => $new_invoice_number, - ':amount' => $amount, - ':id' => $existing['id'] - ]); - - // error_log("[CreateInvoice] Invoice updated. New invoice number: {$new_invoice_number}"); - echo json_encode([ - "status" => "success", - "message" => "Pending invoice updated.", - "invoice_number" => $new_invoice_number - ]); - - } else { - // --- 4b. إنشاء فاتورة جديدة --- - // error_log("[CreateInvoice] No pending invoice found. Creating a new one."); - - $sql_insert = "INSERT INTO invoices_sms (invoice_number, driverID, user_phone, amount, status) VALUES (:invoice_number, :driverID, :user_phone, :amount, 'pending')"; - $stmt_insert = $con->prepare($sql_insert); - $ok = $stmt_insert->execute([ - ':invoice_number' => $new_invoice_number, - ':driverID' => $driverID, - ':user_phone' => $user_phone, - ':amount' => $amount - ]); - - if ($ok) { - // error_log("[CreateInvoice] New invoice created successfully. Invoice number: {$new_invoice_number}"); - echo json_encode([ - "status" => "success", - "message" => "New invoice created.", - "invoice_number" => $new_invoice_number - ]); - } else { - // error_log("[CreateInvoice] CRITICAL: Failed to execute INSERT statement."); - printFailure("Failed to create invoice."); - } - } - -} catch (PDOException $e) { - // تسجيل أخطاء قاعدة البيانات - // error_log("[CreateInvoice] PDOException: " . $e->getMessage()); - printFailure("Database error: " . $e->getMessage()); - -} catch (Throwable $e) { - // تسجيل أي أخطاء أخرى غير متوقعة - // error_log("[CreateInvoice] Throwable Exception: " . $e->getMessage()); - printFailure("An unexpected server error occurred."); -} - -//error_log("[CreateInvoice] --- Request Ended ---"); -?> - diff --git a/walletintaleq.intaleq.xyz/v2/main/sms_webhook/create_invoice_passenger.php b/walletintaleq.intaleq.xyz/v2/main/sms_webhook/create_invoice_passenger.php deleted file mode 100755 index 93021b1..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/sms_webhook/create_invoice_passenger.php +++ /dev/null @@ -1,126 +0,0 @@ -<?php -// create_invoice_passenger.php - -header('Content-Type: application/json; charset=utf-8'); - -// ------------------------------------- -// تضمين الاتصال -// ------------------------------------- -include "../connect.php"; -error_log("[CreateInvoicePassenger] Included 'connect.php'"); - -error_log("[CreateInvoicePassenger] --- Request Started ---"); - -try { - // ------------------------------------- - // 1) قراءة المدخلات - // ------------------------------------- - $passengerID = filterRequest("passengerID"); - $user_phone = filterRequest("user_phone"); - $amount_raw = filterRequest("amount"); - error_log("[CreateInvoicePassenger] Read inputs (passengerID, user_phone, amount)"); - - // ------------------------------------- - // 2) تحويل/التحقق من المبلغ - // ------------------------------------- - $amount = is_numeric($amount_raw) ? (float)$amount_raw : 0.0; - if (empty($passengerID) || empty($user_phone) || $amount <= 0) { - error_log("[CreateInvoicePassenger] Validation failed: missing/invalid parameters"); - printFailure("passengerID, user_phone and a valid amount are required."); - exit; - } - error_log("[CreateInvoicePassenger] Input validation passed"); - - // ------------------------------------- - // 3) التحقق من وجود فاتورة معلّقة لنفس الراكب ونفس الهاتف - // ------------------------------------- - $sql_check = " - SELECT id, invoice_number - FROM invoices_sms_passenger - WHERE passengerID = :passengerID - AND user_phone = :user_phone - AND status = 'pending' - ORDER BY created_at DESC - LIMIT 1 - "; - $stmt_check = $con->prepare($sql_check); - $stmt_check->execute([ - 'passengerID' => $passengerID, - 'user_phone' => $user_phone - ]); - $existing = $stmt_check->fetch(PDO::FETCH_ASSOC); - error_log("[CreateInvoicePassenger] Checked for existing pending invoice"); - - // ------------------------------------- - // 4) توليد رقم فاتورة جديد (6 أرقام) - // ------------------------------------- - $new_invoice_number = random_int(100000, 999999); - error_log("[CreateInvoicePassenger] Generated invoice number"); - - if ($existing) { - // ------------------------------------- - // 4a) تحديث الفاتورة المعلّقة الحالية - // ------------------------------------- - error_log("[CreateInvoicePassenger] Existing pending invoice found. Updating..."); - $sql_update = " - UPDATE invoices_sms_passenger - SET invoice_number = :invoice_number, - amount = :amount, - created_at = NOW() - WHERE id = :id - "; - $stmt_update = $con->prepare($sql_update); - $stmt_update->execute([ - ':invoice_number' => $new_invoice_number, - ':amount' => $amount, - ':id' => $existing['id'] - ]); - error_log("[CreateInvoicePassenger] Invoice updated successfully"); - - echo json_encode([ - "status" => "success", - "message" => "Pending passenger invoice updated.", - "invoice_number" => $new_invoice_number - ]); - error_log("[CreateInvoicePassenger] Response sent (update)"); - } else { - // ------------------------------------- - // 4b) إنشاء فاتورة جديدة - // ------------------------------------- - error_log("[CreateInvoicePassenger] No existing invoice. Creating new one..."); - $sql_insert = " - INSERT INTO invoices_sms_passenger (invoice_number, passengerID, user_phone, amount, status) - VALUES (:invoice_number, :passengerID, :user_phone, :amount, 'pending') - "; - $stmt_insert = $con->prepare($sql_insert); - $ok = $stmt_insert->execute([ - ':invoice_number' => $new_invoice_number, - ':passengerID' => $passengerID, - ':user_phone' => $user_phone, - ':amount' => $amount - ]); - - if ($ok) { - error_log("[CreateInvoicePassenger] New invoice created successfully"); - echo json_encode([ - "status" => "success", - "message" => "New passenger invoice created.", - "invoice_number" => $new_invoice_number - ]); - error_log("[CreateInvoicePassenger] Response sent (insert)"); - } else { - error_log("[CreateInvoicePassenger] Failed to create passenger invoice (DB insert)"); - printFailure("Failed to create passenger invoice."); - } - } - -} catch (PDOException $e) { - error_log("[CreateInvoicePassenger] Database exception: " . $e->getMessage()); - printFailure("Database error: " . $e->getMessage()); - -} catch (Throwable $e) { - error_log("[CreateInvoicePassenger] Unexpected exception: " . $e->getMessage()); - printFailure("An unexpected server error occurred."); -} - -error_log("[CreateInvoicePassenger] --- Request Ended ---"); \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/sms_webhook/finalize_payout.php b/walletintaleq.intaleq.xyz/v2/main/sms_webhook/finalize_payout.php deleted file mode 100755 index 136c40f..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/sms_webhook/finalize_payout.php +++ /dev/null @@ -1,127 +0,0 @@ -<?php -// finalize_payout.php - -if (!function_exists('logPayoutError')) { - /** - * دالة مخصصة لتسجيل الأخطاء والخطوات في ملف سجل خاص بعمليات السحب. - */ - function logPayoutError($step, $message, $data = null) { - $logFile = __DIR__ . "/../logs/payout_finalization.log"; - $logDir = dirname($logFile); - if (!is_dir($logDir)) { mkdir($logDir, 0755, true); } - $logEntry = "[" . date('Y-m-d H:i:s') . "] STEP {$step}: {$message}"; - if ($data !== null) { $logEntry .= " | Data: " . json_encode($data, JSON_UNESCAPED_UNICODE); } - file_put_contents($logFile, $logEntry . PHP_EOL, FILE_APPEND); - } -} - -if (!function_exists('generateToken')) { - /** - * دالة لإنشاء توكن دفع فريد وحفظه في قاعدة البيانات. - */ - function generateToken(PDO $con, $driverId, $amount): ?string { - global $secretKey; - $data = $driverId . $amount . time() . ($secretKey ?? 'default_secret_for_token'); - $hash = hash('sha256', $data); - $randomBytes = bin2hex(random_bytes(16)); - $token = substr($hash . $randomBytes, 0, 64); - - $stmt = $con->prepare("INSERT INTO payment_tokens (token, driverID, dateCreated, amount) VALUES (:token, :driverID, NOW(), :amount)"); - $stmt->execute([':token' => $token, ':driverID' => $driverId, ':amount' => $amount]); - - return $stmt->rowCount() > 0 ? $token : null; - } -} - -if (!function_exists('generatePaymentID')) { - /** - * دالة لإنشاء سجل دفعة جديد وإرجاع الـ ID الخاص به. - * هذا السجل هو المرجع الأساسي للمعاملة. - */ - function generatePaymentID(PDO $con, $driverId, $amount, $method): ?string { - $stmt = $con->prepare("INSERT INTO paymentsDriverPoints (`amount`, `payment_method`, `driverID`) VALUES (:amount, :method, :driverID)"); - $stmt->execute([':driverID' => $driverId, ':amount' => $amount, ':method' => $method]); - - return $stmt->rowCount() > 0 ? $con->lastInsertId() : null; - } -} - - -if (!function_exists('finalizePayout')) { - /** - * دالة الإتمام الرئيسية لعمليات السحب. - * تقوم بتسجيل كل المعاملات في محافظ السائق والشركة وتحديث حالة الدفعات. - */ - function finalizePayout(PDO $con, int $payoutId) { - logPayoutError("START", "Starting finalization for payout ID: {$payoutId}"); - - try { - // 1. جلب بيانات طلب السحب المكتمل - $stmt = $con->prepare("SELECT * FROM `payout_requests` WHERE id = :id AND status = 'completed' LIMIT 1"); - $stmt->execute([':id' => $payoutId]); - $payout = $stmt->fetch(PDO::FETCH_ASSOC); - - if (!$payout) { - logPayoutError("FETCH_PAYOUT", "Payout request not found or not completed.", ['payoutId' => $payoutId]); - return false; - } - - $driverId = $payout['driver_id']; - $payoutFee = 3500; - $netAmount = (float)$payout['amount']-$payoutFee; // المبلغ الصافي الذي طلبه السائق - $totalDeducted = $netAmount; // المبلغ الإجمالي الذي سيتم خصمه - - // 2. إنشاء معرف دفع رئيسي لهذه المعاملة - // نسجل المبلغ الإجمالي المخصوم بالسالب - $paymentID = generatePaymentID($con, $driverId, -$totalDeducted, 'payout'); - if (!$paymentID) throw new Exception('Failed to generate master payment ID'); - logPayoutError("GEN_PAYMENT_ID", "Master Payment ID created: {$paymentID}"); - - // 3. إنشاء التوكنات اللازمة - $tokenDriver = generateToken($con, $driverId, -$totalDeducted); - $tokenSefer = generateToken($con, $driverId, $payoutFee); - if (!$tokenDriver || !$tokenSefer) throw new Exception('Failed to generate required tokens'); - logPayoutError("GEN_TOKENS", "Driver and Sefer tokens generated successfully."); - - // 4. تسجيل معاملة الخصم في محفظة السائق (driverWallet) - $insertDriver = $con->prepare("INSERT INTO driverWallet (driverID, paymentID, amount, paymentMethod) VALUES (:driverID, :paymentID, :amount, :paymentMethod)"); - $insertDriver->execute([ - ':driverID' => $driverId, - ':paymentID' => $paymentID, - ':amount' => -$totalDeducted, // تسجيل المبلغ بالسالب - ':paymentMethod' => 'payout' - ]); - if ($insertDriver->rowCount() === 0) throw new Exception('Insert to driverWallet failed'); - $con->prepare("UPDATE payment_tokens SET isUsed = TRUE WHERE token = :token")->execute([':token' => $tokenDriver]); - logPayoutError("DRIVER_WALLET", "Negative transaction of {$totalDeducted} recorded in driverWallet."); - - // 5. تسجيل معاملة الربح (العمولة) في محفظة الشركة (seferWallet) - $insertSefer = $con->prepare("INSERT INTO seferWallet (driverId, passengerId, amount, paymentMethod, token) VALUES (:driverId, :passengerId, :amount, :paymentMethod, :token)"); - $insertSefer->execute([ - ':driverId' => $driverId, - ':passengerId' => 'payout_fee', // تمييز المعاملة كعمولة سحب - ':amount' => $payoutFee, // تسجيل العمولة بالموجب - ':paymentMethod' => 'payout_fee', - ':token' => $tokenSefer - ]); - if ($insertSefer->rowCount() === 0) throw new Exception('Insert to seferWallet failed'); - $con->prepare("UPDATE payment_tokens SET isUsed = TRUE WHERE token = :token")->execute([':token' => $tokenSefer]); - logPayoutError("SEFER_WALLET", "Fee transaction of {$payoutFee} recorded in seferWallet."); - - // 6. تحديث حالة الدفعات التي تم سحبها في جدول 'payments' - // هذا السطر يقوم بتحديث كل الدفعات المعلقة للسائق، معتبراً أن عملية السحب تغطيها - $updatePayments = $con->prepare("UPDATE payments SET isGiven = TRUE WHERE driverID = :driverId AND isGiven = FALSE"); - $updatePayments->execute([':driverId' => $driverId]); - logPayoutError("UPDATE_PAYMENTS", "Marked pending payments as 'isGiven' for driver {$driverId}. Rows affected: " . $updatePayments->rowCount()); - - logPayoutError("SUCCESS", "Payout finalization completed successfully for payout ID: {$payoutId}"); - return true; - - } catch (Throwable $e) { - logPayoutError("EXCEPTION", "An exception occurred: " . $e->getMessage(), ['payoutId' => $payoutId]); - return false; - } - } -} -?> - diff --git a/walletintaleq.intaleq.xyz/v2/main/sms_webhook/finalize_wallet_payment.php b/walletintaleq.intaleq.xyz/v2/main/sms_webhook/finalize_wallet_payment.php deleted file mode 100755 index 983dc9b..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/sms_webhook/finalize_wallet_payment.php +++ /dev/null @@ -1,112 +0,0 @@ -<?php -// wallet/finalize_wallet_payment.php - -// لم نعد بحاجة لـ jwtconnect.php هنا لأن الاتصال يتم تمريره من السكربت الرئيسي - -if (!function_exists('logError')) { - function logError($step, $message, $data = null) { - $logFile = __DIR__ . "/../logs/finalization.log"; - $logDir = dirname($logFile); - if (!is_dir($logDir)) { mkdir($logDir, 0755, true); } - $logEntry = "[" . date('Y-m-d H:i:s') . "] STEP {$step}: {$message}"; - if ($data !== null) { $logEntry .= " | Data: " . json_encode($data, JSON_UNESCAPED_UNICODE); } - file_put_contents($logFile, $logEntry . PHP_EOL, FILE_APPEND); - } -} - - -/** - * دالة لإنشاء توكن دفع فريد وحفظه في قاعدة البيانات. - */ -function generateToken($con, $driverId, $amount): ?string { - // افترض أن secretKey تم تعريفه في ملف connect.php - global $secretKey; - $data = $driverId . $amount . time() . ($secretKey ?? 'default_secret_for_token'); - $hash = hash('sha256', $data); - $randomBytes = bin2hex(random_bytes(16)); - $token = substr($hash . $randomBytes, 0, 64); - - $stmt = $con->prepare("INSERT INTO payment_tokens (token, driverID, dateCreated, amount) VALUES (:token, :driverID, NOW(), :amount)"); - $stmt->execute([':token' => $token, ':driverID' => $driverId, ':amount' => $amount]); - - return $stmt->rowCount() > 0 ? $token : null; -} - -/** - * دالة لإنشاء سجل دفعة جديد وإرجاع الـ ID الخاص به. - */ -function generatePaymentID($con, $driverId, $amount, $method): ?string { - $stmt = $con->prepare("INSERT INTO paymentsDriverPoints (`amount`, `payment_method`, `driverID`) VALUES (:amount, :method, :driverID)"); - $stmt->execute([':driverID' => $driverId, ':amount' => $amount, ':method' => $method]); - - return $stmt->rowCount() > 0 ? $con->lastInsertId() : null; -} - -/** - * دالة الإتمام الرئيسية، تم تعديلها لتستقبل ID الفاتورة مباشرة - */ -function finalizeWalletPaymentByInvoice($con, $invoiceId) { - logError("FINALIZE", "Starting finalization for invoice ID: {$invoiceId}"); - - try { - // 1. جلب بيانات الفاتورة المكتملة - $stmt = $con->prepare("SELECT * FROM `invoices_sms` WHERE id = :id AND status = 'completed' LIMIT 1"); - $stmt->execute([':id' => $invoiceId]); - $invoice = $stmt->fetch(PDO::FETCH_ASSOC); - - if (!$invoice) { - logError("FINALIZE", "Invoice not found or not completed", ['invoiceId' => $invoiceId]); - return false; - } - - $driverId = $invoice['driverID']; - $originalAmount = floatval($invoice['amount']); - $paymentMethod = $invoice['sender'] ?? 'sms'; - - // حساب المكافأة - $bonusAmount = match ((int)$originalAmount) { - 10000 => 10000.0, - 20000 => 21000.0, - 40000 => 45000.0, - 100000 => 110000.0, - default => $originalAmount, - }; - - // إنشاء التوكنات ومعرف الدفع - $tokenDriver = generateToken($con, $driverId, $bonusAmount); - $tokenSefer = generateToken($con, $driverId, $originalAmount); - $paymentID = generatePaymentID($con, $driverId, $bonusAmount, $paymentMethod); - - if (!$tokenDriver || !$tokenSefer || !$paymentID) { - throw new Exception('Failed to generate required tokens or payment ID'); - } - - // --- تحديث المحافظ --- - - // driverWallet - $insertDriver = $con->prepare("INSERT INTO driverWallet (driverID, paymentID, amount, paymentMethod) VALUES (:driverID, :paymentID, :amount, :paymentMethod)"); - $insertDriver->execute([ - ':driverID' => $driverId, ':paymentID' => $paymentID, - ':amount' => $bonusAmount, ':paymentMethod' => $paymentMethod - ]); - if ($insertDriver->rowCount() === 0) throw new Exception('Insert to driverWallet failed'); - $con->prepare("UPDATE payment_tokens SET isUsed = TRUE WHERE token = :token")->execute([':token' => $tokenDriver]); - - // seferWallet - $insertSefer = $con->prepare("INSERT INTO seferWallet (driverId, passengerId, amount, paymentMethod, token) VALUES (:driverId, 'driver', :amount, :paymentMethod, :token)"); - $insertSefer->execute([ - ':driverId' => $driverId, ':amount' => $originalAmount, - ':paymentMethod' => $paymentMethod, ':token' => $tokenSefer - ]); - if ($insertSefer->rowCount() === 0) throw new Exception('Insert to seferWallet failed'); - $con->prepare("UPDATE payment_tokens SET isUsed = TRUE WHERE token = :token")->execute([':token' => $tokenSefer]); - - logError("FINALIZE", "SUCCESS: Wallets updated successfully for invoice ID: {$invoiceId}"); - return true; - - } catch (Throwable $e) { - logError("FINALIZE", "EXCEPTION: " . $e->getMessage(), ['invoiceId' => $invoiceId]); - return false; - } -} -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/sms_webhook/process_passenger_sms_payment.php b/walletintaleq.intaleq.xyz/v2/main/sms_webhook/process_passenger_sms_payment.php deleted file mode 100755 index b758068..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/sms_webhook/process_passenger_sms_payment.php +++ /dev/null @@ -1,255 +0,0 @@ -<?php -/** - * process_passenger_sms_payment.php - * - يستخدم BASE_URL الموجودة مسبقًا (لا يُعرّف بديل). - * - يستخدم Gemini 2.5 Flash Lite. - * - لا يحدّث raw_sms_log الآن (لا mark processed/failed). - * - الدفع للراكب فقط: invoices_sms_passenger → bonus → generate token → add to wallets. - */ - -header('Content-Type: application/json; charset=utf-8'); - -include_once __DIR__ . '/../../connect.php'; - -if (!defined('BASE_URL')) { - $APP_BASE_URL = rtrim(getenv('APP_BASE_URL') ?: '', '/'); - if ($APP_BASE_URL === '') { - $scheme = isset($_SERVER['REQUEST_SCHEME']) ? $_SERVER['REQUEST_SCHEME'] : 'https'; - $host = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : 'localhost'; - define('BASE_URL', $scheme . '://' . $host); - } else { - define('BASE_URL', $APP_BASE_URL); - } -} - -/* ===== Gemini: Flash Lite ===== */ -$geminiModel = 'gemini-2.5-flash-lite'; -$geminiApiKey = getenv('GEMINI_API_KEY'); -if (!$geminiApiKey) { - printFailure("Missing GEMINI_API_KEY"); - exit; -} -$geminiApiUrl = "https://generativelanguage.googleapis.com/v1beta/models/{$geminiModel}:generateContent?key={$geminiApiKey}"; - -/* ===== اجلب رسالة واحدة pending (مع sender) ===== */ -try { - $stmt = $con->prepare(" - SELECT id, message_body, sender - FROM raw_sms_log - WHERE status = 'pending' - ORDER BY created_at ASC - LIMIT 1 - "); - $stmt->execute(); - $sms = $stmt->fetch(PDO::FETCH_ASSOC); - if (!$sms) { - echo json_encode(["status" => "idle", "message" => "No pending messages"]); - exit; - } -} catch (PDOException $e) { - printFailure("DB fetch error: " . $e->getMessage()); - exit; -} - -$smsId = (int)$sms['id']; -$body = (string)$sms['message_body']; -$sender = (string)$sms['sender']; // نستخدمه لاشتقاق طريقة الدفع - -/* ===== Prompt لِـ Gemini ===== */ -$prompt = "Analyze the following financial SMS and return ONLY a valid JSON object: -{ - \"transaction_type\": \"income\" | \"payout\", - \"amount\": number, - \"currency\": \"SYP\" | string (3 letters), - \"phone_number\": string | null -} -SMS Text: \"$body\""; - -$payload = ['contents' => [['parts' => [['text' => $prompt]]]]]; - -$ch = curl_init($geminiApiUrl); -curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); -curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); -curl_setopt($ch, CURLOPT_POST, true); -curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload, JSON_UNESCAPED_UNICODE)); -$response = curl_exec($ch); -$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); -$curlErr = curl_error($ch); -curl_close($ch); - -if ($response === false) { - printFailure("Gemini curl error: " . $curlErr); - exit; -} - -$gem = json_decode($response, true); -$gemText = $gem['candidates'][0]['content']['parts'][0]['text'] ?? null; -if ($httpCode !== 200 || !$gemText) { - printFailure("Gemini HTTP $httpCode / empty response"); - exit; -} - -/* Gemini أحيانًا يحيط الـ JSON بعلامات Markdown */ -$clean = trim(str_replace(['```json','```JSON','```'], '', $gemText)); -$data = json_decode($clean, true); -if (!is_array($data) || empty($data['transaction_type'])) { - printFailure("Failed to parse Gemini JSON"); - exit; -} - -/* ===== القيم المستخرجة ===== */ -$trxType = strtolower((string)$data['transaction_type']); -$amount = isset($data['amount']) ? floatval($data['amount']) : 0.0; -$currency = isset($data['currency']) ? strtoupper((string)$data['currency']) : ''; -$phone = isset($data['phone_number']) ? (string)$data['phone_number'] : ''; - -/* ===== طريقة الدفع من الـ sender (الآن ثابتة shamcash كما طلبت) ===== */ -$paymentMethod = 'shamcash'; // أو اشتقاق ذكي: strpos(strtolower($sender),'sham') !== false ? 'shamcash' : 'unknown'; - -/* ===== فقط INCOME: نفّذ تدفّق الراكب ===== */ -if ($trxType === 'income' && $amount > 0 && $phone !== '') { - try { - // ابحث عن فاتورة راكب حديثة متطابقة خلال 60 دقيقة - $q = $con->prepare(" - SELECT id - FROM invoices_sms_passenger - WHERE status='pending' - AND user_phone = :p - AND amount = :a - AND created_at >= (NOW() - INTERVAL 60 MINUTE) - ORDER BY created_at DESC - LIMIT 1 - "); - $q->execute([':p' => $phone, ':a' => $amount]); - $inv = $q->fetch(PDO::FETCH_ASSOC); - - if (!$inv) { - printFailure( "No matching passenger invoice"); - exit; - } - - $invoiceId = $inv['id']; - - // حدّث حالة الفاتورة - $con->prepare("UPDATE invoices_sms_passenger SET status='completed', updated_at=NOW() WHERE id=:id") - ->execute([':id' => $invoiceId]); - - // احضر بيانات الفاتورة لمعرفة passengerID والمبلغ المؤكد - $st = $con->prepare("SELECT passengerID, amount FROM invoices_sms_passenger WHERE id=:id LIMIT 1"); - $st->execute([':id' => $invoiceId]); - $row = $st->fetch(PDO::FETCH_ASSOC); - if (!$row) { - printFailure("Invoice row not found after update"); - exit; - } - - $passengerId = $row['passengerID']; - $amt = floatval($row['amount']); - - // 1) Bonus - $finalAmount = calculateBonus($amt); - - // 2) Generate payment token (للراكب) - $token = generatePaymentToken($passengerId, $finalAmount); - - // 3) Add to Passenger Wallet - $walletResult = addToPassengerWallet($passengerId, $finalAmount, $token); - - // 4) Add to Sefer Wallet (محاسبي) بطريقة الدفع المستخلصة من sender - $token2 = generatePaymentToken($passengerId, $amt); - $seferWalletResult = addToSeferWallet($passengerId, $amt, $paymentMethod, $token2); - - printSuccess([ - "message" => "Passenger income processed", - "invoice_id" => $invoiceId, - "passenger_id" => $passengerId, - "amount" => $amt, - "final_amount" => $finalAmount, - "payment_method" => $paymentMethod, - "wallet" => $walletResult, - "seferWallet" => $seferWalletResult, - "sender" => $sender - ]); - exit; - - } catch (PDOException $e) { - printFailure("DB income error: " . $e->getMessage()); - exit; - } -} - -/* غير مدعوم الآن (payout أو مدخلات ناقصة) */ -printFailure([ - "status" => "ignored", - "message" => "Unsupported or incomplete transaction", - "type" => $trxType, - "sender" => $sender -]); -exit; - -/* ===== Helpers — تعتمد على BASE_URL الموجودة عندك ===== */ - -function calculateBonus($amount) { - if ($amount == 20000) return 20500; - if ($amount == 40000) return 42500; - if ($amount == 100000) return 104000; - return $amount; -} - -function generatePaymentToken($passengerId, $amount) { - if (!defined('BASE_URL')) return null; // نعتمد وجودها لديك - $url = rtrim(BASE_URL, '/') . "/passengerWallet/addPaymentTokenPassenger.php"; - $post = ['passengerId' => $passengerId, 'amount' => $amount]; - - $ch = curl_init($url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post)); - $resp = curl_exec($ch); - $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); - curl_close($ch); - - if ($code != 200 || !$resp) return null; - $j = json_decode($resp, true); - return $j['message'] ?? null; -} - -function addToPassengerWallet($passengerId, $amount, $token) { - if (!defined('BASE_URL')) return null; - $url = rtrim(BASE_URL, '/') . "/passengerWallet/add.php"; - $post = ['passenger_id' => $passengerId, 'balance' => $amount, 'token' => $token]; - - $ch = curl_init($url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post)); - $resp = curl_exec($ch); - $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); - curl_close($ch); - - if ($code != 200 || !$resp) return null; - return json_decode($resp, true); -} - -function addToSeferWallet($passengerId, $amount, $paymentMethod, $token) { - if (!defined('BASE_URL')) return null; - $url = rtrim(BASE_URL, '/') . "/seferWallet/add.php"; - $post = [ - 'amount' => $amount, - 'paymentMethod' => $paymentMethod, // من sender - 'passengerId' => $passengerId, - 'token' => $token, - 'driverId' => 'passenger' - ]; - - $ch = curl_init($url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post)); - $resp = curl_exec($ch); - $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); - curl_close($ch); - - if ($code != 200 || !$resp) return null; - return json_decode($resp, true); -} \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/sms_webhook/process_with_gemini.php b/walletintaleq.intaleq.xyz/v2/main/sms_webhook/process_with_gemini.php deleted file mode 100755 index 99365b5..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/sms_webhook/process_with_gemini.php +++ /dev/null @@ -1,132 +0,0 @@ -<?php -// تأكد من أن هذا السكربت لا يمكن الوصول إليه مباشرة من الويب (للحماية) -// يمكنك وضع ملف .htaccess في المجلد لمنع الوصول المباشر - -// المسار الصحيح لملف الاتصال -// هذه الطريقة تضمن أن المسار صحيح دائمًا بغض النظر عن كيفية استدعاء السكربت -include_once __DIR__ . '/../../connect.php'; - -// يمكنك هنا تضمين أي ملفات مساعدة أخرى -// استخدام __DIR__ هنا أيضًا يضمن إيجاد الملف في نفس المجلد الحالي -include_once __DIR__ . '/finalize_wallet_payment.php'; -// --- إعدادات Gemini API --- -// من الأفضل قراءة مفتاح API من متغيرات البيئة لزيادة الأمان -$geminiApiKey = getenv('GEMINI_API_KEY'); - -$geminiApiUrl = "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.5-flash-preview-05-20:generateContent?key=" . $geminiApiKey; - -// 1. جلب رسالة واحدة بحالة "pending" لمعالجتها -$stmt_fetch = $con->prepare("SELECT id, message_body FROM `raw_sms_log` WHERE `status` = 'pending' ORDER BY created_at ASC LIMIT 1"); -$stmt_fetch->execute(); -$sms = $stmt_fetch->fetch(PDO::FETCH_ASSOC); - -if (!$sms) { - exit("No pending messages found.\n"); -} - -$sms_id = $sms['id']; -$sms_text = $sms['message_body']; - -// 2. بناء الطلب (Prompt) الذكي إلى Gemini -$prompt = "Analyze the following financial SMS and return ONLY a valid JSON object. -- `transaction_type`: Must be 'income' (money received) or 'payout' (money sent). -- `amount`: Must be a number (float). -- `currency`: Must be a 3-letter code (e.g., SYP). -- `phone_number`: The phone number of the other party. Must be a string, or `null` if not found. - -SMS Text: \"$sms_text\""; - -$payload = ['contents' => [['parts' => [['text' => $prompt]]]]]; - -// 3. إرسال الطلب إلى Gemini API -$ch = curl_init($geminiApiUrl); -curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); -curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); -curl_setopt($ch, CURLOPT_POST, true); -curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload)); -$response = curl_exec($ch); -$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); -curl_close($ch); - -// 4. معالجة رد Gemini -$result = json_decode($response, true); -$gemini_text_response = $result['candidates'][0]['content']['parts'][0]['text'] ?? null; - -if ($httpcode == 200 && $gemini_text_response) { - $clean_json_str = trim(str_replace(['```json', '```'], '', $gemini_text_response)); - $data = json_decode($clean_json_str, true); - - if ($data && isset($data['transaction_type'])) { - // --- نجحت المعالجة: استخراج البيانات --- - $phone_raw = $data['phone_number'] ?? null; - $amount = isset($data['amount']) ? (float)$data['amount'] : 0; - - // توحيد صيغة رقم الهاتف (مثال بسيط) - $phone_norm = $phone_raw; // يمكنك إضافة منطق أكثر تعقيداً هنا إذا لزم الأمر - - if ($data['transaction_type'] === 'income' && !empty($phone_norm) && $amount > 0) { - // البحث عن فاتورة مطابقة خلال آخر 60 دقيقة - $q = $con->prepare("SELECT id FROM invoices_sms WHERE status='pending' AND user_phone=:p AND amount=:a AND created_at >= (NOW() - INTERVAL 60 MINUTE) ORDER BY created_at DESC LIMIT 1"); - $q->execute([':p' => $phone_norm, ':a' => $amount]); - $inv = $q->fetch(PDO::FETCH_ASSOC); - - if ($inv) { - // تم العثور على فاتورة مطابقة -> قم بتحديثها وتنفيذ الإجراء النهائي - $con->prepare("UPDATE invoices_sms SET status='completed' WHERE id=:id")->execute([':id' => $inv['id']]); - - // افترض أن هذه الدالة موجودة في ملف connect.php أو ملف مساعد آخر - $ok = function_exists('finalizeWalletPaymentByInvoice') ? finalizeWalletPaymentByInvoice($con, $inv['id']) : false; - $note = $ok ? 'finalized' : 'finalize_failed'; - - $con->prepare("UPDATE raw_sms_log SET status='processed', gemini_result=:r WHERE id=:id")->execute([':r' => json_encode($data, JSON_UNESCAPED_UNICODE), ':id' => $sms_id]); - echo "Income matched -> invoice {$inv['id']} -> $note\n"; - - } else { - // لم يتم العثور على فاتورة مطابقة - $con->prepare("UPDATE raw_sms_log SET status='failed', gemini_result=:r WHERE id=:id")->execute([':r' => json_encode(['warn' => 'no pending invoice match', 'parsed' => $data], JSON_UNESCAPED_UNICODE), ':id' => $sms_id]); - echo "No matching pending invoice found.\n"; - } - - } elseif ($data['transaction_type'] === 'payout' && !empty($phone_norm) && $amount > 0) { - // --- منطق معالجة الدفعات الصادرة --- - $q = $con->prepare("SELECT id FROM payout_requests WHERE status='pending' AND driver_phone=:p AND amount=:a ORDER BY created_at DESC LIMIT 1"); - $q->execute([':p' => $phone_norm, ':a' => $amount]); - $payout = $q->fetch(PDO::FETCH_ASSOC); - - if ($payout) { - // تم العثور على طلب سحب مطابق -> قم بتحديثه واستدعاء الإتمام - $payout_id = $payout['id']; - $con->prepare("UPDATE payout_requests SET status='completed', completed_at=NOW() WHERE id=:id")->execute([':id' => $payout_id]); - - include_once __DIR__ . '/finalize_payout.php'; - if (function_exists('finalizePayout')) { - finalizePayout($con, $payout_id); - $note = "Payout request {$payout_id} finalized."; - } else { - $note = "CRITICAL: finalizePayout function not found!"; - } - - $con->prepare("UPDATE raw_sms_log SET status='processed', gemini_result=:r WHERE id=:id")->execute([':r'=>json_encode($data), ':id'=>$sms_id]); - error_log("[ProcessGemini] $note"); - - } else { - // لم يتم العثور على طلب سحب مطابق - $con->prepare("UPDATE raw_sms_log SET status='failed', gemini_result=:r WHERE id=:id")->execute([':r'=>json_encode(['warn'=>'no pending payout match', 'parsed'=>$data]), ':id'=>$sms_id]); - error_log("[ProcessGemini] No matching pending payout found for SMS ID {$sms_id}"); - } -} - - } else { - // فشل تحليل رد Gemini - $stmt_update = $con->prepare("UPDATE `raw_sms_log` SET `status` = 'failed', `gemini_result` = :result WHERE `id` = :id"); - $stmt_update->execute([':result' => json_encode(['error' => "Failed to parse Gemini's JSON response", 'response' => $gemini_text_response]), ':id' => $sms_id]); - echo "Failed to parse Gemini's JSON response for message ID $sms_id.\n"; - } -} else { - // لم يتم استلام رد من Gemini أو حدث خطأ في الطلب - $stmt_update = $con->prepare("UPDATE `raw_sms_log` SET `status` = 'failed', `gemini_result` = :result WHERE `id` = :id"); - $stmt_update->execute([':result' => json_encode(['error' => 'No valid response from Gemini API', 'http_code' => $httpcode]), ':id' => $sms_id]); - echo "No valid response from Gemini API for message ID $sms_id. HTTP Code: $httpcode\n"; -} -?> - diff --git a/walletintaleq.intaleq.xyz/v2/main/sms_webhook/request_payout.php b/walletintaleq.intaleq.xyz/v2/main/sms_webhook/request_payout.php deleted file mode 100755 index a1c1f1f..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/sms_webhook/request_payout.php +++ /dev/null @@ -1,84 +0,0 @@ -<?php -// request_payout.php -include "../connect.php"; // ملف الاتصال الذي يتحقق من JWT - -error_log("[RequestPayout] --- Request Started ---"); - -// --- 1. استقبال المدخلات --- -$driverId = filterRequest("driverId"); -$amount_raw = filterRequest("amount"); -$wallet_type = filterRequest("wallet_type") ?? 'Sham Cash'; // قيمة افتراضية -$phone = filterRequest("phone"); - -// تأكيد المبلغ كرقم -$amount = is_numeric($amount_raw) ? (float)$amount_raw : 0.0; - -// تحقق أساسي -if (empty($driverId) || $amount <= 0) { - printFailure("driverId and a valid amount are required."); - exit; -} - -try { - // --- 2. التحقق من بيانات السائق ورصيده --- - $stmt_driver = $con->prepare(" - SELECT SUM(amount) AS balance - FROM driverWallet - WHERE driverID = :id - LIMIT 1 - "); - $stmt_driver->execute([':id' => $driverId]); - $driver = $stmt_driver->fetch(PDO::FETCH_ASSOC); - - if (!$driver) { - printFailure("Driver not found."); - exit; - } - - $payout_fee = 3500.00; // عمولة السحب - $total_deduction = $amount + $payout_fee; // المبلغ المطلوب مع العمولة - - if ($driver['balance'] < $total_deduction) { - printFailure("Insufficient balance. Required: $total_deduction"); - exit; - } - - // --- 3. إنشاء طلب السحب في قاعدة البيانات --- - $sql = " - INSERT INTO payout_requests (driver_id, driver_phone, amount, wallet_type) - VALUES (:did, :phone, :amount, :wallet) - "; - $stmt = $con->prepare($sql); - $stmt->execute([ - ':did' => $driverId, - ':phone' => $phone, - ':amount'=> $amount, - ':wallet'=> $wallet_type - ]); - - if ($stmt->rowCount() > 0) { - // --- 4. إرسال إشعار لخدمة العملاء --- - $customerServicePhone = getenv('CUSTOMER_SERVICE_PHONE'); - - $message = - "⚠️ طلب دفع جديد:\n" . - "ID السائق: {$driverId}\n" . - "هاتف السائق: {$phone}\n" . - "نوع المحفظة: {$wallet_type}\n" . - "المبلغ: {$amount} SYP\n\n" . - "الرجاء من فريق خدمة العملاء تنفيذ عملية الدفع الآن."; - - // الإرسال (الفنكشن مُضمّن لديك مسبقًا) - sendWhatsAppFromServer($customerServicePhone, $message); - - error_log("[RequestPayout] Successfully created payout request for driver ID: $driverId"); - printSuccess("Payout request created successfully. It will be processed shortly."); - } else { - printFailure("Failed to create payout request."); - } - -} catch (PDOException $e) { - error_log("[RequestPayout] PDOException: " . $e->getMessage()); - printFailure("A database error occurred."); -} -?> \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/sms_webhook/save_raw_sms.php b/walletintaleq.intaleq.xyz/v2/main/sms_webhook/save_raw_sms.php deleted file mode 100755 index 54f39fd..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/sms_webhook/save_raw_sms.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php -//save_raw_sms.php -// تضمين ملف الاتصال والإعدادات الرئيسي -// تأكد من أن هذا الملف يقوم بالتحقق من صحة JWT و HMAC القادم في الهيدرز -include __DIR__ . "/../connect.php"; - -// استقبال الرسالة الخام من تطبيق الأندرويد -$json_data = file_get_contents('php://input'); -$data = json_decode($json_data, true); - -// التحقق من وجود البيانات المطلوبة -if ($data && isset($data['sender']) && isset($data['message'])) { - try { - // حفظ الرسالة في جدول السجل الخام مع حالة "pending" - $sql = "INSERT INTO `raw_sms_log` (sender, message_body, status) VALUES (:sender, :message, 'pending')"; - $stmt = $con->prepare($sql); - $stmt->execute([':sender' => $data['sender'], ':message' => $data['message']]); - - // --- خطوة مهمة: تفعيل سكربت المعالجة في الخلفية --- - // هذا الأمر يجعل سكربت التحليل يعمل فورًا دون أن ينتظر المستخدم - // تأكد من أن المسار صحيح تمامًا على سيرفرك - $command = "php " . __DIR__ . "/process_with_gemini.php > /dev/null 2>&1 &"; - shell_exec($command); - - http_response_code(200); - echo json_encode(['status' => 'success', 'message' => 'SMS received and scheduled for processing.']); - - } catch (PDOException $e) { - http_response_code(500); - echo json_encode(['status' => 'error', 'message' => 'Database error: ' . $e->getMessage()]); - } -} else { - http_response_code(400); - echo json_encode(['status' => 'error', 'message' => 'Invalid data provided.']); -} -?> - diff --git a/walletintaleq.intaleq.xyz/v2/main/sms_webhook/save_raw_sms_passenger.php b/walletintaleq.intaleq.xyz/v2/main/sms_webhook/save_raw_sms_passenger.php deleted file mode 100755 index cdc3ca0..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/sms_webhook/save_raw_sms_passenger.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php -//save_raw_sms.php -// تضمين ملف الاتصال والإعدادات الرئيسي -// تأكد من أن هذا الملف يقوم بالتحقق من صحة JWT و HMAC القادم في الهيدرز -include __DIR__ . "/../connect.php"; - -// استقبال الرسالة الخام من تطبيق الأندرويد -$json_data = file_get_contents('php://input'); -$data = json_decode($json_data, true); - -// التحقق من وجود البيانات المطلوبة -if ($data && isset($data['sender']) && isset($data['message'])) { - try { - // حفظ الرسالة في جدول السجل الخام مع حالة "pending" - $sql = "INSERT INTO `raw_sms_log` (sender, message_body, status) VALUES (:sender, :message, 'pending')"; - $stmt = $con->prepare($sql); - $stmt->execute([':sender' => $data['sender'], ':message' => $data['message']]); - - // --- خطوة مهمة: تفعيل سكربت المعالجة في الخلفية --- - // هذا الأمر يجعل سكربت التحليل يعمل فورًا دون أن ينتظر المستخدم - // تأكد من أن المسار صحيح تمامًا على سيرفرك - $command = "php " . __DIR__ . "/process_passenger_sms_payment.php > /dev/null 2>&1 &"; - shell_exec($command); - - http_response_code(200); - echo json_encode(['status' => 'success', 'message' => 'SMS received and scheduled for processing.']); - - } catch (PDOException $e) { - http_response_code(500); - echo json_encode(['status' => 'error', 'message' => 'Database error: ' . $e->getMessage()]); - } -} else { - http_response_code(400); - echo json_encode(['status' => 'error', 'message' => 'Invalid data provided.']); -} -?> - diff --git a/walletintaleq.intaleq.xyz/v2/main/sms_webhook/webhook.php b/walletintaleq.intaleq.xyz/v2/main/sms_webhook/webhook.php deleted file mode 100755 index 40e3d7b..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/sms_webhook/webhook.php +++ /dev/null @@ -1,75 +0,0 @@ -<?php -//webhook.php -// تضمين ملف الاتصال الذي يتحقق أيضاً من توكن JWT -include "../connect.php"; - -// --- 1. قراءة البيانات المرسلة --- -$json_data = file_get_contents('php://input'); -$data = json_decode($json_data, true); - -if ($data === null || !isset($data['sender']) || !isset($data['message'])) { - http_response_code(400); // Bad Request - echo json_encode(['status' => 'error', 'message' => 'Invalid JSON data received']); - exit(); -} - -// --- 2. استخراج البيانات --- -$sender = $data['sender']; -$message_body = $data['message']; -$received_at = date('Y-m-d H:i:s'); -$log_entry = "[$received_at] From: $sender | Message: $message_body"; - -// --- 3. تحليل الرسالة (يركز على Orange Money حالياً) --- -$pattern_orangemoney_jo = '/تم استقبال حوالة مالية من (\d+)\s+من مزود الخدمة:\s+Orange Money إلى محفظتك بمبلغ ([\d,.]+)\s+دينار/'; - -if (preg_match($pattern_orangemoney_jo, $message_body, $matches)) { - $payer_phone_raw = $matches[1]; - $amount_str = $matches[2]; - $amount = (float) str_replace(',', '', $amount_str); - - // توحيد صيغة رقم الهاتف (إزالة 0096 إذا وجدت وإضافة 0) - $payer_phone = $payer_phone_raw; - if (substr($payer_phone_raw, 0, 4) === '0096') { - $payer_phone = '0' . substr($payer_phone_raw, 4); - } - - $log_entry .= " | MATCH: Orange Money | SUCCESS: Parsed Amount = $amount, Payer Phone = $payer_phone"; - - // --- 4. منطق تحديث الفاتورة --- - try { - // البحث عن أحدث فاتورة مطابقة (نفس الرقم والمبلغ) بحالة انتظار وتحديثها - $sql = "UPDATE invoices_sms SET status = 'completed' - WHERE user_phone = :phone - AND amount = :amount - AND status = 'pending' - ORDER BY created_at DESC - LIMIT 1"; - - $stmt = $con->prepare($sql); - $stmt->execute([ - ':phone' => $payer_phone, - ':amount' => $amount - ]); - - if ($stmt->rowCount() > 0) { - $log_entry .= " | DB: SUCCESS - Invoice found and updated." . PHP_EOL; - // يمكنك هنا إضافة كود لإرسال إشعار للمستخدم - } else { - $log_entry .= " | DB: WARNING - No pending invoice found for this transaction." . PHP_EOL; - } - - } catch (PDOException $e) { - $log_entry .= " | DB: ERROR - " . $e->getMessage() . PHP_EOL; - } - -} else { - $log_entry .= " | INFO: Message did not match any known payment pattern. Ignored." . PHP_EOL; -} - -// كتابة السجل (مهم لتصحيح الأخطاء) -file_put_contents('sms_log.txt', $log_entry, FILE_APPEND); - -// إرسال رد إلى تطبيق الأندرويد -http_response_code(200); -echo json_encode(['status' => 'success', 'message' => 'Webhook processed.']); -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/stderr.log b/walletintaleq.intaleq.xyz/v2/main/stderr.log deleted file mode 100755 index e69de29..0000000 diff --git a/walletintaleq.intaleq.xyz/v2/main/test.php b/walletintaleq.intaleq.xyz/v2/main/test.php deleted file mode 100755 index 6102be4..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/test.php +++ /dev/null @@ -1,53 +0,0 @@ -<?php - -include "connect.php"; - -$email = filterRequest('email'); -$id = filterRequest('id'); - -// --- Load Secret Key from .env --- -$secretKey = getenv('SECRET_KEY'); - -// --- Generate HMAC Function --- -function generateHmac($id, $secretKey) { - return hash_hmac('sha256', $id, $secretKey); -} - -$sql = "SELECT - *, - phone_verification_passenger.verified -FROM - passengers -LEFT JOIN phone_verification_passenger ON phone_verification_passenger.phone_number = passengers.phone -WHERE - passengers.email = :email AND passengers.id = :id AND phone_verification_passenger.verified = '1' -"; -$stmt = $con->prepare($sql); -$stmt->bindParam(':email', $email); -$stmt->bindParam(':id', $id); -$stmt->execute(); -$data = $stmt->fetchAll(PDO::FETCH_ASSOC); -$count = $stmt->rowCount(); - -header('Content-Type: application/json'); // Ensure the response is JSON - -if ($count > 0) { - // Generate HMAC using passenger ID - $hmac = generateHmac($id, $secretKey); - - echo json_encode([ - "status" => "success", - "count" => $count, - "data" => $data, - "hmac" => $hmac // Add the generated HMAC here - ]); -} else { - echo json_encode([ - "status" => "Failure", - "data" => "User does not exist." - ]); -} - -$stmt = null; // Close the statement -$con = null; // Close the connection -exit(); // Ensure no further output \ No newline at end of file diff --git a/walletintaleq.intaleq.xyz/v2/main/uploadEgypt.php b/walletintaleq.intaleq.xyz/v2/main/uploadEgypt.php deleted file mode 100755 index 6cefd8c..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/uploadEgypt.php +++ /dev/null @@ -1,61 +0,0 @@ -<?php -include "connect.php"; - -// Get the image file from the request. -$image_file = $_FILES['image']; -$driverID = filterRequest("driverID"); -$imageType = filterRequest("imageType"); - -// Define allowed extensions -$allowed_extensions = ['jpg', 'jpeg', 'png']; - -// Get the image file from the request. -$image_file = $_FILES['image']; - -// Check if the image file was uploaded successfully. -if ($image_file['error'] !== UPLOAD_ERR_OK) { - echo "Image upload failed"; - exit; -} - -// Get file information -$image_name = $image_file['name']; -$image_size = $image_file['size']; -$image_extension = strtolower(pathinfo($image_name, PATHINFO_EXTENSION)); - -// Validate file extension -if (!in_array($image_extension, $allowed_extensions)) { - echo "Invalid image format"; - exit; -} - -// Generate a unique filename using timestamp and random string -$new_filename = $imageType . '-'.$driverID . '.' . $image_extension; - -// Set target directory for uploads -$target_dir = "card_image/"; - -// Construct target file path -$target_file = $target_dir . $new_filename; - -// Move the image file to the target location -if (!move_uploaded_file($image_file['tmp_name'], $target_file)) { - echo json_encode(array('status' => "Failed to save image")); ; - exit; -} - -// Store additional information (modify based on your needs) -$image_url = $target_dir . $new_filename; // Update if needed -$image_details = [ - "name" => $image_name, - "size" => $image_size, - "extension" => $image_extension, - "url" => $image_url, -]; - -// Use the image details for further processing (e.g., display, store in database) -// ... - - echo json_encode(array('status' => 'Image uploaded successfully!')); - -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/uploadEgyptIdBack.php b/walletintaleq.intaleq.xyz/v2/main/uploadEgyptIdBack.php deleted file mode 100755 index 9484b89..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/uploadEgyptIdBack.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php -include "../connect.php"; - -// Get the image file from the request. -$image_file = $_FILES['image']; -$driverID = filterRequest("driverID"); - -// Define allowed extensions -$allowed_extensions = ['jpg', 'jpeg', 'png']; - -// Get the image file from the request. -$image_file = $_FILES['image']; - -// Check if the image file was uploaded successfully. -if ($image_file['error'] !== UPLOAD_ERR_OK) { - echo "Image upload failed"; - exit; -} - -// Get file information -$image_name = $image_file['name']; -$image_size = $image_file['size']; -$image_extension = strtolower(pathinfo($image_name, PATHINFO_EXTENSION)); - -// Validate file extension -if (!in_array($image_extension, $allowed_extensions)) { - echo "Invalid image format"; - exit; -} - -// Generate a unique filename using timestamp and random string -$new_filename = $driverID . '.' . $image_extension; - -// Set target directory for uploads -$target_dir = "egypt/IdBack"; - -// Construct target file path -$target_file = $target_dir . $new_filename; - -// Move the image file to the target location -if (!move_uploaded_file($image_file['tmp_name'], $target_file)) { - echo json_encode(array('status' => "Failed to save image")); ; - exit; -} - -// Store additional information (modify based on your needs) -$image_url = $target_dir . $new_filename; // Update if needed -$image_details = [ - "name" => $image_name, - "size" => $image_size, - "extension" => $image_extension, - "url" => $image_url, -]; - -// Use the image details for further processing (e.g., display, store in database) -// ... - - echo json_encode(array('status' => 'Image uploaded successfully!')); - -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/uploadImage.php b/walletintaleq.intaleq.xyz/v2/main/uploadImage.php deleted file mode 100755 index 4cad930..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/uploadImage.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php - -include "connect.php"; - -// Get the image file from the request. -$image_file = $_FILES['image']; -$driverID = filterRequest("driverID"); - -// Check if the image file was uploaded successfully. -if ($image_file['error'] != UPLOAD_ERR_OK) { - echo json_encode(array('status' => 'The image file was not uploaded successfully.')); - exit; -} - -// Get the file name of the image file. -$image_name = $image_file['name']; - -// Get the file extension of the image file. -$image_extension = pathinfo($image_name, PATHINFO_EXTENSION); - -// Check if the image file is a valid image file. -if (!in_array($image_extension, array('jpg', 'jpeg', 'png'))) { - echo json_encode(array('status' => 'The image file is not a valid image file.')); - exit; -} - -// Generate a new filename using the driver ID. -$new_filename = $driverID . '.' . $image_extension; - -// Move the image file to the uploads directory with the new filename. -$target_dir = "card_image/"; -$target_file = $target_dir . $new_filename; -move_uploaded_file($image_file['tmp_name'], $target_file); - -// Update the image name variable with the new filename. -$image_name = $new_filename; - -// Check if the driverID already exists in the database. -$sql = "SELECT * FROM card_images WHERE driverID = '$driverID'"; -$result = mysqli_query($conn, $sql); - -if (mysqli_num_rows($result) > 0) { - // The driverID already exists in the database, so update the upload_date - $uploadDate = date("Y-m-d H:i:s"); - $linkImage = 'https://ride.mobile-app.store/card_image/' . $image_name; - - $updateSQL = "UPDATE card_images SET upload_date = '$uploadDate' WHERE driverID = '$driverID'"; - mysqli_query($conn, $updateSQL); - - if (mysqli_affected_rows($conn) > 0) { - // Print a success message for update - echo json_encode(array('status' => 'Record updated successfully')); - } else { - // Print a failure message for update - echo json_encode(array('status' => 'Failed to update record')); - } -} else { - // The driverID does not exist in the database, so insert a new row. - $linkImage = 'https://ride.mobile-app.store/card_image/' . $image_name; - $insertSQL = "INSERT INTO `card_images`( `driverID`, `image_name`, `link`) VALUES ('$driverID', '$image_name', '$linkImage')"; - mysqli_query($conn, $insertSQL); - - if (mysqli_affected_rows($conn) > 0) { - // Print a success message for insert - echo json_encode(array('status' => 'Record inserted successfully')); - } else { - // Print a failure message for insert - echo json_encode(array('status' => 'Failed to insert record')); - } -} - -mysqli_close($conn); -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/uploadImage1.php b/walletintaleq.intaleq.xyz/v2/main/uploadImage1.php deleted file mode 100755 index 93c6017..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/uploadImage1.php +++ /dev/null @@ -1,60 +0,0 @@ -<?php -include "connect.php"; - -// Get the image file from the request. -$image_file = $_FILES['image']; -$driverID = filterRequest("driverID"); - -// Define allowed extensions -$allowed_extensions = ['jpg', 'jpeg', 'png']; - -// Get the image file from the request. -$image_file = $_FILES['image']; - -// Check if the image file was uploaded successfully. -if ($image_file['error'] !== UPLOAD_ERR_OK) { - echo "Image upload failed"; - exit; -} - -// Get file information -$image_name = $image_file['name']; -$image_size = $image_file['size']; -$image_extension = strtolower(pathinfo($image_name, PATHINFO_EXTENSION)); - -// Validate file extension -if (!in_array($image_extension, $allowed_extensions)) { - echo "Invalid image format"; - exit; -} - -// Generate a unique filename using timestamp and random string -$new_filename = $driverID . '.' . $image_extension; - -// Set target directory for uploads -$target_dir = "portrate_captain_image/"; - -// Construct target file path -$target_file = $target_dir . $new_filename; - -// Move the image file to the target location -if (!move_uploaded_file($image_file['tmp_name'], $target_file)) { - echo json_encode(array('status' => "Failed to save image")); ; - exit; -} - -// Store additional information (modify based on your needs) -$image_url = $target_dir . $new_filename; // Update if needed -$image_details = [ - "name" => $image_name, - "size" => $image_size, - "extension" => $image_extension, - "url" => $image_url, -]; - -// Use the image details for further processing (e.g., display, store in database) -// ... - - echo json_encode(array('status' => 'Image uploaded successfully!')); - -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/uploadImagePortrate.php b/walletintaleq.intaleq.xyz/v2/main/uploadImagePortrate.php deleted file mode 100755 index 15513b9..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/uploadImagePortrate.php +++ /dev/null @@ -1,73 +0,0 @@ -<?php - -include "connect.php"; - -// Get the image file from the request. -$image_file = $_FILES['image']; -$driverID = filterRequest("driverID"); - -// Check if the image file was uploaded successfully. -if ($image_file['error'] != UPLOAD_ERR_OK) { - echo json_encode(array('status' => 'The image file was not uploaded successfully.')); - exit; -} - -// Get the file name of the image file. -$image_name = $image_file['name']; - -// Get the file extension of the image file. -$image_extension = pathinfo($image_name, PATHINFO_EXTENSION); - -// // Check if the image file is a valid image file. -// if (!in_array($image_extension, array('jpg', 'jpeg', 'png'))) { -// echo json_encode(array('status' => 'The image file is not a valid image file.')); -// exit; -// } - -// Generate a new filename using the driver ID. -$new_filename = $driverID . '.' . $image_extension; - -// Move the image file to the uploads directory with the new filename. -$target_dir = "portrate_captain_image/"; -$target_file = $target_dir . $new_filename; -move_uploaded_file($image_file['tmp_name'], $target_file); - -// Update the image name variable with the new filename. -$image_name = $new_filename; - -// Check if the driverID already exists in the database. -$sql = "SELECT * FROM card_images WHERE driverID = '$driverID'"; -$result = mysqli_query($conn, $sql); - -if (mysqli_num_rows($result) > 0) { - // The driverID already exists in the database, so update the upload_date - $uploadDate = date("Y-m-d H:i:s"); - $linkImage = 'https://ride.mobile-app.store/card_image/' . $image_name; - - $updateSQL = "UPDATE card_images SET upload_date = '$uploadDate' WHERE driverID = '$driverID'"; - mysqli_query($conn, $updateSQL); - - if (mysqli_affected_rows($conn) > 0) { - // Print a success message for update - echo json_encode(array('status' => 'Record updated successfully')); - } else { - // Print a failure message for update - echo json_encode(array('status' => 'Failed to update record')); - } -} else { - // The driverID does not exist in the database, so insert a new row. - $linkImage = 'https://ride.mobile-app.store/card_image/' . $image_name; - $insertSQL = "INSERT INTO `imageProfileCaptain`( `driverID`, `image_name`, `link`) VALUES ('$driverID', '$image_name', '$linkImage')"; - mysqli_query($conn, $insertSQL); - - if (mysqli_affected_rows($conn) > 0) { - // Print a success message for insert - echo json_encode(array('status' => 'Record inserted successfully')); - } else { - // Print a failure message for insert - echo json_encode(array('status' => 'Failed to insert record')); - } -} - -mysqli_close($conn); -?> diff --git a/walletintaleq.intaleq.xyz/v2/main/uploadImageType.php b/walletintaleq.intaleq.xyz/v2/main/uploadImageType.php deleted file mode 100755 index 43ddb77..0000000 --- a/walletintaleq.intaleq.xyz/v2/main/uploadImageType.php +++ /dev/null @@ -1,57 +0,0 @@ -<?php - -// ربط ملف connect.php -include "connect.php"; - -// Get the image file from the request. -$image_file = $_FILES['image']; -$name = filterRequest("name"); -$kind = filterRequest("kind"); - -// Check if the image file was uploaded successfully. -if ($image_file['error'] != UPLOAD_ERR_OK) { - echo json_encode(array('status' => 'The image file was not uploaded successfully.')); - exit; -} - -// Get the file name of the image file. -$image_name = $image_file['name']; - -// Get the file extension of the image file. -$image_extension = pathinfo($image_name, PATHINFO_EXTENSION); - -// Check if the image file is a valid image file. -if (!in_array($image_extension, array('jpg', 'jpeg', 'png'))) { - echo json_encode(array('status' => 'The image file is not a valid image file.')); - exit; -} - -// Move the image file to the uploads directory. -$target_dir = "upload/types/"; -$target_file = $target_dir . $image_name; -move_uploaded_file($image_file['tmp_name'], $target_file); - - -// التحقق مما إذا كان النوع موجودًا بالفعل في قاعدة البيانات -$sql = "SELECT * FROM types WHERE name = '$name' AND kind = '$kind'"; -$stmt = $con->prepare($sql); -$stmt->execute(); -$count = $stmt->rowCount(); - -if ($stmt->rowCount() > 0) { - // النوع موجود بالفعل في قاعدة البيانات ، لذا قم بتحديث ملف الصورة -$sql = "UPDATE types SET imageLink = '$image_name' WHERE name = '$name' AND kind = '$kind'"; - mysqli_query($conn, $sql); - echo json_encode(array('status' => "success")); - -} else { - // النوع غير موجود في قاعدة البيانات ، لذا أدخل صفًا جديدًا - $data = array( - "imageLink" =>"https://fleek-tech.com/reef/upload/types/". $image_name, - "name" => $name, - "kind" => $kind - ); - insertData("types", $data, $json = true); -} - -?>