⚝
One Hat Cyber Team
⚝
Your IP:
172.22.0.1
Server IP:
151.80.20.34
Server:
Linux 794f04d97d5e 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64
Server Software:
Apache/2.4.62 (Debian)
PHP Version:
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
var
/
www
/
html
/
vendor
/
midtrans
/
midtrans-php
/
SnapBi
/
View File Name :
SnapBiApiRequestor.php
<?php namespace SnapBi; use Exception; class SnapBiApiRequestor { public static function remoteCall($url, $header, $body) { $ch = curl_init($url); $curlHeaders = []; //convert headers array into the correct format foreach ($header as $key => $value) { $curlHeaders[] = "$key: $value"; } $payload_json = json_encode($body); if (SnapBiConfig::$enableLogging){ echo sprintf("Request Body: \n%s\n", $payload_json); } curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $curlHeaders); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $payload_json); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_VERBOSE, SnapBiConfig::$enableLogging); $response = curl_exec($ch); if (curl_errno($ch)) { throw new Exception(curl_error($ch)); } $jsonResponse = json_decode($response); curl_close($ch); if (SnapBiConfig::$enableLogging){ echo sprintf("Response Body: \n%s\n", $response); } return $jsonResponse; } }