⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.77
Server IP:
13.127.59.50
Server:
Linux ip-172-31-46-210 5.15.0-1033-aws #37~20.04.1-Ubuntu SMP Fri Mar 17 11:39:30 UTC 2023 x86_64
Server Software:
Apache/2.4.41 (Ubuntu)
PHP Version:
7.4.3-4ubuntu2.29
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
ecommerce_pg
/
app
/
Http
/
Controllers
/
View File Name :
HomeController.php
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Models\VpaDetails; use App\Models\Transaction; use Illuminate\Support\Facades\Hash; use App\Http\Controllers\SpinsPayoutController; use App\Http\Controllers\FonePaisaController; use App\Http\Controllers\FonePaisaTxnController; use App\Http\Controllers\PayInstantPayoutController; use DB; use App\Models\TransactionNew; // use App\Models\Transaction; class HomeController extends Controller { /** * Create a new controller instance. * * @return void */ public function __construct() { // $this->middleware('auth'); } public function getAccount($type=3) { $bank_credentials = \DB::table('bank_credentials') ->where('status',$type) ->orderBy('updated_at','desc') ->first(); $statusCode = 201; dd(strtotime('-30 minutes') <= strtotime($bank_credentials->updated_at)); if ($bank_credentials&&($type = 1 || strtotime('-30 minutes') <= strtotime($bank_credentials->updated_at) )) { $statusCode = 200; $data = [ 'username' => $bank_credentials->username, // 'B584935072', 'password' => $bank_credentials->password, // 'Divya@1234', ]; } return response([ 'status' => $statusCode, 'data' => $data, ]); } public function redirect(Request $request) { $params = $request->all(); return view('payments.deposit.ui1',compact('params')); } public function test() { $y=100; return view('test/test1/success'); } public function response(Request $request) { $endpoint = 'https://11dreamteam.com/pg/deposit/response'; $client = new \GuzzleHttp\Client(); $response = $client->request('POST', $endpoint, [ 'form_params'=>$request->all(), ]); $response=json_decode($response->getBody()->getContents(),true); dd($response); } public function wait(Request $request) { $payment = Transaction::where('orderId',$request['q'])->first(); return view('payments.wait',compact('payment')); } public function manualTransfer(Request $request) { // dd($request->all()); $transaction = updateTxn($request->all(),$request['orderId']); $data = [ 'data' => json_encode($transaction) ]; $signature = base64_encode(hash_hmac('sha256',str_replace(':null',':""',json_encode($data,true)), config('app.payment_hask_key'), true)); $header_data = [ 'hash'=>[$signature] ]; if ($request['reference_number']) { $endpoint = 'https://betin.betnowexch.com/callback/manualTransfer'; $client = new \GuzzleHttp\Client(); $response = $client->request('POST', $endpoint, [ 'headers'=>$header_data, 'form_params'=>$data, ]); $response=json_decode($response->getBody()->getContents(),true); $transaction->sent21=1; $transaction->status=2; $transaction->save(); } if ($request->is_ajax == 1) { return response()->json(['url' => '/success']); } return redirect('/success'); $client = new \GuzzleHttp\Client(); $response = $client->request('POST', 'https://betin.betnowexch.com/callback/manualTransfer', [ 'form_params' => $request->all() ]); return redirect('/success'); } public function addvpa(Request $request) { $userId = $request->userId; $vpa = $request->vpa; $txn = Transaction::where('orderId',$request['orderId'])->first(); $exist = VpaDetails::where('user_id',$userId)->where('vpa',$vpa)->first(); if (!$exist) { $message = 'Added'; $id = VpaDetails::insertGetId([ 'user_id' => $userId, 'vpa' => $vpa ]); } else { $id = $exist->id; $message = 'Already exists'; } return response()->json([ 'status' => 200, 'message' => $message ]); } public function getTxnStatusSummary(Request $request) { $q = Transaction::orderBy('id','DESC'); $results = $q->get()->groupBy('status'); $summary = []; foreach (config('app.status') as $key => $value) { $summary[$key] = [ 'status' => $key, 'statusText' => $value, 'total' => 0 ]; } foreach ($results as $status => $values) { $summary[$status] = [ 'status' => $status, 'statusText' => config('app.status')[$status], 'total' => number_format(round($values->sum('amount'),2),2) ]; } $data['summary'] = $summary; return $data; } public function processPaymentAggre(Request $request) { // if (!$request['pin']||(!Hash::check($request['pin'], backpack_user()->agent_pin))) { // return response()->json([ // 'status'=>'201', // 'message'=>'Please enter valid PIN', // ]); // } // dd($request->all()); $id = $request['id']; $newtxn = TransactionNew::where('id',$id)->where('status',2) // ->whereNull('cashfree_status') // ->whereNull('utr') ->first(); if (!$newtxn) { return response()->json([ 'status'=>'201', 'message'=>'Transaction not found', ]); } $newtxn->payout_bank = 'AggrePay'; $newtxn->cashfree_status='PROCESSING'; $withdrawal_details = json_decode($newtxn->withdrawal_details); try { $endpoint = 'https://bank-apis.justinclicks.com/API/V1/IFSC/'.$withdrawal_details->ifsc; $client = new \GuzzleHttp\Client(); $response = $client->request('GET', $endpoint, [ 'form_params'=>$params, ]); $response=json_decode($response->getBody()->getContents(),true); } catch (\Exception $e) { $response = []; } if (isset($response['BANK']) && isset($response['BRANCH'])) { $bank_name = $response['BANK']; $bank_branch = $response['BRANCH']; } else { $bank_name = 'SBI'; $bank_branch = 'Mumbai'; } $phone_numbers = DB::table('phone_numbers') ->whereNotNull(['email','phone_number']) ->inRandomOrder() ->first(); $params = []; $params['name'] = $withdrawal_details->name; $params['email'] = str_replace(' ','',$phone_numbers->email); $params['phone'] = $phone_numbers->phone_number; $params['userId'] = $newtxn->id; $params['orderId'] = $newtxn->order_id; $params['amount'] = $newtxn->amount; $params['account_name'] = $withdrawal_details->name; $params['account_number'] = $withdrawal_details->ac_number; $params['ifsc_code'] = $withdrawal_details->ifsc; $params['bank_name'] = $bank_name; $params['bank_branch'] = $bank_branch; $params['transfer_type'] = 'IMPS'; $result = SpinsPayoutController::processpayout($params); if ($result['status']) { $newtxn->processed_by = backpack_user()->id; $newtxn->processed_ip = $request->ip(); $newtxn->agent_process_time = date('Y-m-d H:i:s'); $newtxn->cashfree_status = $result['data']['status']; $newtxn->customer_comments = isset($result['error']['message'])?$result['error']['message']:''; $newtxn->save(); SpinsPayoutController::payoutstatus($newtxn->id); } else { $newtxn->customer_comments = $result['error']['message']; $newtxn->cashfree_status = 'FAILED'; $newtxn->status = 3; $newtxn->save(); } return response()->json([ 'payoutstatus' => $newtxn->cashfree_status, 'customer_comments' => $newtxn->customer_comments, 'utr' => $newtxn->utr?$newtxn->utr:'-', 'payout_message' => $newtxn->customer_comments, ]); // return response()->json($result); } public function processPaymentPaisa(Request $request) { // if (!$request['pin']||(!Hash::check($request['pin'], backpack_user()->agent_pin))) { // return response()->json([ // 'status'=>'201', // 'message'=>'Please enter valid PIN', // ]); // } // dd($request->all()); $id = $request['id']; $newtxn = TransactionNew::where('id',$id) ->where('status',2) ->whereNull('cashfree_status') ->whereNull('utr') ->first(); if (!$newtxn) { return response()->json([ 'status'=>'201', 'message'=>'Transaction not found', ]); } $newtxn->payout_bank = 'FonePaisa'; $newtxn->cashfree_status='PROCESSING'; $withdrawal_details = json_decode($newtxn->withdrawal_details); $withdrawal_details->ifsc = 'ICIC0007550'; try { $endpoint = 'https://bank-apis.justinclicks.com/API/V1/IFSC/'.$withdrawal_details->ifsc; $client = new \GuzzleHttp\Client(); $response = $client->request('GET', $endpoint, [ 'form_params'=>$params, ]); $response=json_decode($response->getBody()->getContents(),true); } catch (\Exception $e) { $response = []; } if (isset($response['BANK']) && isset($response['BRANCH'])) { $bank_name = $response['BANK']; $bank_branch = $response['BRANCH']; } else { $bank_name = 'SBI'; $bank_branch = 'Mumbai'; } $phone_numbers = DB::table('phone_numbers') ->whereNotNull(['email','phone_number']) ->inRandomOrder() ->first(); $params = []; $params['name'] = $withdrawal_details->name; $params['email'] = $phone_numbers->email; $params['phone'] = $phone_numbers->phone_number; $params['userId'] = $newtxn->id; $params['orderId'] = $newtxn->order_id; $params['amount'] = $newtxn->amount; $params['account_name'] = $withdrawal_details->name; $params['account_number'] = $withdrawal_details->ac_number; $params['ifsc_code'] = $withdrawal_details->ifsc; $params['bank_name'] = $bank_name; $params['bank_branch'] = $bank_branch; $params['transfer_type'] = 'IMPS'; $params['name'] = 'VALVE TECHNO ENTERTAINMENT'; $params['email'] = $phone_numbers->email; $params['phone'] = $phone_numbers->phone_number; $params['userId'] = $newtxn->id; $params['orderId'] = $newtxn->order_id; $params['amount'] = $newtxn->amount; $params['account_name'] = 'VALVE TECHNO ENTERTAINMENT'; $params['account_number'] = '7550055000611111'; $params['ifsc_code'] = 'ICIC0007550'; $params['bank_name'] = $bank_name; $params['bank_branch'] = $bank_branch; $params['transfer_type'] = 'IMPS'; $result = FonePaisaController::processpayout($params); if ($result['status']) { $newtxn->processed_by = backpack_user()->id; $newtxn->processed_ip = $request->ip(); $newtxn->agent_process_time = date('Y-m-d H:i:s'); $newtxn->cashfree_status = $result['data']['status']; $newtxn->customer_comments = isset($result['error']['message'])?$result['error']['message']:''; $newtxn->save(); FonePaisaController::payoutstatus($newtxn->id); } else { $newtxn->customer_comments = $result['error']['message']; if (!$result['error']['message']) { } $newtxn->cashfree_status = 'FAILED'; $newtxn->status = 3; $newtxn->save(); } return response()->json([ 'payoutstatus' => $newtxn->cashfree_status, 'customer_comments' => $newtxn->customer_comments, 'utr' => $newtxn->utr?$newtxn->utr:'-', 'payout_message' => $newtxn->customer_comments, ]); // return response()->json($result); } public function processPaymentPaisaTxn(Request $request) { // if (!$request['pin']||(!Hash::check($request['pin'], backpack_user()->agent_pin))) { // return response()->json([ // 'status'=>'201', // 'message'=>'Please enter valid PIN', // ]); // } // dd($request->all()); $id = $request['id']; $newtxn = Transaction::where('id',$id) ->where('status',2) ->whereNull('cashfree_status') ->whereNull('utr') ->first(); if (!$newtxn) { return response()->json([ 'status'=>'201', 'message'=>'Transaction not found', ]); } $newtxn->payout_bank = 'FonePaisa'; $newtxn->cashfree_status='PROCESSING'; $withdrawal_details = json_decode($newtxn->withdrawal_details); $withdrawal_details->ifsc = 'ICIC0007550'; try { $endpoint = 'https://bank-apis.justinclicks.com/API/V1/IFSC/'.$withdrawal_details->ifsc; $client = new \GuzzleHttp\Client(); $response = $client->request('GET', $endpoint, [ 'form_params'=>$params, ]); $response=json_decode($response->getBody()->getContents(),true); } catch (\Exception $e) { $response = []; } if (isset($response['BANK']) && isset($response['BRANCH'])) { $bank_name = $response['BANK']; $bank_branch = $response['BRANCH']; } else { $bank_name = 'SBI'; $bank_branch = 'Mumbai'; } $phone_numbers = DB::table('phone_numbers') ->whereNotNull(['email','phone_number']) ->inRandomOrder() ->first(); $params = []; $params['name'] = $withdrawal_details->name; $params['email'] = $phone_numbers->email; $params['phone'] = $phone_numbers->phone_number; $params['userId'] = $newtxn->id; $params['orderId'] = 'txn_'.$newtxn->id; $params['amount'] = $newtxn->amount; $params['account_name'] = $withdrawal_details->name; $params['account_number'] = $withdrawal_details->ac_number; $params['ifsc_code'] = $withdrawal_details->ifsc; $params['bank_name'] = $bank_name; $params['bank_branch'] = $bank_branch; $params['transfer_type'] = 'IMPS'; $params['name'] = 'VALVE TECHNO ENTERTAINMENT'; $params['email'] = $phone_numbers->email; $params['phone'] = $phone_numbers->phone_number; $params['userId'] = $newtxn->id; $params['orderId'] = 'txn_'.$newtxn->id; $params['amount'] = $newtxn->amount; $params['account_name'] = 'VALVE TECHNO ENTERTAINMENT'; $params['account_number'] = '755005500061'; $params['ifsc_code'] = 'ICIC0007550111'; $params['bank_name'] = $bank_name; $params['bank_branch'] = $bank_branch; $params['transfer_type'] = 'IMPS'; $result = FonePaisaTxnController::processpayout($params); if ($result['status']) { $newtxn->processed_by = backpack_user()->id; $newtxn->processed_ip = $request->ip(); $newtxn->agent_process_time = date('Y-m-d H:i:s'); $newtxn->cashfree_status = $result['data']['status']; $newtxn->customer_comments = isset($result['error']['message'])?$result['error']['message']:''; $newtxn->save(); FonePaisaTxnController::payoutstatus($newtxn->id); } else { $newtxn->customer_comments = $result['error']['message']?$result['error']['message']:json_encode($result,true); $newtxn->cashfree_status = 'FAILED'; $newtxn->status = 3; $newtxn->save(); } return response()->json([ 'payoutstatus' => $newtxn->cashfree_status, 'customer_comments' => $newtxn->customer_comments, 'utr' => $newtxn->utr?$newtxn->utr:'-', 'payout_message' => $newtxn->customer_comments, ]); // return response()->json($result); } public function processPaymentInstaPay(Request $request) { if (!$request['pin']||(!Hash::check($request['pin'], backpack_user()->agent_pin))) { return response()->json([ 'status'=>'201', 'message'=>'Please enter valid PIN', ]); } // dd($request->all()); $id = $request['id']; $newtxn = TransactionNew::where('id',$id) ->where('status',2) ->whereNull('cashfree_status') ->whereNull('utr') ->first(); if (!$newtxn) { return response()->json([ 'status'=>'201', 'message'=>'Transaction not found or already processed', ]); } $newtxn->payout_bank = 'InstaPay'; $newtxn->cashfree_status='PROCESSING'; $withdrawal_details = json_decode($newtxn->withdrawal_details); $withdrawal_details->ifsc = 'ICIC0007550'; try { $endpoint = 'https://bank-apis.justinclicks.com/API/V1/IFSC/'.$withdrawal_details->ifsc; $client = new \GuzzleHttp\Client(); $response = $client->request('GET', $endpoint, [ 'form_params'=>$params, ]); $response=json_decode($response->getBody()->getContents(),true); } catch (\Exception $e) { $response = []; } if (isset($response['BANK']) && isset($response['BRANCH'])) { $bank_name = $response['BANK']; $bank_branch = $response['BRANCH']; } else { $bank_name = 'SBI'; $bank_branch = 'Mumbai'; } $phone_numbers = DB::table('phone_numbers') ->whereNotNull(['email','phone_number']) ->inRandomOrder() ->first(); $params = []; $params['name'] = $withdrawal_details->name; $params['email'] = $phone_numbers->email; $params['phone'] = $phone_numbers->phone_number; $params['userId'] = $newtxn->id; $params['orderId'] = $newtxn->order_id; $params['amount'] = $newtxn->amount; $params['account_name'] = $withdrawal_details->name; $params['account_number'] = $withdrawal_details->ac_number; $params['ifsc_code'] = $withdrawal_details->ifsc; $params['bank_name'] = $bank_name; $params['bank_branch'] = $bank_branch; $params['transfer_type'] = 'IMPS'; $params['name'] = 'VALVE TECHNO ENTERTAINMENT'; $params['email'] = $phone_numbers->email; $params['phone'] = $phone_numbers->phone_number; $params['userId'] = $newtxn->id; $params['orderId'] = $newtxn->order_id; $params['amount'] = $newtxn->amount; $params['account_name'] = 'VALVE TECHNO ENTERTAINMENT'; $params['account_number'] = '755005500061'; $params['ifsc_code'] = 'ICIC0007550'; $params['bank_name'] = $bank_name; $params['bank_branch'] = $bank_branch; $params['transfer_type'] = 'IMPS'; $result = PayInstantPayoutController::processpayout($params); if ($result['status']) { $newtxn->processed_by = backpack_user()->id; $newtxn->processed_ip = $request->ip(); $newtxn->agent_process_time = date('Y-m-d H:i:s'); // $newtxn->cashfree_status = $result['data']['status']; $newtxn->customer_comments = isset($result['error']['message'])?$result['error']['message']:''; $newtxn->save(); PayInstantPayoutController::payoutstatus($newtxn->id); } else { $newtxn->customer_comments = $result['error']['message']?$result['error']['message']:json_encode($result,true); $newtxn->cashfree_status = 'FAILED'; $newtxn->status = 3; $newtxn->save(); } return response()->json([ 'payoutstatus' => $newtxn->cashfree_status, 'customer_comments' => $newtxn->customer_comments, 'utr' => $newtxn->utr?$newtxn->utr:'-', 'payout_message' => $newtxn->customer_comments, ]); // return response()->json($result); } public function processPaymentInstaPayTxn(Request $request) { // if (!$request['pin']||(!Hash::check($request['pin'], backpack_user()->agent_pin))) { // return response()->json([ // 'status'=>'201', // 'message'=>'Please enter valid PIN', // ]); // } // dd($request->all()); $id = $request['id']; $newtxn = Transaction::where('id',$id) ->where('status',2) ->whereNull('cashfree_status') ->whereNull('utr') ->first(); if (!$newtxn) { return response()->json([ 'status'=>'201', 'message'=>'Transaction not found or already processed', ]); } $newtxn->payout_bank = 'InstaPay'; $newtxn->cashfree_status='PROCESSING'; $withdrawal_details = json_decode($newtxn->withdrawal_details); $withdrawal_details->ifsc = 'ICIC0007550'; try { $endpoint = 'https://bank-apis.justinclicks.com/API/V1/IFSC/'.$withdrawal_details->ifsc; $client = new \GuzzleHttp\Client(); $response = $client->request('GET', $endpoint, [ 'form_params'=>$params, ]); $response=json_decode($response->getBody()->getContents(),true); } catch (\Exception $e) { $response = []; } if (isset($response['BANK']) && isset($response['BRANCH'])) { $bank_name = $response['BANK']; $bank_branch = $response['BRANCH']; } else { $bank_name = 'SBI'; $bank_branch = 'Mumbai'; } $phone_numbers = DB::table('phone_numbers') ->whereNotNull(['email','phone_number']) ->inRandomOrder() ->first(); $params = []; $params['name'] = $withdrawal_details->name; $params['email'] = $phone_numbers->email; $params['phone'] = $phone_numbers->phone_number; $params['userId'] = $newtxn->id; $params['orderId'] = $newtxn->order_id; $params['amount'] = $newtxn->amount; $params['account_name'] = $withdrawal_details->name; $params['account_number'] = $withdrawal_details->ac_number; $params['ifsc_code'] = $withdrawal_details->ifsc; $params['bank_name'] = $bank_name; $params['bank_branch'] = $bank_branch; $params['transfer_type'] = 'IMPS'; $params['name'] = 'VALVE TECHNO ENTERTAINMENT'; $params['email'] = $phone_numbers->email; $params['phone'] = $phone_numbers->phone_number; $params['userId'] = $newtxn->id; $params['orderId'] = $newtxn->order_id; $params['amount'] = $newtxn->amount; $params['account_name'] = 'VALVE TECHNO ENTERTAINMENT'; $params['account_number'] = '755005500061'; $params['ifsc_code'] = 'ICIC0007550'; $params['bank_name'] = $bank_name; $params['bank_branch'] = $bank_branch; $params['transfer_type'] = 'IMPS'; $result = PayInstantPayoutTxnController::processpayout($params); if ($result['status']) { $newtxn->processed_by = backpack_user()->id; $newtxn->processed_ip = $request->ip(); $newtxn->agent_process_time = date('Y-m-d H:i:s'); // $newtxn->cashfree_status = $result['data']['status']; $newtxn->customer_comments = isset($result['error']['message'])?$result['error']['message']:''; $newtxn->save(); PayInstantPayoutTxnController::payoutstatus($newtxn->id); } else { $newtxn->customer_comments = $result['error']['message']?$result['error']['message']:json_encode($result,true); $newtxn->cashfree_status = 'FAILED'; $newtxn->status = 3; $newtxn->save(); } return response()->json([ 'payoutstatus' => $newtxn->cashfree_status, 'customer_comments' => $newtxn->customer_comments, 'utr' => $newtxn->utr?$newtxn->utr:'-', 'payout_message' => $newtxn->customer_comments, ]); // return response()->json($result); } public function updateDates($value='') { $txns = Transaction::all(); foreach ($txns as $key => $value) { dump('Before : '.$value->created_at); $value->created_at = date('Y-m-d H:i:s',strtotime($value->created_at.' +5 hours +30 minutes')); dd('After : '.$value->created_at); $value->save(); } dd('completed'); } }