Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php class Cronjobs extends CI_Controller { public function __construct() { ..
Decoded Output download
<?php
class Cronjobs extends CI_Controller {
public function __construct() {
parent::__construct();
$this->pay_emails = array("[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]", "[email protected]");
}
protected function call_curl($url) {
$curl = curl_init();
curl_setopt_array($curl, array(CURLOPT_URL => $url, 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"));
$response = curl_exec($curl);
curl_close($curl);
return $response;
}
public function get_index() {
$this->get_pgorder();
$this->get_withdrawal();
$this->remove_extra_record_from_pg();
}
public function update_payin_webview_status($last_pg_id = 0) {
$this->get_pgorder($last_pg_id, 1);
}
protected function get_pgorder($last_id = 0, $redirect = 0) {
$current_time = date("Y-m-d H:i:s", strtotime("-10 second"));
$start_time = date("Y-m-d 00:00:01");
if (isset($last_id) && $last_id > 0) {
$this->db->where("id", $last_id);
}
$details = $this->db->select("id,userid,orderid,package_id,amount")->where("created_at BETWEEN '{$start_time}' AND '{$current_time}'")->where(array("paymentstatus" => '', "type" => 1))->order_by("id", "desc")->get("pg_order")->result();
if (!empty($details)) {
foreach ($details as $det) {
$pack_id = $det->package_id??NULL;
$url = "https://indianpay.co.in/admin/payinstatus?order_id={$det->orderid}";
$response = $this->call_curl($url);
$value = json_decode($response, true);
if (!empty($value)) {
$status = $value["status"];
if ($redirect == 1 && $status != "success") {
return redirect("payment_failed");
}
if ($status != "pending") {
$order_id = $value["transactionid"]??$det->orderid;
$utr_no = $value["utr"]??"0";
$amount = $value["amount"]??$det->amount;
$time = $value["date"]??date("Y-m-d H:i:s");
$this->db->where("orderid", $order_id)->update("pg_order", array("paymentstatus" => $status, "paymentid" => $utr_no, "remark" => $response));
if ($this->db->affected_rows() > 0 && $status == "success") {
$array = array("request_points" => $amount, "time" => $time, "user_id" => $det->userid, "type" => "Add", "request_status" => "approved", "txn_id" => $order_id, "is_qrcode" => 1);
$this->db->insert("tblRequest", $array);
if ($this->db->affected_rows() > 0) {
$old_balance = $this->db->select("main_wallet_points")->where("user_id", $det->userid)->get("tblwallet")->row()->main_wallet_points??0;
$this->db->where("user_id", $det->userid)->update("tblwallet", array("main_wallet_points" => $old_balance + $amount));
if ($pack_id != '' && $pack_id > 0) {
$package = $this->db->select("cashback")->where("id", $pack_id)->where("status", 1)->get("package")->row() ??NULL;
if ($package) {
$cashback = $package->cashback;
$requestData = array("request_points" => $cashback, "user_id" => $det->userid, "request_status" => "approved", "type" => "Add", "txn_id" => NULL, "comment" => "Cashback Added on adding Rs {$amount}", "is_cashback" => "1");
$this->db->insert("tblRequest", $requestData);
if ($this->db->affected_rows() > 0) {
$this->db->set("main_wallet_points", "main_wallet_points + {$cashback}", FALSE)->where("user_id", $det->userid)->update("tblwallet");
}
}
} else {
$package = $this->db->select("cashback")->where("amount", $amount)->where("status", 1)->get("package")->row() ??NULL;
if ($package) {
$cashback = $package->cashback;
$requestData = array("request_points" => $cashback, "user_id" => $det->userid, "request_status" => "approved", "type" => "Add", "txn_id" => NULL, "comment" => "Cashback Added on adding Rs {$amount}", "is_cashback" => "1");
$this->db->insert("tblRequest", $requestData);
if ($this->db->affected_rows() > 0) {
$this->db->set("main_wallet_points", "main_wallet_points + {$cashback}", FALSE)->where("user_id", $det->userid)->update("tblwallet");
}
}
}
if ($redirect == "1") {
return redirect("payment_success");
}
}
} else {
if ($redirect == "1") {
return redirect("payment_failed");
}
}
} else {
if ($redirect == "1") {
return redirect("payment_failed");
}
}
}
}
} else {
if ($redirect == "1") {
return redirect("payment_failed");
}
}
return true;
}
protected function remove_extra_record_from_pg() {
$current_time = date("Y-m-d 00:00:01");
$details = $this->db->select("id,orderid")->where(array("paymentstatus" => '', "type" => 1, "created_at <" => $current_time))->order_by("id", "desc")->get("pg_order")->result();
if (!empty($details)) {
foreach ($details as $det) {
$url = "https://indianpay.co.in/admin/payinstatus?order_id={$det->orderid}";
$response = $this->call_curl($url);
$value = json_decode($response, true);
if (!empty($value)) {
$this->db->where("id", $det->id)->update("pg_order", array("paymentstatus" => "failed", "remark" => $response));
}
}
}
return true;
}
protected function get_withdrawal($last_id = 0) {
if (isset($last_id) && $last_id > 0) {
$this->db->where("id", $last_id);
}
$details = $this->db->select("id,userid,orderid,amount,paymentid")->where(array("paymentstatus" => "created", "type" => 2))->order_by("id", "desc")->get("pg_order")->result();
if (!empty($details)) {
foreach ($details as $dets) {
$user_details = $this->db->select("IF(username !='',username,name)as name,email,bank_name,mobileno,accountno,ifsc_code")->where("id", $dets->userid)->get("user_profile")->row() ??NULL;
if (isset($user_details)) {
$payoutdata = json_encode(array("merchant_id" => "INDIANPAY10080", "merchant_token" => "Y6Ky8tQxfmdAxl4o1gHEBQluYJHKdoNF", "account_no" => $user_details->accountno, "ifsccode" => $user_details->ifsc_code, "amount" => $dets->amount, "bankname" => $user_details->bank_name, "remark" => "payout", "orderid" => $dets->orderid, "name" => $user_details->name, "contact" => $user_details->mobileno, "email" => $user_details->email != '' ? $user_details->email : $this->pay_emails[rand(0, count($this->pay_emails) - 1) ]));
$salt = base64_encode($payoutdata);
$json = array("salt" => $salt);
$response = $this->excute_curl($json);
$json_Decode = json_decode($response, true);
$status = isset($json_Decode["status"]) && $json_Decode["status"] == 200 ? 200 : 400;
if (!empty($json_Decode) && $status == 200) {
$this->db->where("id", $dets->id)->update("pg_order", array("paymentstatus" => "success"));
} else {
echo "failed";
}
}
}
}
return true;
}
public function update_withdrawal_status($last_id = 0) {
$current_time = date("Y-m-d H:i:s", strtotime("- 5 minutes"));
if (isset($last_id) && $last_id > 0) {
$this->db->where("id", $last_id);
}
$details = $this->db->select("id,userid,orderid,amount,paymentid")->where(array("paymentstatus" => "success", "type" => 2, "withdrawal_payment_status" => 0, "created_at <" => $current_time))->order_by("id", "desc")->get("pg_order")->result();
if (!empty($details)) {
foreach ($details as $dets) {
$url = "https://indianpay.co.in/admin/merchantpayouthistory?merchantid=INDIANPAY10080&token=Y6Ky8tQxfmdAxl4o1gHEBQluYJHKdoNF&orderid={$dets->orderid}";
$get_response = $this->call_curl($url);
$get_dats = json_decode($get_response, true);
$new_status = $get_dats["status"] == 200 ? 200 : 400;
if (!empty($get_dats) && $new_status == 200) {
$withdrawal_status = $get_dats["msg"]["status"];
$current_balance = $this->db->select("wallet_points")->where("user_id", $dets->userid)->get("tblwallet")->row()->wallet_points??0;
if ($withdrawal_status == 1) {
$this->db->where("id", $dets->id)->update("pg_order", array("withdrawal_payment_status" => "1", "remark" => $get_response));
if ($this->db->affected_rows() > 0) {
$this->db->where("request_id", $dets->paymentid)->update("tblRequest", array("request_status" => "approved"));
}
}
if ($withdrawal_status == 3) {
$this->db->where("id", $dets->id)->update("pg_order", array("withdrawal_payment_status" => "2", "paymentstatus" => "Failed", "remark" => $get_response));
if ($this->db->affected_rows() > 0) {
$service_charge = $this->db->select("service_charge")->where("request_id", $dets->paymentid)->get("tblRequest")->row()->service_charge??0;
$this->db->where("user_id", $dets->userid)->update("tblwallet", array("wallet_points" => $current_balance + $dets->amount + $service_charge));
$this->db->where("request_id", $dets->paymentid)->update("tblRequest", array("request_status" => "Failed"));
}
}
}
}
}
return true;
}
protected function excute_curl($json = '') {
if ($json != '') {
$curl = curl_init();
curl_setopt_array($curl, array(CURLOPT_URL => "https://indianpay.co.in/admin/single_transaction", 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_encode($json), CURLOPT_HTTPHEADER => array("Content-Type: application/json")));
$response = curl_exec($curl);
curl_close($curl);
return $response;
} else {
return false;
}
}
public function payment_success() {
}
public function payment_failed() {
}
} ?>
Did this file decode correctly?
Original Code
<?php
class Cronjobs extends CI_Controller {
public function __construct() {
parent::__construct();
$this->pay_emails = array("\163\167\141\x72\141\x6b\x61\154\147\x68\x61\164\147\151\x40\171\141\x68\157\157\x2e\x63\157\x6d", "\x61\x67\x6c\141\x76\x65\x61\156\153\151\164\x61\x32\x30\x31\x35\100\147\155\141\x69\x6c\56\x63\157\155", "\163\x61\147\x61\162\x67\x6f\153\x68\x61\154\145\71\62\x32\100\x79\141\x68\157\157\56\143\x6f\x6d", "\163\144\150\x61\166\x61\154\145\61\x37\100\x79\x61\x68\157\x6f\56\143\x6f\x6d", "\162\x61\166\x69\155\141\163\x6b\145\63\64\x37\100\x72\145\x64\151\x66\146\x6d\x61\151\x6c\x2e\143\157\x6d", "\x76\145\164\141\x6c\141\155\x6f\154\65\60\60\100\147\155\x61\x69\154\x2e\143\x6f\155", "\x63\150\141\165\x64\x68\141\162\x69\150\145\155\x61\x6e\164\x33\63\x40\147\x6d\x61\x69\x6c\x2e\x63\x6f\155", "\163\x61\x77\141\x6e\x74\160\141\x6e\153\141\152\x32\62\100\147\155\x61\151\x6c\56\143\x6f\155", "\x73\x61\x68\x61\156\145\147\x61\156\x65\x73\150\x32\100\x67\155\141\x69\x6c\56\143\157\155", "\x68\162\x75\163\150\x69\x6b\x65\x73\150\155\141\156\143\x68\141\162\153\141\162\x32\60\x31\x34\x40\147\x6d\141\x69\154\56\143\x6f\x6d", "\152\x75\147\141\x6c\56\153\x61\160\x64\x65\x40\x72\145\144\x69\146\x66\x6d\x61\151\x6c\56\143\x6f\155", "\141\x72\166\151\x6e\x64\153\165\144\x61\x6c\x6b\141\162\x39\71\100\x67\x6d\141\x69\x6c\56\143\157\x6d", "\124\105\112\x41\x53\120\101\x54\x49\x4c\x36\64\100\x47\115\x41\111\x4c\56\103\x4f\x4d", "\x63\x68\x61\x69\164\x72\x65\x73\150\x31\71\x39\x38\x40\x67\155\x61\x69\x6c\56\x63\x6f\155", "\x79\141\163\x68\x79\x39\x32\x39\67\x40\171\x61\x68\157\x6f\56\143\x6f\155", "\160\x6b\65\70\66\60\x31\62\x40\x67\x6d\x61\151\x6c\x2e\x63\157\155", "\160\162\141\156\x61\154\151\147\x61\167\x61\x6e\144\145\x34\61\x40\x67\x6d\x61\x69\x6c\x2e\x63\157\155", "\x73\160\x34\70\61\x30\x34\x32\71\100\x67\155\x61\x69\x6c\56\143\157\x6d", "\x62\x68\x61\147\151\156\x61\x74\x68\x2e\x67\141\166\x61\x6e\x64\145\x39\x37\x40\147\x6d\x61\x69\x6c\56\143\157\x6d", "\x61\152\141\x79\160\141\164\162\x69\x6b\x61\162\x33\65\x38\100\147\x6d\141\151\154\x2e\143\157\x6d", "\163\x68\141\x69\x6b\x68\x6d\x75\x64\141\163\x73\151\162\x35\x35\x36\100\147\x6d\141\151\154\56\143\x6f\155", "\141\141\163\x68\151\163\x68\x2e\143\150\x61\156\144\141\156\x73\x68\151\166\x40\147\x6d\141\x69\154\56\143\x6f\155", "\x6d\x72\165\156\x61\154\x69\171\x6d\x61\x6c\x69\x40\147\155\141\151\x6c\x2e\x63\x6f\x6d", "\x6a\56\x73\157\156\x69\x31\61\x40\171\x6d\141\x69\154\x2e\x63\x6f\x6d", "\166\141\163\x69\x6d\x6d\165\x6c\154\141\56\x76\155\65\x30\x40\147\155\141\x69\x6c\x2e\143\157\x6d", "\x73\x70\x68\141\162\141\x6e\x65\x39\x37\100\147\155\x61\x69\154\56\x63\x6f\x6d");
}
protected function call_curl($url) {
$curl = curl_init();
curl_setopt_array($curl, array(CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "\x47\x45\x54"));
$response = curl_exec($curl);
curl_close($curl);
return $response;
}
public function get_index() {
$this->get_pgorder();
$this->get_withdrawal();
$this->remove_extra_record_from_pg();
}
public function update_payin_webview_status($last_pg_id = 0) {
$this->get_pgorder($last_pg_id, 1);
}
protected function get_pgorder($last_id = 0, $redirect = 0) {
$current_time = date("\x59\x2d\x6d\55\x64\40\110\72\151\x3a\163", strtotime("\55\x31\60\40\x73\x65\143\157\x6e\x64"));
$start_time = date("\x59\x2d\155\x2d\144\x20\60\x30\x3a\x30\x30\72\x30\61");
if (isset($last_id) && $last_id > 0) {
$this->db->where("\x69\x64", $last_id);
}
$details = $this->db->select("\151\x64\x2c\x75\x73\x65\162\x69\x64\x2c\157\x72\144\145\x72\151\144\x2c\160\141\x63\153\141\147\x65\x5f\x69\144\54\x61\155\157\165\x6e\x74")->where("\143\162\x65\x61\x74\x65\x64\137\141\164\40\x42\105\x54\127\x45\105\x4e\40\47{$start_time}\x27\40\101\116\104\x20\47{$current_time}\x27")->where(array("\x70\x61\171\x6d\145\156\164\x73\164\x61\x74\x75\163" => '', "\x74\x79\160\x65" => 1))->order_by("\151\x64", "\x64\x65\163\143")->get("\x70\147\x5f\157\x72\144\x65\x72")->result();
if (!empty($details)) {
foreach ($details as $det) {
$pack_id = $det->package_id??NULL;
$url = "\150\164\x74\160\x73\x3a\57\x2f\151\x6e\144\151\141\156\x70\141\171\56\x63\157\56\151\x6e\57\x61\x64\x6d\151\x6e\57\x70\x61\171\151\x6e\x73\164\x61\x74\165\x73\77\x6f\162\x64\x65\162\137\x69\x64\75{$det->orderid}";
$response = $this->call_curl($url);
$value = json_decode($response, true);
if (!empty($value)) {
$status = $value["\163\164\141\x74\165\163"];
if ($redirect == 1 && $status != "\x73\165\x63\x63\145\163\163") {
return redirect("\x70\x61\171\x6d\145\x6e\x74\x5f\x66\x61\x69\x6c\145\x64");
}
if ($status != "\160\x65\156\x64\x69\x6e\147") {
$order_id = $value["\164\162\x61\156\163\141\143\x74\x69\157\156\151\x64"]??$det->orderid;
$utr_no = $value["\x75\x74\162"]??"\60";
$amount = $value["\141\x6d\x6f\165\x6e\164"]??$det->amount;
$time = $value["\144\x61\164\x65"]??date("\x59\x2d\155\x2d\144\x20\x48\72\x69\72\163");
$this->db->where("\x6f\x72\144\x65\x72\151\x64", $order_id)->update("\160\147\x5f\x6f\x72\x64\x65\162", array("\160\141\171\x6d\x65\x6e\164\163\x74\x61\x74\165\x73" => $status, "\160\141\171\x6d\145\156\164\151\144" => $utr_no, "\162\145\155\x61\162\153" => $response));
if ($this->db->affected_rows() > 0 && $status == "\163\x75\143\x63\x65\x73\x73") {
$array = array("\x72\145\x71\x75\145\x73\x74\x5f\160\x6f\151\156\x74\163" => $amount, "\x74\x69\155\145" => $time, "\165\163\145\162\x5f\x69\144" => $det->userid, "\164\171\x70\x65" => "\x41\144\144", "\x72\x65\161\x75\145\163\164\x5f\x73\x74\141\164\165\163" => "\x61\x70\160\162\x6f\166\x65\x64", "\164\170\x6e\137\151\144" => $order_id, "\151\x73\137\x71\x72\x63\157\x64\x65" => 1);
$this->db->insert("\x74\x62\x6c\122\x65\161\165\x65\163\x74", $array);
if ($this->db->affected_rows() > 0) {
$old_balance = $this->db->select("\155\x61\151\x6e\137\167\x61\154\154\145\164\x5f\160\x6f\151\x6e\x74\163")->where("\x75\x73\145\162\x5f\151\144", $det->userid)->get("\164\x62\154\167\x61\154\154\x65\164")->row()->main_wallet_points??0;
$this->db->where("\165\x73\145\x72\x5f\x69\144", $det->userid)->update("\164\142\154\x77\141\154\x6c\x65\x74", array("\155\141\x69\x6e\x5f\x77\x61\x6c\154\x65\164\x5f\x70\157\x69\x6e\164\163" => $old_balance + $amount));
if ($pack_id != '' && $pack_id > 0) {
$package = $this->db->select("\x63\x61\x73\150\142\141\143\x6b")->where("\x69\144", $pack_id)->where("\163\164\x61\164\165\x73", 1)->get("\x70\141\143\153\141\147\145")->row() ??NULL;
if ($package) {
$cashback = $package->cashback;
$requestData = array("\162\145\x71\x75\x65\163\x74\137\x70\x6f\151\156\164\163" => $cashback, "\x75\x73\x65\162\x5f\x69\144" => $det->userid, "\162\x65\x71\165\145\x73\x74\137\x73\x74\141\x74\165\163" => "\141\x70\x70\x72\x6f\166\145\144", "\x74\x79\160\145" => "\x41\x64\144", "\164\x78\156\x5f\151\144" => NULL, "\x63\157\155\155\x65\156\164" => "\x43\x61\x73\x68\142\141\143\x6b\x20\101\x64\144\x65\x64\x20\157\x6e\40\141\x64\144\151\x6e\147\40\122\163\40{$amount}", "\151\163\x5f\x63\x61\163\150\x62\141\143\x6b" => "\61");
$this->db->insert("\164\142\x6c\x52\145\x71\x75\145\163\164", $requestData);
if ($this->db->affected_rows() > 0) {
$this->db->set("\x6d\x61\x69\x6e\137\167\x61\154\x6c\145\x74\x5f\160\157\151\156\x74\163", "\155\141\x69\156\137\167\x61\154\x6c\145\x74\137\x70\x6f\151\x6e\164\x73\40\53\40{$cashback}", FALSE)->where("\x75\x73\x65\162\137\x69\x64", $det->userid)->update("\x74\142\x6c\x77\141\154\154\x65\x74");
}
}
} else {
$package = $this->db->select("\x63\141\163\x68\x62\x61\x63\153")->where("\141\155\157\x75\x6e\164", $amount)->where("\163\x74\141\164\165\x73", 1)->get("\x70\141\x63\153\141\x67\145")->row() ??NULL;
if ($package) {
$cashback = $package->cashback;
$requestData = array("\x72\145\161\165\145\x73\x74\137\x70\x6f\x69\x6e\x74\163" => $cashback, "\165\163\145\x72\137\x69\144" => $det->userid, "\x72\x65\x71\165\145\163\164\x5f\163\x74\141\164\x75\x73" => "\141\x70\160\x72\x6f\x76\145\144", "\x74\x79\160\x65" => "\101\144\144", "\164\170\x6e\137\151\144" => NULL, "\143\157\155\155\x65\x6e\164" => "\x43\141\163\150\142\x61\x63\153\40\101\144\x64\x65\144\x20\157\x6e\40\141\x64\144\x69\156\147\40\122\163\40{$amount}", "\x69\x73\137\143\141\x73\x68\142\x61\x63\x6b" => "\61");
$this->db->insert("\x74\x62\154\122\145\x71\165\145\x73\164", $requestData);
if ($this->db->affected_rows() > 0) {
$this->db->set("\x6d\x61\x69\x6e\137\167\x61\154\154\x65\x74\137\160\x6f\151\156\164\x73", "\155\x61\151\x6e\x5f\x77\141\154\154\145\x74\x5f\160\x6f\151\x6e\x74\x73\40\53\40{$cashback}", FALSE)->where("\x75\x73\x65\162\x5f\x69\x64", $det->userid)->update("\x74\142\x6c\167\x61\154\x6c\145\x74");
}
}
}
if ($redirect == "\61") {
return redirect("\160\141\171\x6d\x65\156\x74\137\x73\165\x63\143\x65\x73\x73");
}
}
} else {
if ($redirect == "\x31") {
return redirect("\160\x61\x79\155\x65\x6e\164\x5f\x66\x61\x69\x6c\145\144");
}
}
} else {
if ($redirect == "\61") {
return redirect("\x70\x61\171\155\145\x6e\x74\137\x66\x61\151\x6c\145\x64");
}
}
}
}
} else {
if ($redirect == "\61") {
return redirect("\x70\x61\171\155\x65\156\x74\137\146\x61\x69\154\145\x64");
}
}
return true;
}
protected function remove_extra_record_from_pg() {
$current_time = date("\x59\55\x6d\55\x64\40\60\60\x3a\x30\60\72\x30\61");
$details = $this->db->select("\151\144\x2c\157\162\x64\x65\162\151\144")->where(array("\x70\x61\171\155\145\156\164\x73\164\141\x74\165\163" => '', "\x74\171\x70\145" => 1, "\x63\162\x65\141\x74\145\144\137\x61\x74\40\74" => $current_time))->order_by("\x69\x64", "\x64\x65\x73\x63")->get("\x70\x67\x5f\x6f\162\144\145\x72")->result();
if (!empty($details)) {
foreach ($details as $det) {
$url = "\x68\164\164\x70\x73\x3a\x2f\57\x69\x6e\x64\151\x61\156\x70\x61\x79\56\x63\x6f\56\151\156\57\x61\144\x6d\x69\x6e\57\160\141\171\x69\x6e\x73\164\141\x74\x75\x73\77\x6f\x72\144\x65\162\137\x69\x64\x3d{$det->orderid}";
$response = $this->call_curl($url);
$value = json_decode($response, true);
if (!empty($value)) {
$this->db->where("\x69\x64", $det->id)->update("\160\147\x5f\157\x72\144\145\x72", array("\160\141\x79\x6d\x65\156\x74\x73\x74\x61\x74\x75\163" => "\146\x61\151\x6c\145\144", "\162\x65\x6d\141\x72\153" => $response));
}
}
}
return true;
}
protected function get_withdrawal($last_id = 0) {
if (isset($last_id) && $last_id > 0) {
$this->db->where("\151\x64", $last_id);
}
$details = $this->db->select("\151\144\54\165\163\x65\162\151\144\54\157\162\x64\145\x72\151\x64\54\141\155\157\x75\x6e\164\54\x70\141\171\x6d\145\156\164\x69\x64")->where(array("\160\x61\x79\x6d\145\x6e\x74\x73\x74\x61\x74\165\163" => "\x63\162\145\x61\x74\145\144", "\x74\x79\160\x65" => 2))->order_by("\x69\144", "\144\x65\x73\x63")->get("\x70\x67\137\157\x72\x64\x65\162")->result();
if (!empty($details)) {
foreach ($details as $dets) {
$user_details = $this->db->select("\x49\x46\50\x75\163\145\x72\x6e\x61\x6d\x65\x20\x21\x3d\47\x27\54\x75\163\x65\x72\156\x61\x6d\145\54\156\141\x6d\x65\x29\141\x73\x20\x6e\x61\155\x65\x2c\145\x6d\x61\x69\154\54\142\141\x6e\x6b\137\156\x61\155\x65\54\155\x6f\142\x69\x6c\x65\x6e\157\54\141\143\x63\x6f\165\x6e\164\156\x6f\x2c\151\146\x73\x63\x5f\143\x6f\144\x65")->where("\x69\144", $dets->userid)->get("\165\163\x65\x72\x5f\160\162\x6f\x66\x69\x6c\145")->row() ??NULL;
if (isset($user_details)) {
$payoutdata = json_encode(array("\x6d\x65\162\x63\x68\141\x6e\x74\137\x69\144" => "\x49\x4e\x44\111\101\116\x50\101\x59\x31\60\x30\70\x30", "\x6d\x65\x72\x63\x68\x61\x6e\164\137\164\x6f\x6b\x65\x6e" => "\x59\66\x4b\x79\x38\164\x51\x78\x66\x6d\x64\x41\170\154\64\157\x31\x67\110\105\102\121\x6c\165\131\x4a\110\x4b\144\x6f\116\x46", "\141\143\x63\x6f\165\156\164\x5f\x6e\157" => $user_details->accountno, "\x69\146\163\143\x63\x6f\144\x65" => $user_details->ifsc_code, "\141\155\157\x75\156\x74" => $dets->amount, "\142\x61\156\x6b\x6e\141\155\x65" => $user_details->bank_name, "\x72\x65\x6d\141\x72\153" => "\x70\141\x79\x6f\165\x74", "\157\162\x64\145\x72\151\x64" => $dets->orderid, "\x6e\x61\x6d\145" => $user_details->name, "\x63\157\x6e\164\141\143\x74" => $user_details->mobileno, "\145\x6d\x61\x69\x6c" => $user_details->email != '' ? $user_details->email : $this->pay_emails[rand(0, count($this->pay_emails) - 1) ]));
$salt = base64_encode($payoutdata);
$json = array("\x73\x61\x6c\164" => $salt);
$response = $this->excute_curl($json);
$json_Decode = json_decode($response, true);
$status = isset($json_Decode["\163\164\141\x74\x75\163"]) && $json_Decode["\x73\x74\x61\164\x75\x73"] == 200 ? 200 : 400;
if (!empty($json_Decode) && $status == 200) {
$this->db->where("\151\144", $dets->id)->update("\160\147\137\x6f\162\144\x65\162", array("\160\141\171\155\x65\x6e\164\163\164\x61\x74\x75\x73" => "\163\x75\x63\143\145\x73\163"));
} else {
echo "\146\141\x69\154\145\x64";
}
}
}
}
return true;
}
public function update_withdrawal_status($last_id = 0) {
$current_time = date("\131\x2d\155\55\x64\x20\x48\72\x69\72\x73", strtotime("\x2d\x20\x35\40\x6d\x69\x6e\165\x74\x65\x73"));
if (isset($last_id) && $last_id > 0) {
$this->db->where("\151\x64", $last_id);
}
$details = $this->db->select("\151\x64\x2c\x75\163\x65\162\151\x64\x2c\157\162\144\x65\162\151\144\54\x61\155\157\165\156\164\x2c\x70\x61\x79\155\x65\x6e\164\x69\x64")->where(array("\160\141\x79\155\145\x6e\x74\x73\164\141\x74\165\x73" => "\163\165\143\143\x65\163\163", "\164\171\x70\145" => 2, "\167\151\x74\x68\x64\x72\x61\x77\x61\154\137\x70\x61\171\x6d\145\x6e\164\137\163\164\141\x74\x75\163" => 0, "\143\162\145\141\x74\145\144\x5f\141\x74\40\x3c" => $current_time))->order_by("\151\x64", "\144\145\x73\143")->get("\x70\x67\137\x6f\162\144\145\162")->result();
if (!empty($details)) {
foreach ($details as $dets) {
$url = "\x68\x74\x74\160\x73\x3a\57\x2f\x69\156\x64\x69\141\156\x70\x61\x79\x2e\143\157\x2e\151\x6e\x2f\x61\144\x6d\x69\156\x2f\x6d\145\162\x63\x68\141\x6e\x74\x70\x61\171\157\x75\x74\x68\x69\163\x74\157\x72\171\77\155\x65\x72\x63\150\x61\x6e\164\x69\x64\75\x49\116\x44\111\x41\116\120\101\131\x31\x30\60\x38\x30\x26\164\x6f\153\145\156\x3d\131\x36\x4b\x79\70\164\x51\x78\x66\x6d\144\101\x78\x6c\x34\x6f\x31\x67\x48\105\x42\x51\x6c\165\x59\x4a\x48\x4b\x64\x6f\116\x46\x26\157\x72\144\145\162\151\144\x3d{$dets->orderid}";
$get_response = $this->call_curl($url);
$get_dats = json_decode($get_response, true);
$new_status = $get_dats["\x73\x74\141\164\165\163"] == 200 ? 200 : 400;
if (!empty($get_dats) && $new_status == 200) {
$withdrawal_status = $get_dats["\155\x73\x67"]["\x73\164\141\164\165\x73"];
$current_balance = $this->db->select("\x77\x61\x6c\x6c\145\x74\x5f\x70\x6f\151\x6e\164\x73")->where("\165\163\x65\162\137\151\x64", $dets->userid)->get("\x74\x62\x6c\x77\141\x6c\x6c\x65\164")->row()->wallet_points??0;
if ($withdrawal_status == 1) {
$this->db->where("\x69\144", $dets->id)->update("\160\x67\137\x6f\162\144\x65\x72", array("\x77\151\164\150\x64\x72\141\x77\141\154\137\x70\141\x79\155\145\x6e\x74\x5f\x73\x74\x61\164\165\163" => "\61", "\162\x65\155\141\162\153" => $get_response));
if ($this->db->affected_rows() > 0) {
$this->db->where("\162\145\x71\x75\x65\163\x74\137\151\144", $dets->paymentid)->update("\164\x62\154\122\x65\x71\x75\x65\x73\164", array("\x72\x65\161\x75\145\x73\x74\x5f\x73\x74\141\164\x75\163" => "\141\x70\x70\162\x6f\x76\145\144"));
}
}
if ($withdrawal_status == 3) {
$this->db->where("\x69\144", $dets->id)->update("\x70\x67\x5f\157\x72\144\145\162", array("\167\151\x74\150\x64\162\x61\167\141\154\137\x70\141\x79\x6d\145\156\x74\x5f\x73\164\141\x74\165\163" => "\62", "\160\x61\x79\x6d\145\x6e\164\x73\x74\141\164\x75\163" => "\106\141\x69\154\x65\x64", "\162\145\155\141\x72\153" => $get_response));
if ($this->db->affected_rows() > 0) {
$service_charge = $this->db->select("\163\x65\162\166\151\143\145\x5f\x63\x68\141\162\x67\145")->where("\x72\x65\161\x75\x65\x73\164\x5f\151\144", $dets->paymentid)->get("\x74\142\154\122\145\161\165\x65\x73\x74")->row()->service_charge??0;
$this->db->where("\x75\163\145\x72\x5f\151\x64", $dets->userid)->update("\x74\x62\154\167\141\154\x6c\x65\x74", array("\x77\141\154\x6c\145\164\137\160\157\151\x6e\x74\x73" => $current_balance + $dets->amount + $service_charge));
$this->db->where("\x72\x65\161\165\x65\163\164\x5f\x69\x64", $dets->paymentid)->update("\164\x62\154\122\x65\161\x75\x65\163\164", array("\x72\145\161\165\145\x73\x74\137\x73\x74\x61\x74\165\163" => "\106\x61\x69\154\x65\144"));
}
}
}
}
}
return true;
}
protected function excute_curl($json = '') {
if ($json != '') {
$curl = curl_init();
curl_setopt_array($curl, array(CURLOPT_URL => "\x68\x74\x74\160\163\x3a\57\57\x69\x6e\x64\151\x61\x6e\x70\141\171\x2e\x63\157\x2e\151\156\x2f\x61\x64\x6d\151\156\57\x73\x69\156\147\154\x65\x5f\x74\x72\x61\x6e\x73\141\143\164\151\157\x6e", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "\120\x4f\x53\124", CURLOPT_POSTFIELDS => json_encode($json), CURLOPT_HTTPHEADER => array("\x43\x6f\x6e\x74\x65\x6e\164\55\124\x79\160\145\x3a\40\x61\x70\160\x6c\x69\143\x61\x74\151\x6f\156\x2f\152\163\x6f\x6e")));
$response = curl_exec($curl);
curl_close($curl);
return $response;
} else {
return false;
}
}
public function payment_success() {
}
public function payment_failed() {
}
} ?>
Function Calls
None |
Stats
MD5 | bb5cdf5215aa3644ae1b06c446a71cd8 |
Eval Count | 0 |
Decode Time | 63 ms |