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 namespace App\Http\Controllers; use App\Http\Controllers\Controller; use App\Model..
Decoded Output download
<?php
namespace App\Http\Controllers; use App\Http\Controllers\Controller; use App\Models\Admin; use App\Models\Deposit; use App\Models\Gateway; use App\Models\GeneralSetting; use App\Models\Payment; use App\Models\Plan; use App\Models\Transaction; use App\Models\User; use App\Notifications\DepositNotification; use Auth; use Carbon\Carbon; use GuzzleHttp\Client; use Illuminate\Http\Request; use Illuminate\Support\Str; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; class PaymentController extends Controller { public function __construct() { $general = GeneralSetting::first(); $this->template = $general->theme == 1 ? "frontend." : "theme{$general->theme}."; } public function gateways(Request $request, $id) { $plan = Plan::findOrFail($id); $general = GeneralSetting::first(); $plan_exist = Payment::where("plan_id", $id)->where("user_id", Auth::id())->where("next_payment_date", "!=", null)->where("payment_status", 1)->count(); if ($plan_exist < $plan->invest_limit) { $gateways = Gateway::where("status", 1)->latest()->get(); $pageTitle = "Payment Methods"; return view($this->template . "user.gateway.gateways", compact("gateways", "pageTitle", "plan")); } return redirect()->back()->with("error", "Max Invest Limit exceeded"); } public function paynow(Request $request) { $request->validate(array("amount" => "required|gte:0")); if ($request->gateway_type == 1 && $request->gateway_name == "Bank") { $gateway = Gateway::where("status", 1)->findOrFail($request->id); $trx = strtoupper(Str::random()); $final_amount = $request->amount * $gateway->rate + $gateway->charge; if (isset($request->type) && $request->type == "deposit") { $deposit = Deposit::create(array("gateway_id" => $gateway->id, "user_id" => auth()->id(), "transaction_id" => $trx, "amount" => $request->amount, "rate" => $gateway->rate, "charge" => $gateway->charge, "final_amount" => $final_amount, "payment_status" => 0, "payment_type" => 1)); session()->put("trx", $trx); session()->put("type", "deposit"); return redirect()->route("user.gateway.details", $gateway->id); } $plan_id = Plan::with("time")->findOrFail($request->plan_id); if ($plan_id->amount_type == 0) { if ($plan_id->maximum_amount) { if ($request->amount > $plan_id->maximum_amount) { return redirect()->back()->with("error", "Maximum Invest Limit " . number_format($plan_id->maximum_amount, 2)); } } if ($plan_id->minimum_amount) { if ($request->amount < $plan_id->minimum_amount) { return redirect()->back()->with("error", "Minimum Invest Limit " . number_format($plan_id->minimum_amount, 2)); } } } if ($plan_id->amount_type == 1) { if ($plan_id->amount) { if ($request->amount != $plan_id->amount) { return redirect()->back()->with("error", "Fixed Invest Limit " . number_format($plan_id->amount, 2)); } } } $previousInvestment = Payment::where("user_id", auth()->id())->where("payment_status", 1)->orderBy("amount", "desc")->first(); if ($previousInvestment && $plan_id->amount_increase) { if ($request->amount <= $previousInvestment->amount) { return redirect()->back()->with("error", "Your new investment must be greater than your previous investment of " . number_format($previousInvestment->amount, 2)); } } $next_payment_date = Carbon::now()->addHours($plan_id->time->time); $currentDate = Carbon::now(); $sevenDaysAfter = $currentDate->addDays(7); $payment = Payment::create(array("plan_id" => $plan_id->id, "gateway_id" => $gateway->id, "user_id" => auth()->id(), "transaction_id" => $trx, "amount" => $request->amount, "rate" => $gateway->rate, "charge" => $gateway->charge, "final_amount" => $final_amount, "payment_status" => 0, "is_processed" => 0, "pay_count" => $plan_id->how_many_time, "maturation_date" => $sevenDaysAfter, "capital_back" => $plan_id->capital_back, "compounding" => $plan_id->compounding, "plan_type" => $plan_id->plan_type)); session()->put("trx", $trx); session()->forget("type"); return redirect()->route("user.gateway.details", $gateway->id); } $general = GeneralSetting::first(); $gateway = Gateway::where("status", 1)->findOrFail($request->id); $trx = strtoupper(Str::random()); $client = new Client(); $baseCallbackUrl = "https://riverlinecapital.com/deposit/methodDeposit"; $data = array("amount" => $request->total_amount, "charge" => $gateway->charge, "gateway_name" => $gateway->gateway_parameters->gateway_currency, "pay_currency" => $general->site_currency, "pay_amount" => $request->finalAmountinGateway, "user_id" => auth()->user()->id, "transaction_id" => $trx, "type" => isset($request->type) && $request->type == "deposit" ?? "deposit"); $callbackData = array("user_id" => auth()->user()->id, "transaction_id" => $trx, "address_out" => $gateway->address, "data" => $data); $encodedCallbackUrl = $baseCallbackUrl . "?" . http_build_query($callbackData); if ($gateway->gateway_parameters->gateway_currency == "btc" || $gateway->gateway_parameters->gateway_currency == "eth") { $priority = "fast"; } else { $priority = "100%"; } $query = array("callback" => $encodedCallbackUrl, "address" => $gateway->address, "pending" => "1", "confirmations" => "1", "email" => $general->site_email, "post" => 1, "priority" => $priority ?? '', "multi_token" => "0", "multi_chain" => "0", "convert" => "1"); $response = $client->request("GET", "https://api.cryptapi.io/" . $gateway->gateway_parameters->gateway_currency . "/create", array("query" => $query)); if ($response->getStatusCode() !== 200) { return back()->withErrors(array("error" => "Request failed with status code: " . $response->getStatusCode())); } else { $responseBody = $response->getBody()->getContents(); $responseData = json_decode($responseBody, true); $send_address = $responseData["address_in"]; if ($request->type == "deposit") { $deposit = Deposit::create(array("gateway_id" => $gateway->id, "user_id" => auth()->id(), "transaction_id" => $trx, "amount" => $request->amount, "rate" => $gateway->rate, "charge" => $gateway->charge, "final_amount" => $request->total_amount, "payment_status" => 2, "payment_type" => 0, "gateway_currency" => $gateway->gateway_parameters->gateway_currency, "finalAmountinGateway" => $request->finalAmountinGateway, "generated_address" => $send_address)); session()->put("trx", $trx); session()->put("type", "deposit"); } else { $plan_id = Plan::with("time")->findOrFail($request->plan_id); if ($plan_id->amount_type == 0) { if ($plan_id->maximum_amount && $request->amount > $plan_id->maximum_amount) { return redirect()->back()->with("error", "Maximum Invest Limit " . number_format($plan_id->maximum_amount, 2)); } if ($plan_id->minimum_amount && $request->amount < $plan_id->minimum_amount) { return redirect()->back()->with("error", "Minimum Invest Limit " . number_format($plan_id->minimum_amount, 2)); } } if ($plan_id->amount_type == 1 && $request->amount != $plan_id->amount) { return redirect()->back()->with("error", "Fixed Invest Limit " . number_format($plan_id->amount, 2)); } $previousInvestment = Payment::where("user_id", auth()->id())->where("payment_status", 1)->orderBy("amount", "desc")->first(); if ($previousInvestment && $plan_id->amount_increase) { if ($request->amount <= $previousInvestment->amount) { return redirect()->back()->with("error", "Your new investment must be greater than your previous investment of " . number_format($previousInvestment->amount, 2)); } } $next_payment_date = Carbon::now()->addHours($plan_id->time->time); $currentDate = Carbon::now(); $sevenDaysAfter = $currentDate->addDays(7); $payment = Payment::create(array("plan_id" => $plan_id->id, "gateway_id" => $gateway->id, "user_id" => auth()->id(), "transaction_id" => $trx, "amount" => $request->amount, "rate" => $gateway->rate, "charge" => $gateway->charge, "final_amount" => $request->total_amount, "btc_amount" => $request->finalAmountinGateway, "btc_wallet" => $send_address, "payment_status" => 0, "is_processed" => 0, "maturation_date" => $sevenDaysAfter, "capital_back" => $plan_id->capital_back, "compounding" => $plan_id->compounding, "pay_count" => $plan_id->how_many_time, "plan_type" => $plan_id->plan_type)); session()->put("trx", $trx); session()->forget("type"); } session()->put("send_address", $send_address); return redirect()->route("user.qrcode"); } } public function showQRCode() { $trx = session()->get("trx"); $send_address = session()->get("send_address"); if (!$trx || !$send_address) { return redirect()->route("user.dashboard")->withErrors(array("error" => "Invalid session data.")); } $deposit = Deposit::where("transaction_id", $trx)->first(); $payment = Payment::where("transaction_id", $trx)->first(); if (!$deposit && !$payment) { return redirect()->route("user.dashboard")->withErrors(array("error" => "Transaction not found.")); } return view($this->template . "user.gateway.qrcode", compact("trx", "send_address", "deposit", "payment")); } public function gatewaysDetails($id) { $gateway = Gateway::where("status", 1)->findOrFail($id); $general = GeneralSetting::first(); if (session("type") == "deposit") { $deposit = Deposit::where("transaction_id", session("trx"))->firstOrFail(); } else { $deposit = Payment::where("transaction_id", session("trx"))->firstOrFail(); } $pageTitle = $gateway->gateway_name . " Payment Details"; if ($gateway->gateway_name == "vouguepay") { $vouguePayParams["marchant_id"] = $gateway->gateway_parameters->vouguepay_merchant_id; $vouguePayParams["redirect_url"] = route("user.vouguepay.redirect"); $vouguePayParams["currency"] = $gateway->gateway_parameters->gateway_currency; $vouguePayParams["merchant_ref"] = $deposit->transaction_id; $vouguePayParams["memo"] = "Payment"; $vouguePayParams["store_id"] = $deposit->user_id; $vouguePayParams["loadText"] = $deposit->transaction_id; $vouguePayParams["amount"] = $deposit->final_amount; $vouguePayParams = json_decode(json_encode($vouguePayParams)); return view($this->template . "user.gateway.{$gateway->gateway_name}", compact("gateway", "pageTitle", "deposit", "vouguePayParams")); } if ($gateway->is_created) { return view($this->template . "user.gateway.gateway_manual", compact("gateway", "pageTitle", "deposit")); } if (strstr($gateway->gateway_name, "gourl")) { return view($this->template . "user.gateway.gourl", compact("gateway", "pageTitle", "deposit")); } return view($this->template . "user.gateway.{$gateway->gateway_name}", compact("gateway", "pageTitle", "deposit")); } public function gatewayRedirect(Request $request, $id) { $gateway = Gateway::where("status", 1)->findOrFail($id); if (session("type") == "deposit") { $deposit = Deposit::where("transaction_id", session("trx"))->firstOrFail(); } else { $deposit = Payment::where("transaction_id", session("trx"))->firstOrFail(); } if ($gateway->is_created) { $new = __NAMESPACE__ . "\Gateway\" . "manual\ProcessController"; } else { if (strstr($gateway->gateway_name, "gourl")) { $new = __NAMESPACE__ . "\Gateway\" . "gourl" . "\ProcessController"; } else { $new = __NAMESPACE__ . "\Gateway\" . $gateway->gateway_name . "\ProcessController"; } } $data = $new::process($request, $gateway, $deposit->final_amount, $deposit); if ($gateway->gateway_name == "mercadopago") { return redirect()->to($data["redirect_url"]); } if (strstr($gateway->gateway_name, "gourl")) { return redirect()->to($data); } if ($gateway->gateway_name == "nowpayments") { return redirect()->to($data->invoice_url); } if ($gateway->gateway_name == "mollie") { return redirect()->to($data["redirect_url"]); } if ($gateway->gateway_name == "paghiper") { if (isset($data["status"]) && $data["status"] == false) { return redirect()->route("user.investmentplan")->with("error", "Something Went Wrong"); } return redirect()->to($data); } if ($gateway->gateway_name == "coinpayments") { return view($data["view"])->with($data); } if ($gateway->gateway_name == "paypal") { $data = json_decode($data); return redirect()->to($data->links[1]->href); } if ($gateway->gateway_name == "paytm") { return view($this->template . "user.gateway.auto", compact("data")); } $notify[] = array("success", "Your Payment is Successfully Recieved"); return redirect()->route("user.dashboard")->withNotify($notify); } public static function updateUserData($deposit, $fee_amount, $transaction) { $general = GeneralSetting::first(); $admin = Admin::first(); $user = auth()->user(); if (session("type") == "deposit") { $user->balance = $user->balance + $deposit->amount; $user->save(); $admin->notify(new DepositNotification($user, $deposit)); } $deposit->payment_status = 1; $deposit->save(); if (!(session("type") == "deposit")) { refferMoney(auth()->id(), $deposit->user->refferedBy, "invest", $deposit->amount, $deposit->plan->id); } session()->forget("type"); Transaction::create(array("trx" => $deposit->transaction_id, "gateway_id" => $deposit->gateway_id, "amount" => $deposit->amount, "currency" => @$general->site_currency, "details" => "Payment Successfull", "charge" => $fee_amount, "type" => "-", "gateway_transaction" => $transaction, "user_id" => auth()->id(), "payment_status" => 1)); sendMail("PAYMENT_SUCCESSFULL", array("plan" => $deposit->plan->plan_name ?? "Deposit", "trx" => $transaction, "amount" => $deposit->amount, "currency" => $general->site_currency), $deposit->user); } public function methodDepositUpdate(Request $request) { $datas = $request->data; $general = GeneralSetting::first(); $user = User::findorfail($datas["user_id"]); if ($datas["type"] == "deposit" || $datas["type"] == 1) { $deposit = Deposit::where("transaction_id", $datas["transaction_id"])->firstOrFail(); $user->balance += $deposit->amount; $user->save(); $deposit->payment_status = 1; $deposit->save(); Transaction::create(array("trx" => $deposit->transaction_id, "gateway_id" => $deposit->gateway_id, "amount" => $deposit->amount, "currency" => @$general->site_currency, "details" => "Payment Successful", "charge" => $deposit->charge, "type" => "-", "gateway_transaction" => $datas["transaction_id"], "user_id" => $user->id, "payment_status" => 1)); return "ok"; } $payment = Payment::where("transaction_id", $datas["transaction_id"])->firstOrFail(); $payment->payment_status = 1; $payment->save(); refferMoney($user->id, $payment->user->referredBy, "invest", $payment->amount, $payment->plan->id); Transaction::create(array("trx" => $payment->transaction_id, "gateway_id" => $payment->gateway_id, "amount" => $payment->amount, "currency" => @$general->site_currency, "details" => "Payment Successful", "charge" => $payment->charge, "type" => "-", "gateway_transaction" => $datas["transaction_id"], "user_id" => $user->id, "payment_status" => 1)); sendMail("PAYMENT_SUCCESSFUL", array("plan" => $payment->plan->plan_name, "trx" => $datas["transaction_id"], "amount" => $payment->amount, "currency" => $general->site_currency), $payment->user); return "ok"; } } ?>
Did this file decode correctly?
Original Code
<?php
namespace App\Http\Controllers; use App\Http\Controllers\Controller; use App\Models\Admin; use App\Models\Deposit; use App\Models\Gateway; use App\Models\GeneralSetting; use App\Models\Payment; use App\Models\Plan; use App\Models\Transaction; use App\Models\User; use App\Notifications\DepositNotification; use Auth; use Carbon\Carbon; use GuzzleHttp\Client; use Illuminate\Http\Request; use Illuminate\Support\Str; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Log; class PaymentController extends Controller { public function __construct() { $general = GeneralSetting::first(); $this->template = $general->theme == 1 ? "\146\x72\157\x6e\x74\145\156\x64\56" : "\164\x68\145\155\145{$general->theme}\x2e"; } public function gateways(Request $request, $id) { $plan = Plan::findOrFail($id); $general = GeneralSetting::first(); $plan_exist = Payment::where("\x70\154\141\156\x5f\x69\x64", $id)->where("\165\x73\145\x72\137\151\144", Auth::id())->where("\156\145\170\164\137\x70\141\x79\x6d\145\x6e\x74\137\144\141\x74\x65", "\x21\x3d", null)->where("\160\x61\171\x6d\x65\156\x74\137\163\164\141\x74\x75\163", 1)->count(); if ($plan_exist < $plan->invest_limit) { $gateways = Gateway::where("\x73\x74\141\x74\x75\163", 1)->latest()->get(); $pageTitle = "\120\x61\x79\155\145\x6e\164\40\115\x65\x74\150\x6f\144\x73"; return view($this->template . "\165\163\x65\162\x2e\147\x61\x74\145\x77\141\x79\56\x67\x61\x74\145\x77\x61\x79\x73", compact("\147\141\164\145\167\x61\x79\x73", "\x70\x61\147\x65\124\x69\x74\154\x65", "\x70\x6c\141\x6e")); } return redirect()->back()->with("\145\x72\162\157\162", "\x4d\x61\170\x20\111\x6e\x76\145\163\x74\x20\x4c\x69\x6d\151\x74\x20\x65\170\143\x65\145\x64\x65\x64"); } public function paynow(Request $request) { $request->validate(array("\x61\x6d\x6f\165\156\164" => "\162\145\161\x75\151\x72\x65\x64\174\x67\164\x65\72\x30")); if ($request->gateway_type == 1 && $request->gateway_name == "\102\x61\156\153") { $gateway = Gateway::where("\163\x74\x61\164\x75\163", 1)->findOrFail($request->id); $trx = strtoupper(Str::random()); $final_amount = $request->amount * $gateway->rate + $gateway->charge; if (isset($request->type) && $request->type == "\144\x65\160\157\163\x69\164") { $deposit = Deposit::create(array("\x67\141\164\x65\x77\x61\171\x5f\151\x64" => $gateway->id, "\x75\163\x65\162\137\151\x64" => auth()->id(), "\x74\162\x61\156\163\141\143\164\151\x6f\156\137\x69\x64" => $trx, "\x61\x6d\157\165\x6e\164" => $request->amount, "\162\141\x74\145" => $gateway->rate, "\x63\x68\x61\162\147\x65" => $gateway->charge, "\146\x69\156\x61\x6c\x5f\x61\x6d\x6f\165\156\164" => $final_amount, "\160\141\171\155\x65\x6e\x74\137\x73\164\x61\x74\165\163" => 0, "\x70\x61\x79\x6d\x65\x6e\164\137\x74\x79\x70\x65" => 1)); session()->put("\x74\x72\x78", $trx); session()->put("\x74\171\160\x65", "\x64\x65\x70\x6f\x73\151\164"); return redirect()->route("\x75\163\145\162\56\147\141\164\x65\x77\x61\x79\x2e\144\145\164\x61\x69\154\163", $gateway->id); } $plan_id = Plan::with("\164\151\155\145")->findOrFail($request->plan_id); if ($plan_id->amount_type == 0) { if ($plan_id->maximum_amount) { if ($request->amount > $plan_id->maximum_amount) { return redirect()->back()->with("\x65\162\162\x6f\162", "\115\141\x78\x69\x6d\165\x6d\40\111\x6e\166\x65\x73\x74\x20\x4c\x69\x6d\x69\x74\x20" . number_format($plan_id->maximum_amount, 2)); } } if ($plan_id->minimum_amount) { if ($request->amount < $plan_id->minimum_amount) { return redirect()->back()->with("\145\x72\x72\x6f\x72", "\x4d\151\156\151\155\165\155\x20\111\156\166\x65\x73\x74\40\114\x69\155\151\164\40" . number_format($plan_id->minimum_amount, 2)); } } } if ($plan_id->amount_type == 1) { if ($plan_id->amount) { if ($request->amount != $plan_id->amount) { return redirect()->back()->with("\x65\x72\x72\157\162", "\106\x69\170\x65\x64\40\111\x6e\166\145\x73\164\40\114\x69\155\151\x74\40" . number_format($plan_id->amount, 2)); } } } $previousInvestment = Payment::where("\x75\163\145\162\x5f\x69\144", auth()->id())->where("\x70\141\x79\155\x65\156\164\137\163\x74\141\x74\165\163", 1)->orderBy("\141\155\157\x75\156\x74", "\144\x65\x73\x63")->first(); if ($previousInvestment && $plan_id->amount_increase) { if ($request->amount <= $previousInvestment->amount) { return redirect()->back()->with("\145\162\x72\x6f\162", "\x59\157\165\162\40\156\x65\x77\x20\151\156\x76\x65\163\164\155\x65\x6e\x74\40\x6d\165\163\164\x20\142\145\x20\x67\162\x65\141\x74\x65\162\40\x74\x68\141\x6e\40\171\157\x75\x72\40\x70\x72\x65\x76\151\x6f\x75\x73\40\x69\x6e\x76\145\x73\164\155\x65\156\x74\40\x6f\146\40" . number_format($previousInvestment->amount, 2)); } } $next_payment_date = Carbon::now()->addHours($plan_id->time->time); $currentDate = Carbon::now(); $sevenDaysAfter = $currentDate->addDays(7); $payment = Payment::create(array("\x70\154\x61\156\x5f\x69\144" => $plan_id->id, "\x67\141\x74\x65\167\x61\x79\137\151\x64" => $gateway->id, "\x75\x73\x65\162\x5f\151\144" => auth()->id(), "\x74\x72\141\156\163\x61\x63\164\x69\157\x6e\137\151\144" => $trx, "\x61\x6d\157\165\x6e\x74" => $request->amount, "\162\x61\164\145" => $gateway->rate, "\143\150\141\162\147\x65" => $gateway->charge, "\146\151\156\x61\154\137\x61\155\x6f\165\156\x74" => $final_amount, "\160\141\171\155\x65\x6e\164\x5f\x73\164\x61\x74\x75\163" => 0, "\x69\x73\x5f\x70\162\157\143\x65\x73\x73\x65\144" => 0, "\x70\x61\171\137\x63\x6f\165\156\164" => $plan_id->how_many_time, "\x6d\x61\x74\x75\x72\141\x74\151\x6f\156\x5f\x64\x61\164\x65" => $sevenDaysAfter, "\x63\x61\160\x69\x74\x61\154\x5f\142\x61\x63\x6b" => $plan_id->capital_back, "\143\157\x6d\160\157\165\x6e\x64\151\156\x67" => $plan_id->compounding, "\160\x6c\x61\x6e\137\x74\171\x70\x65" => $plan_id->plan_type)); session()->put("\164\162\x78", $trx); session()->forget("\x74\x79\160\145"); return redirect()->route("\165\x73\x65\x72\x2e\147\x61\x74\x65\x77\141\x79\x2e\144\x65\x74\x61\x69\x6c\x73", $gateway->id); } $general = GeneralSetting::first(); $gateway = Gateway::where("\163\164\x61\x74\x75\x73", 1)->findOrFail($request->id); $trx = strtoupper(Str::random()); $client = new Client(); $baseCallbackUrl = "\150\164\x74\x70\163\72\x2f\x2f\x72\x69\x76\x65\162\154\x69\156\x65\143\141\160\151\x74\141\154\x2e\x63\157\x6d\x2f\144\x65\160\x6f\x73\151\x74\x2f\x6d\145\x74\150\157\144\x44\x65\160\157\x73\x69\164"; $data = array("\x61\x6d\x6f\165\156\x74" => $request->total_amount, "\143\150\x61\162\147\145" => $gateway->charge, "\x67\x61\x74\x65\167\141\171\x5f\x6e\x61\x6d\145" => $gateway->gateway_parameters->gateway_currency, "\x70\x61\x79\137\x63\x75\x72\162\x65\x6e\143\x79" => $general->site_currency, "\x70\x61\171\137\x61\x6d\157\165\x6e\164" => $request->finalAmountinGateway, "\165\x73\145\x72\137\151\x64" => auth()->user()->id, "\164\x72\x61\x6e\x73\141\x63\x74\151\157\156\x5f\151\x64" => $trx, "\x74\x79\x70\145" => isset($request->type) && $request->type == "\144\145\160\157\163\x69\164" ?? "\144\x65\x70\x6f\163\151\164"); $callbackData = array("\x75\163\145\x72\137\151\144" => auth()->user()->id, "\164\162\141\156\x73\141\143\164\151\x6f\x6e\137\x69\144" => $trx, "\141\x64\144\162\x65\x73\x73\x5f\x6f\165\164" => $gateway->address, "\144\141\164\x61" => $data); $encodedCallbackUrl = $baseCallbackUrl . "\x3f" . http_build_query($callbackData); if ($gateway->gateway_parameters->gateway_currency == "\x62\164\x63" || $gateway->gateway_parameters->gateway_currency == "\x65\164\x68") { $priority = "\x66\141\163\x74"; } else { $priority = "\61\x30\60\45"; } $query = array("\x63\141\154\x6c\142\141\x63\153" => $encodedCallbackUrl, "\141\x64\144\162\145\163\x73" => $gateway->address, "\160\145\156\144\x69\156\147" => "\61", "\143\x6f\156\146\151\x72\155\x61\x74\x69\x6f\x6e\x73" => "\61", "\145\155\x61\x69\154" => $general->site_email, "\x70\x6f\163\x74" => 1, "\160\x72\151\x6f\x72\151\164\x79" => $priority ?? '', "\x6d\x75\154\x74\x69\x5f\164\x6f\153\x65\x6e" => "\60", "\x6d\x75\x6c\x74\151\137\x63\150\141\151\156" => "\60", "\143\x6f\x6e\166\145\x72\164" => "\61"); $response = $client->request("\107\105\124", "\150\164\164\x70\x73\72\57\57\141\x70\151\x2e\143\162\x79\160\164\x61\160\151\56\151\157\57" . $gateway->gateway_parameters->gateway_currency . "\57\x63\162\145\x61\x74\x65", array("\x71\x75\x65\162\171" => $query)); if ($response->getStatusCode() !== 200) { return back()->withErrors(array("\x65\162\x72\157\x72" => "\122\145\161\165\145\163\x74\40\x66\141\x69\x6c\x65\x64\x20\x77\x69\164\x68\40\163\164\141\x74\165\x73\40\143\157\144\145\x3a\40" . $response->getStatusCode())); } else { $responseBody = $response->getBody()->getContents(); $responseData = json_decode($responseBody, true); $send_address = $responseData["\x61\x64\144\162\x65\163\163\137\151\x6e"]; if ($request->type == "\x64\145\x70\x6f\x73\x69\164") { $deposit = Deposit::create(array("\147\x61\164\145\x77\x61\171\137\151\144" => $gateway->id, "\x75\163\x65\x72\x5f\x69\144" => auth()->id(), "\x74\162\x61\156\x73\x61\x63\164\151\x6f\x6e\x5f\151\x64" => $trx, "\x61\155\x6f\165\x6e\x74" => $request->amount, "\x72\141\x74\145" => $gateway->rate, "\x63\150\x61\162\147\x65" => $gateway->charge, "\146\151\x6e\x61\154\137\141\x6d\157\165\x6e\x74" => $request->total_amount, "\160\x61\x79\x6d\145\156\164\x5f\x73\x74\x61\164\165\163" => 2, "\160\x61\x79\x6d\145\x6e\x74\x5f\x74\x79\160\x65" => 0, "\147\x61\164\145\x77\141\x79\137\143\x75\162\x72\145\x6e\x63\171" => $gateway->gateway_parameters->gateway_currency, "\146\151\156\141\x6c\x41\155\x6f\x75\156\164\151\x6e\107\141\x74\x65\167\x61\171" => $request->finalAmountinGateway, "\x67\145\x6e\145\162\141\x74\x65\x64\x5f\141\x64\x64\x72\145\x73\x73" => $send_address)); session()->put("\x74\x72\x78", $trx); session()->put("\164\171\x70\x65", "\x64\145\x70\157\x73\x69\164"); } else { $plan_id = Plan::with("\164\x69\155\145")->findOrFail($request->plan_id); if ($plan_id->amount_type == 0) { if ($plan_id->maximum_amount && $request->amount > $plan_id->maximum_amount) { return redirect()->back()->with("\145\162\x72\157\162", "\115\141\x78\151\x6d\165\x6d\x20\111\156\x76\x65\x73\x74\40\x4c\151\155\151\x74\x20" . number_format($plan_id->maximum_amount, 2)); } if ($plan_id->minimum_amount && $request->amount < $plan_id->minimum_amount) { return redirect()->back()->with("\x65\162\162\157\x72", "\115\151\x6e\x69\x6d\165\155\x20\111\x6e\166\145\163\x74\x20\114\x69\155\x69\x74\x20" . number_format($plan_id->minimum_amount, 2)); } } if ($plan_id->amount_type == 1 && $request->amount != $plan_id->amount) { return redirect()->back()->with("\145\x72\x72\x6f\162", "\106\x69\x78\145\x64\x20\x49\x6e\x76\145\163\164\40\114\x69\155\151\164\40" . number_format($plan_id->amount, 2)); } $previousInvestment = Payment::where("\165\x73\145\162\137\151\144", auth()->id())->where("\x70\x61\x79\x6d\x65\x6e\164\x5f\163\164\x61\x74\165\x73", 1)->orderBy("\x61\155\x6f\x75\156\164", "\144\x65\x73\x63")->first(); if ($previousInvestment && $plan_id->amount_increase) { if ($request->amount <= $previousInvestment->amount) { return redirect()->back()->with("\145\162\162\x6f\x72", "\x59\x6f\x75\162\x20\x6e\145\x77\x20\x69\156\166\145\163\164\x6d\145\156\x74\40\155\165\163\164\40\142\145\40\x67\x72\x65\141\x74\x65\x72\40\x74\x68\x61\x6e\x20\x79\x6f\x75\x72\x20\160\162\145\166\151\x6f\x75\163\40\x69\x6e\166\x65\x73\164\155\145\156\x74\x20\x6f\x66\x20" . number_format($previousInvestment->amount, 2)); } } $next_payment_date = Carbon::now()->addHours($plan_id->time->time); $currentDate = Carbon::now(); $sevenDaysAfter = $currentDate->addDays(7); $payment = Payment::create(array("\x70\154\141\156\137\151\x64" => $plan_id->id, "\x67\141\x74\145\x77\x61\x79\137\x69\x64" => $gateway->id, "\165\163\145\x72\x5f\x69\144" => auth()->id(), "\164\x72\x61\x6e\163\141\143\x74\151\x6f\x6e\137\151\x64" => $trx, "\x61\155\x6f\165\x6e\164" => $request->amount, "\162\x61\x74\x65" => $gateway->rate, "\x63\x68\x61\162\147\145" => $gateway->charge, "\x66\151\x6e\x61\154\x5f\x61\x6d\x6f\x75\156\x74" => $request->total_amount, "\x62\164\143\x5f\141\x6d\x6f\x75\156\164" => $request->finalAmountinGateway, "\142\x74\x63\x5f\167\x61\154\x6c\x65\164" => $send_address, "\160\x61\x79\x6d\x65\156\x74\137\x73\x74\x61\164\165\163" => 0, "\151\x73\137\x70\162\x6f\x63\x65\x73\163\x65\144" => 0, "\155\141\164\165\x72\141\x74\151\157\156\137\144\x61\164\x65" => $sevenDaysAfter, "\143\x61\x70\151\164\x61\154\137\x62\x61\143\x6b" => $plan_id->capital_back, "\x63\157\x6d\x70\x6f\165\156\144\151\156\x67" => $plan_id->compounding, "\x70\141\171\137\143\157\x75\156\x74" => $plan_id->how_many_time, "\x70\154\141\156\137\164\x79\x70\145" => $plan_id->plan_type)); session()->put("\164\x72\170", $trx); session()->forget("\x74\171\x70\x65"); } session()->put("\163\x65\156\x64\137\x61\144\x64\x72\x65\x73\x73", $send_address); return redirect()->route("\x75\163\x65\x72\x2e\161\x72\143\157\x64\145"); } } public function showQRCode() { $trx = session()->get("\164\x72\x78"); $send_address = session()->get("\x73\145\x6e\144\x5f\141\x64\x64\x72\x65\163\163"); if (!$trx || !$send_address) { return redirect()->route("\165\163\x65\162\56\x64\141\163\x68\142\157\141\162\144")->withErrors(array("\145\162\x72\x6f\x72" => "\x49\156\166\141\154\x69\144\x20\163\145\x73\163\151\x6f\156\40\x64\141\164\141\x2e")); } $deposit = Deposit::where("\x74\162\141\x6e\x73\141\143\x74\151\157\156\x5f\x69\x64", $trx)->first(); $payment = Payment::where("\164\x72\141\156\163\x61\x63\x74\151\157\x6e\137\151\x64", $trx)->first(); if (!$deposit && !$payment) { return redirect()->route("\165\163\145\x72\x2e\x64\141\163\x68\x62\x6f\x61\x72\x64")->withErrors(array("\x65\162\162\157\x72" => "\124\x72\141\156\x73\141\x63\x74\x69\x6f\x6e\x20\x6e\157\164\40\146\157\x75\x6e\x64\56")); } return view($this->template . "\165\163\145\x72\x2e\147\x61\x74\x65\167\141\171\x2e\161\162\143\157\144\x65", compact("\164\162\170", "\x73\145\x6e\x64\137\x61\x64\x64\162\145\x73\163", "\144\145\x70\157\163\x69\x74", "\160\x61\171\x6d\145\x6e\164")); } public function gatewaysDetails($id) { $gateway = Gateway::where("\163\164\x61\164\x75\163", 1)->findOrFail($id); $general = GeneralSetting::first(); if (session("\164\171\x70\145") == "\144\145\160\157\x73\x69\x74") { $deposit = Deposit::where("\x74\162\141\x6e\x73\x61\143\164\x69\x6f\x6e\137\x69\x64", session("\164\162\170"))->firstOrFail(); } else { $deposit = Payment::where("\x74\162\141\156\x73\141\143\164\x69\157\156\137\x69\144", session("\x74\162\170"))->firstOrFail(); } $pageTitle = $gateway->gateway_name . "\40\x50\141\171\x6d\145\x6e\164\x20\x44\145\164\x61\151\x6c\x73"; if ($gateway->gateway_name == "\166\157\x75\147\165\x65\160\x61\171") { $vouguePayParams["\x6d\x61\x72\143\150\141\x6e\x74\137\x69\144"] = $gateway->gateway_parameters->vouguepay_merchant_id; $vouguePayParams["\x72\x65\144\151\x72\x65\x63\x74\137\x75\x72\154"] = route("\x75\163\x65\x72\56\166\157\x75\x67\165\x65\160\141\171\56\x72\145\144\x69\162\145\143\164"); $vouguePayParams["\143\165\x72\162\145\156\x63\x79"] = $gateway->gateway_parameters->gateway_currency; $vouguePayParams["\155\145\x72\x63\x68\141\x6e\x74\x5f\x72\145\146"] = $deposit->transaction_id; $vouguePayParams["\155\x65\155\157"] = "\120\x61\x79\x6d\x65\156\x74"; $vouguePayParams["\163\164\157\x72\x65\137\x69\x64"] = $deposit->user_id; $vouguePayParams["\x6c\157\141\144\x54\145\170\164"] = $deposit->transaction_id; $vouguePayParams["\x61\155\x6f\x75\156\164"] = $deposit->final_amount; $vouguePayParams = json_decode(json_encode($vouguePayParams)); return view($this->template . "\x75\x73\145\x72\56\x67\x61\164\x65\x77\141\171\x2e{$gateway->gateway_name}", compact("\x67\141\x74\145\167\x61\x79", "\160\x61\x67\x65\x54\151\x74\x6c\145", "\x64\145\x70\157\163\151\164", "\166\157\165\x67\x75\x65\x50\141\x79\120\x61\162\x61\155\x73")); } if ($gateway->is_created) { return view($this->template . "\165\x73\145\x72\56\147\x61\164\145\167\141\x79\x2e\147\x61\164\x65\x77\x61\x79\137\x6d\x61\156\165\141\154", compact("\x67\141\164\x65\x77\141\x79", "\x70\141\147\145\124\x69\x74\x6c\145", "\x64\145\x70\157\163\x69\164")); } if (strstr($gateway->gateway_name, "\x67\157\165\x72\154")) { return view($this->template . "\x75\x73\x65\162\x2e\147\x61\164\x65\x77\141\x79\56\x67\157\x75\x72\154", compact("\x67\141\x74\145\x77\x61\x79", "\x70\141\147\x65\x54\x69\164\x6c\x65", "\x64\x65\160\x6f\163\x69\164")); } return view($this->template . "\x75\163\145\162\56\x67\x61\x74\x65\167\141\x79\x2e{$gateway->gateway_name}", compact("\147\x61\164\145\x77\141\171", "\160\141\x67\145\124\x69\x74\x6c\x65", "\144\145\160\x6f\163\x69\x74")); } public function gatewayRedirect(Request $request, $id) { $gateway = Gateway::where("\x73\x74\x61\164\165\x73", 1)->findOrFail($id); if (session("\164\171\x70\145") == "\144\x65\x70\x6f\163\x69\164") { $deposit = Deposit::where("\x74\x72\141\156\x73\141\x63\164\151\157\156\x5f\151\x64", session("\164\x72\170"))->firstOrFail(); } else { $deposit = Payment::where("\x74\162\x61\x6e\x73\141\x63\164\151\x6f\x6e\137\151\x64", session("\x74\162\x78"))->firstOrFail(); } if ($gateway->is_created) { $new = __NAMESPACE__ . "\x5c\107\141\164\145\167\x61\x79\134" . "\x6d\x61\x6e\x75\141\x6c\134\x50\x72\157\143\x65\163\x73\x43\157\x6e\164\162\157\154\x6c\x65\162"; } else { if (strstr($gateway->gateway_name, "\147\x6f\x75\162\x6c")) { $new = __NAMESPACE__ . "\134\x47\x61\x74\x65\x77\141\171\134" . "\x67\157\x75\x72\x6c" . "\134\x50\162\x6f\x63\x65\x73\163\103\x6f\156\164\x72\157\x6c\x6c\x65\x72"; } else { $new = __NAMESPACE__ . "\x5c\107\141\x74\145\167\x61\x79\x5c" . $gateway->gateway_name . "\x5c\x50\x72\x6f\x63\145\x73\x73\x43\157\156\164\162\x6f\154\x6c\145\162"; } } $data = $new::process($request, $gateway, $deposit->final_amount, $deposit); if ($gateway->gateway_name == "\155\145\x72\143\141\144\157\x70\x61\x67\x6f") { return redirect()->to($data["\x72\145\x64\151\x72\x65\x63\x74\x5f\165\x72\x6c"]); } if (strstr($gateway->gateway_name, "\x67\157\165\x72\154")) { return redirect()->to($data); } if ($gateway->gateway_name == "\156\157\167\160\x61\x79\155\145\x6e\x74\163") { return redirect()->to($data->invoice_url); } if ($gateway->gateway_name == "\155\x6f\154\x6c\151\x65") { return redirect()->to($data["\x72\145\144\151\162\145\x63\x74\137\165\x72\154"]); } if ($gateway->gateway_name == "\x70\x61\x67\150\x69\160\x65\162") { if (isset($data["\x73\164\x61\164\165\163"]) && $data["\163\164\x61\164\x75\x73"] == false) { return redirect()->route("\x75\163\x65\x72\56\x69\x6e\x76\x65\x73\164\x6d\x65\156\x74\x70\x6c\141\156")->with("\x65\162\162\157\162", "\x53\x6f\155\145\x74\x68\x69\156\147\x20\127\145\x6e\x74\40\x57\x72\157\x6e\147"); } return redirect()->to($data); } if ($gateway->gateway_name == "\x63\x6f\151\156\160\x61\171\155\145\x6e\x74\x73") { return view($data["\x76\x69\x65\x77"])->with($data); } if ($gateway->gateway_name == "\x70\141\171\x70\x61\154") { $data = json_decode($data); return redirect()->to($data->links[1]->href); } if ($gateway->gateway_name == "\160\141\171\x74\155") { return view($this->template . "\165\x73\x65\162\56\147\141\x74\x65\167\x61\x79\56\x61\x75\x74\x6f", compact("\144\141\x74\141")); } $notify[] = array("\x73\x75\x63\x63\x65\163\163", "\131\x6f\165\162\40\120\x61\x79\x6d\x65\156\x74\40\151\x73\40\123\x75\143\x63\x65\x73\x73\x66\x75\x6c\154\171\x20\x52\x65\143\151\145\x76\145\x64"); return redirect()->route("\x75\x73\x65\162\x2e\144\141\x73\150\142\x6f\141\x72\144")->withNotify($notify); } public static function updateUserData($deposit, $fee_amount, $transaction) { $general = GeneralSetting::first(); $admin = Admin::first(); $user = auth()->user(); if (session("\x74\x79\x70\145") == "\144\x65\160\x6f\x73\x69\x74") { $user->balance = $user->balance + $deposit->amount; $user->save(); $admin->notify(new DepositNotification($user, $deposit)); } $deposit->payment_status = 1; $deposit->save(); if (!(session("\164\x79\160\145") == "\144\145\x70\157\163\x69\164")) { refferMoney(auth()->id(), $deposit->user->refferedBy, "\x69\156\x76\145\x73\164", $deposit->amount, $deposit->plan->id); } session()->forget("\x74\x79\160\145"); Transaction::create(array("\x74\162\x78" => $deposit->transaction_id, "\147\141\x74\x65\x77\141\171\137\151\144" => $deposit->gateway_id, "\x61\155\157\165\156\x74" => $deposit->amount, "\143\165\162\162\x65\156\143\x79" => @$general->site_currency, "\x64\x65\x74\141\151\x6c\x73" => "\x50\141\171\x6d\x65\x6e\x74\40\x53\165\143\x63\145\163\163\x66\x75\x6c\154", "\143\x68\141\162\147\145" => $fee_amount, "\x74\x79\160\x65" => "\x2d", "\x67\141\164\145\x77\x61\x79\137\164\162\141\156\163\141\x63\164\151\x6f\156" => $transaction, "\165\163\145\x72\137\151\144" => auth()->id(), "\x70\141\x79\155\x65\156\x74\137\x73\x74\x61\x74\165\163" => 1)); sendMail("\120\101\131\115\x45\x4e\x54\137\123\x55\x43\x43\x45\123\x53\106\125\x4c\x4c", array("\160\154\141\156" => $deposit->plan->plan_name ?? "\x44\x65\160\157\163\x69\164", "\164\162\x78" => $transaction, "\141\155\157\x75\x6e\164" => $deposit->amount, "\143\x75\162\x72\x65\156\x63\171" => $general->site_currency), $deposit->user); } public function methodDepositUpdate(Request $request) { $datas = $request->data; $general = GeneralSetting::first(); $user = User::findorfail($datas["\165\163\145\162\137\151\144"]); if ($datas["\164\x79\x70\x65"] == "\144\x65\x70\157\163\x69\x74" || $datas["\164\x79\x70\145"] == 1) { $deposit = Deposit::where("\164\x72\x61\x6e\x73\141\x63\x74\x69\157\156\137\151\x64", $datas["\x74\x72\x61\x6e\163\141\143\x74\151\x6f\156\x5f\x69\144"])->firstOrFail(); $user->balance += $deposit->amount; $user->save(); $deposit->payment_status = 1; $deposit->save(); Transaction::create(array("\x74\x72\x78" => $deposit->transaction_id, "\x67\141\x74\x65\167\x61\171\x5f\151\144" => $deposit->gateway_id, "\x61\155\157\165\x6e\164" => $deposit->amount, "\143\165\162\162\145\x6e\x63\171" => @$general->site_currency, "\x64\145\164\x61\151\154\163" => "\x50\141\171\x6d\145\156\x74\x20\x53\x75\143\143\x65\163\x73\146\165\154", "\x63\150\141\x72\x67\x65" => $deposit->charge, "\164\171\160\x65" => "\x2d", "\147\x61\x74\x65\x77\x61\171\137\x74\162\141\x6e\163\x61\143\x74\151\x6f\x6e" => $datas["\x74\x72\x61\x6e\163\x61\x63\164\151\157\x6e\x5f\151\x64"], "\165\x73\145\x72\x5f\151\x64" => $user->id, "\x70\141\x79\155\145\156\x74\x5f\163\164\x61\164\x75\x73" => 1)); return "\x6f\x6b"; } $payment = Payment::where("\x74\x72\x61\x6e\x73\x61\x63\164\151\x6f\x6e\137\x69\144", $datas["\x74\x72\141\x6e\163\141\x63\x74\151\157\x6e\x5f\x69\144"])->firstOrFail(); $payment->payment_status = 1; $payment->save(); refferMoney($user->id, $payment->user->referredBy, "\x69\156\166\145\163\x74", $payment->amount, $payment->plan->id); Transaction::create(array("\x74\x72\170" => $payment->transaction_id, "\x67\x61\164\x65\x77\x61\171\137\x69\x64" => $payment->gateway_id, "\141\x6d\x6f\x75\156\x74" => $payment->amount, "\x63\165\x72\162\145\156\143\171" => @$general->site_currency, "\x64\145\164\141\x69\x6c\x73" => "\120\x61\x79\x6d\145\x6e\164\40\x53\x75\143\143\145\x73\163\146\165\154", "\143\150\141\162\x67\x65" => $payment->charge, "\164\x79\160\145" => "\55", "\x67\x61\164\x65\x77\x61\171\x5f\x74\162\x61\156\x73\x61\x63\x74\151\x6f\x6e" => $datas["\164\x72\x61\x6e\x73\141\143\x74\151\x6f\156\x5f\151\x64"], "\165\163\145\x72\137\151\x64" => $user->id, "\160\141\171\155\x65\x6e\164\x5f\163\164\141\164\165\163" => 1)); sendMail("\x50\x41\x59\115\105\x4e\x54\x5f\x53\x55\103\x43\105\x53\x53\x46\x55\x4c", array("\160\154\141\156" => $payment->plan->plan_name, "\164\x72\x78" => $datas["\164\162\x61\x6e\x73\141\x63\x74\151\x6f\x6e\137\151\x64"], "\141\155\x6f\165\156\164" => $payment->amount, "\143\x75\162\x72\145\x6e\143\171" => $general->site_currency), $payment->user); return "\157\153"; } }
Function Calls
None |
Stats
MD5 | 491718a3f12b5e0901370326e91c5861 |
Eval Count | 0 |
Decode Time | 87 ms |