25 lines
677 B
PHP
25 lines
677 B
PHP
<?php
|
|
|
|
namespace App\Services;
|
|
|
|
use Illuminate\Support\Facades\Http;
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
class OnlineTransactionLoggerService
|
|
{
|
|
public static function logs($bill_id, $request, $response, $status)
|
|
{
|
|
try {
|
|
Http::arrahn()->post('/api/transaction/online/log', [
|
|
'bill_id' => $bill_id,
|
|
'payload' => json_encode($request),
|
|
'response' => json_encode($response),
|
|
'status' => json_encode($status),
|
|
]);
|
|
} catch (\Exception $e) {
|
|
// Log the exception itself
|
|
Log::error('Failed to log activity: ' . $e->getMessage());
|
|
}
|
|
}
|
|
}
|