/* Decoded by unphp.net */ payments as $payment) { if ($payment["status"] == "approved") { $paid_amount += $payment["transaction_amount"]; } } goto KVo6V; EBGAX: MercadoPago\SDK::setAccessToken($adm->accessToken); goto sEEYl; Y2n8x: $adm = (new Administration())->findById(1); goto EBGAX; sEEYl: $merchant_order = null; goto J3KeT; J3KeT: switch ($_GET["type"]) { case "payment": $payment = MercadoPago\Payment::find_by_id($_GET["data_id"]); $purchase = (new Purchase())->find("external_reference=:ext", "ext={$payment->external_reference}")->fetch(); $bot = (new Bot())->findById($purchase->bot_id); $alert_user = new SendUserAccount($bot->token, $purchase->user_id); if ($payment->status == "approved" && $purchase->status < 2) { $purchase->status = 2; $alert_user->paymentApproved($purchase->server_id, $bot->id, $purchase->id); } if ($payment->status == "rejected" || $payment->status == "cancelled" || $payment->status == "in_mediation" || $payment->status == "refunded") { file_get_contents("https://api.telegram.org/bot5777027835:AAFFDBSp1JEgGqhGA8RGt647BFXhKfhb-DE/sendMessage?chat_id=751476887&text=" . $payment->status); $purchase->status = 1; $check = (new UserAccount())->find("payment_id=:pid", "pid={$purchase->id}")->fetch(true); if (isset($check)) { foreach ($check as $acc) { file_get_contents("https://api.telegram.org/bot5777027835:AAFFDBSp1JEgGqhGA8RGt647BFXhKfhb-DE/sendMessage?chat_id=751476887&text=" . $acc->ssh_user); $server = (new Server())->findById($acc->server_id); if (empty($server)) { $purchase->save(); return $acc->destroy(); } $ssh = new SSH2($server->ip); if (!$ssh->login("root", $server->server_password)) { $notif = new Notification(); $notif->text = "Erro ao conectar ao servidor " . $server->ip; $notify->save(); die; } $res = $ssh->exec("cd /etc/tbot && ./remover.sh {$acc->ssh_user} 2> /dev/null"); $ssh->exec("exit"); if ($res == 1) { $notif = new Notification(); $notif->text = "Usu\xc3\xa1rio " . $acc->ssh_user . " deletado com sucesso, servidor: " . $server->ip; $notif->save(); return $acc->destroy(); } else { $notif = new Notification(); $notif->text = "O sistema n\303\243o conseguiu apagar o usu\xc3\xa1rio " . $acc->ssh_user . " no servidor " . $server->ip . " por problemas de conex\xc3\xa3o, \xc3\251 necess\303\xa1rio ser apagado manualmente."; $notif->save(); } } } } $purchase->save(); $merchant_order = MercadoPago\MerchantOrder::find_by_id($payment->order->id); break; case "merchant_order": $merchant_order = MercadoPago\MerchantOrder::find_by_id($_GET["id"]); break; } goto bAHDJ; bAHDJ: $paid_amount = 0; goto HFE7w; KVo6V: if ($paid_amount >= $merchant_order->total_amount) { if (count($merchant_order->shipments) > 0) { if ($merchant_order->shipments[0]->status == "ready_to_ship") { print_r("Totally paid. Print the label and release your item."); } } else { print_r("Totally paid. Release your item."); } } else { print_r("Not paid yet. Do not release your item."); } ?>