uawdijnntqw1x1x1
IP : 216.73.216.93
Hostname : panel.codeskitter.com
Kernel : Linux panel.codeskitter.com 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
Disable Function : apache_child_terminate, apache_note, apache_setenv, define_syslog_variables, dl, link, opcache_get_status, openlog, pcntl_exec, pcntl_fork, pcntl_setpriority, popen, posix_getpwuid, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid
OS : Linux
PATH:
/
home
/
users
/
unlimited
/
www
/
mpos.codeskitter.site
/
app
/
Library
/
TapPayment.php
/
/
<?php namespace App\Library; use GuzzleHttp\Client; use Illuminate\Http\Request; use Illuminate\Support\Facades\Session; class TapPayment { public static function redirect_if_payment_success() { if (Session::has('fund_callback')) { return url(Session::get('fund_callback')['success_url']); } else { return url('payment/success'); } } public static function redirect_if_payment_faild() { if (Session::has('fund_callback')) { return url(Session::get('fund_callback')['cancel_url']); } else { return url('payment/failed'); } } public static function make_payment($array) { $data = [ 'amount' => $array['pay_amount'], 'currency' => $array['currency'] ?? 'SAR', 'threeDSecure' => true, 'save_card' => false, 'description' => $array['billName'], 'customer' => [ 'first_name' => $array['name'], 'email' => $array['email'], ], 'source' => [ 'id' => 'src_all', ], 'redirect' => [ 'url' => route('tap-payment.status'), ], ]; try { $client = new Client(['base_uri' => 'https://api.tap.company/v2/']); $response = $client->post('charges', [ 'headers' => [ 'Authorization' => 'Bearer ' . $array['secret_key'], 'Content-Type' => 'application/json', ], 'json' => $data, ]); session()->put('secret_key', $array['secret_key']); $responseBody = json_decode($response->getBody(), true); // Redirect the user to Tap's payment page return redirect($responseBody['transaction']['url']); } catch (\Exception $e) { return response()->json(['error' => $e->getMessage()], 500); } } public function status(Request $request) { // Extract the parameters from the request $paymentId = $request->query('tap_id'); // Tap Payment ID if (!$paymentId) { return response()->json(['error' => 'Invalid callback response'], 400); } try { // Verify the payment status using the Tap API $client = new \GuzzleHttp\Client(); $response = $client->get('https://api.tap.company/v2/' . 'charges/' . $paymentId, [ 'headers' => [ 'Authorization' => 'Bearer ' . session('secret_key'), ], ]); $paymentDetails = json_decode($response->getBody(), true); session()->forget('secret_key'); // Check the status if ($paymentDetails['status'] === 'CAPTURED') { return redirect(TapPayment::redirect_if_payment_success()); } else { session()->put('payment_msg', $paymentDetails['response']['message']); return redirect(TapPayment::redirect_if_payment_faild()); } } catch (\Exception $e) { session()->put('payment_msg', $e->getMessage()); return redirect(TapPayment::redirect_if_payment_faild()); } } }
/home/users/unlimited/www/mpos.codeskitter.site/app/Library/TapPayment.php