diff --git a/admin/config.php b/admin/config.php index ae055ef..d51d6b8 100644 --- a/admin/config.php +++ b/admin/config.php @@ -1,8 +1,9 @@ Setting diff --git a/admin/payout_deposit_action.php b/admin/payout_deposit_action.php new file mode 100644 index 0000000..c7f9339 --- /dev/null +++ b/admin/payout_deposit_action.php @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/admin/user-card.php b/admin/user-card.php index 4826885..41351bf 100644 --- a/admin/user-card.php +++ b/admin/user-card.php @@ -99,183 +99,179 @@ $users = getUsers();
- -
- -
+ for ($x = $start; $x <= $end && $x < $totalUsers; $x++) { + $user = $users[$x]; + ?> +
+ +
+ +
- -
- -
+
+ +
- + @@ -418,14 +483,21 @@ $array = json_decode($vendor,true); + - ₱1,230 - EastWest - **** **** 1234 - Jon-Jon Manaay - Oct 20, 2018 + + + + + - Deposited + - - - - - ₱2,340 - EastWest - **** **** 1234 - Jon-Jon Manaay - Oct 27, 2018 - - Processing - - - - + @@ -533,7 +579,7 @@ $array = json_decode($vendor,true);
-
+
@@ -909,6 +955,12 @@ $array = json_decode($vendor,true);
+
+ + + + +
@@ -916,7 +968,23 @@ $array = json_decode($vendor,true);
-
+ + + + + + + + + + + + + + +
Bank Name
Account Number
Account Name
+ +
diff --git a/functions.php b/functions.php index ed25bb6..ad03bfd 100644 --- a/functions.php +++ b/functions.php @@ -360,6 +360,36 @@ function login($username, $password) $token = json_decode($response, true); return $token["token"]; } + +function loginRenew($username, $password, $token) +{ + $curl = curl_init(); + $array = array( + "username" => $username, + "password" => $password + ); + $json = json_encode($array); + curl_setopt_array($curl, array( + CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/login", + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'POST', + CURLOPT_POSTFIELDS => $json, + CURLOPT_HTTPHEADER => array( + 'Content-Type: application/json', + 'X-Api-Key: {{apiKey}}' + ), + )); + $response = curl_exec($curl); + curl_close($curl); + $token = json_decode($response, true); + return $token["token"]; +} + function forgot_password($email) { if ($_SESSION["is_test"] == true && $_SESSION["test_email_rcpt"] != "") { @@ -1858,3 +1888,95 @@ function getAllPayout($token) return $response; } + +function getPayout($token, $id) +{ + $curl = curl_init(); + curl_setopt_array($curl, array( + CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/payouts/{$id}", + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'GET', + CURLOPT_HTTPHEADER => array( + 'X-Api-Key: {{apiKey}}', + 'Content-Type: application/json', + 'Authorization: Bearer ' . $token + ), + )); + $response = curl_exec($curl); + curl_close($curl); + + return $response; +} + + +function editOrderPayoutStatus($token, $orderIds) +{ + $curl = curl_init(); + foreach ($orderIds as $orderId) { + $data = array( + 'payout_status' => array( + 'payout_id' => $orderId, + 'status' => 'Deposited' + ) + ); + + $params3 = json_encode($data); + curl_setopt_array($curl, array( + CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/orders/" . $orderId, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'PATCH', + CURLOPT_POSTFIELDS => $params3, + CURLOPT_HTTPHEADER => array( + 'Accept: application/json', + 'Content-Type: application/json', + 'Authorization: Bearer ' . $token + ), + )); + $response = curl_exec($curl); + } + curl_close($curl); + +} + + +function updatePayout($token, $payoutId) +{ + $curl = curl_init(); + $data = array( + 'status' => "Deposited", + ); + + $params = json_encode($data); + + curl_setopt_array($curl, array( + CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/payouts/" . $payoutId, // Corrected URL to include $payoutId + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'PATCH', + CURLOPT_POSTFIELDS => $params, // Send the payload data + CURLOPT_HTTPHEADER => array( + 'X-Api-Key: {{apiKey}}', // Make sure to replace {{apiKey}} with an actual API key if needed + 'Content-Type: application/json', + 'Authorization: Bearer ' . $token + ), + )); + + $response = curl_exec($curl); + curl_close($curl); + + return $response; +}