diff --git a/payment_server/v2/main/functions.php b/payment_server/v2/main/functions.php index 6809c176..7348c94b 100755 --- a/payment_server/v2/main/functions.php +++ b/payment_server/v2/main/functions.php @@ -184,6 +184,17 @@ function authenticateJWT(bool $isReg = false): object function filterRequest($requestname, $type = 'string') { + // If $_POST is empty, try parsing JSON from php://input + if (empty($_POST)) { + $json = file_get_contents('php://input'); + if (!empty($json)) { + $data = json_decode($json, true); + if (is_array($data)) { + $_POST = $data; + } + } + } + if (isset($_POST[$requestname]) && !empty($_POST[$requestname])) { $value = trim($_POST[$requestname]); // Remove any control characters diff --git a/payment_server/v2/main/ride/cliq/create_cliq_invoice.php b/payment_server/v2/main/ride/cliq/create_cliq_invoice.php index 7e075961..77ad3a29 100755 --- a/payment_server/v2/main/ride/cliq/create_cliq_invoice.php +++ b/payment_server/v2/main/ride/cliq/create_cliq_invoice.php @@ -11,7 +11,16 @@ try { $phone = filterRequest("phone"); if (empty($userId) || empty($userType) || !is_numeric($amount) || $amount <= 0 || empty($cliqPhone)) { - echo json_encode(["status" => "failure", "message" => "Invalid input provided."]); + echo json_encode([ + "status" => "failure", + "message" => "Invalid input provided.", + "debug" => [ + "userId" => $userId, + "userType" => $userType, + "amount" => $amount, + "cliqPhone" => $cliqPhone + ] + ]); exit; } diff --git a/siro_driver/lib/constant/links.dart b/siro_driver/lib/constant/links.dart index 57b4f932..f5d2e600 100755 --- a/siro_driver/lib/constant/links.dart +++ b/siro_driver/lib/constant/links.dart @@ -13,7 +13,7 @@ class AppLink { case 'Egypt': return 'https://wallet-egypt.siromove.com/v1/main'; case 'Jordan': - return 'https://walletintaleq.intaleq.xyz/v2/main'; + return 'https://jordan-siro.intaleqapp.com/v2/main'; default: return 'https://wallet.siromove.com/v1/main'; } diff --git a/siro_rider/lib/constant/links.dart b/siro_rider/lib/constant/links.dart index 5582d097..d69742b6 100644 --- a/siro_rider/lib/constant/links.dart +++ b/siro_rider/lib/constant/links.dart @@ -20,7 +20,7 @@ class AppLink { case 'Egypt': return 'https://wallet-egypt.siromove.com/v1/main'; case 'Jordan': - return 'https://walletintaleq.intaleq.xyz/v2/main'; + return 'https://jordan-siro.intaleqapp.com/v2/main'; default: return 'https://wallet.siromove.com/v1/main'; }