Update besar apk finance

This commit is contained in:
Wian Drs
2026-09-11 16:03:00 +07:00
parent d42483b350
commit 4ef15c22ae
897 changed files with 98056 additions and 15979 deletions
+34
View File
@@ -0,0 +1,34 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
function json_response($success, $message, array $data = array(), $httpStatus = 200)
{
$CI =& get_instance();
$payload = array_merge(array(
'status' => (bool) $success,
'message' => (string) $message
), $data);
return $CI->output
->set_status_header((int) $httpStatus)
->set_content_type('application/json', 'utf-8')
->set_output(json_encode($payload));
}
function business_exception_response(Throwable $exception)
{
$status = $exception instanceof BusinessException ? $exception->getCode() : 500;
if ($status < 400 || $status > 599) {
$status = 500;
}
if (!($exception instanceof BusinessException)) {
log_message('error', get_class($exception) . ': ' . $exception->getMessage());
}
$message = $exception instanceof BusinessException
? $exception->getMessage()
: 'Terjadi kesalahan saat memproses transaksi.';
return json_response(false, $message, array(), $status);
}