uawdijnntqw1x1x1
IP : 216.73.217.77
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
/
tests
/
Unit
/
..
/
..
/
tests
/
..
/
app
/
Library
/
Cinetpay.php
/
/
<?php namespace App\Library; use GuzzleHttp\Client; use Illuminate\Http\Request; use Illuminate\Support\Facades\Session; class Cinetpay { public static function redirect_if_payment_success() { if (Session::has('fund_callback')) { return url(Session::get('fund_callback')['success_url']); } return url('payment/success'); } public static function redirect_if_payment_faild() { if (Session::has('fund_callback')) { return url(Session::get('fund_callback')['cancel_url']); } return url('payment/failed'); } public static function make_payment($array) { $transaction_id = uniqid(); // Or use UUID $apiKey = $array['api_key']; $siteId = $array['site_id']; $data = [ 'transaction_id' => $transaction_id, 'amount' => $array['pay_amount'], 'currency' => $array['currency'] ?? 'XOF', 'description' => $array['billName'], 'customer_name' => $array['name'], 'customer_surname' => '', 'customer_email' => $array['email'], 'notify_url' => '', // You can leave it empty or omit if not using 'return_url' => route('cinetpay.status'), // Redirect handler 'channels' => 'ALL', 'site_id' => $siteId, 'apikey' => $apiKey, ]; try { $client = new Client(); $response = $client->post('https://api-checkout.cinetpay.com/v2/payment', [ 'headers' => ['Content-Type' => 'application/json'], 'json' => $data, ]); session()->put('cinetpay_secret', [ 'transaction_id' => $transaction_id, 'api_key' => $apiKey, 'site_id' => $siteId, ]); $body = json_decode($response->getBody(), true); return redirect($body['data']['payment_url']); } catch (\Exception $e) { return response()->json(['error' => $e->getMessage()], 500); } } public function status(Request $request) { $info = session('cinetpay_secret'); if (!$info) return redirect(self::redirect_if_payment_faild()); try { $client = new Client(); $response = $client->post('https://api-checkout.cinetpay.com/v2/payment/check', [ 'headers' => ['Content-Type' => 'application/json'], 'json' => [ 'apikey' => $info['api_key'], 'site_id' => $info['site_id'], 'transaction_id' => $info['transaction_id'], ], ]); $result = json_decode($response->getBody(), true); session()->forget('cinetpay_secret'); if ($result['code'] === '00') { // Update your DB here (e.g., mark payment successful) return redirect(self::redirect_if_payment_success()); } else { session()->put('payment_msg', $result['message'] ?? 'Payment failed'); return redirect(self::redirect_if_payment_faild()); } } catch (\Exception $e) { session()->put('payment_msg', $e->getMessage()); return redirect(self::redirect_if_payment_faild()); } } }
/home/users/unlimited/www/mpos.codeskitter.site/tests/Unit/../../tests/../app/Library/Cinetpay.php