⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.246
Server IP:
15.204.235.159
Server:
Linux srv.techlup.co.ke 4.18.0-553.5.1.el8_10.x86_64 #1 SMP Wed Jun 5 09:12:13 EDT 2024 x86_64
Server Software:
Apache
PHP Version:
8.2.27
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
tech
/
rider.techlup.co.ke
/
admin
/
app
/
Library
/
View File Name :
TripRequestUpdate.php
<?php use App\Events\CustomerTripPaymentSuccessfulEvent; use Modules\TripManagement\Entities\TripRequest; use Modules\TransactionManagement\Traits\TransactionTrait; use Modules\UserManagement\Lib\LevelHistoryManagerTrait; if (!function_exists('tripRequestUpdate')) { function tripRequestUpdate($data) { $trip = TripRequest::query() ->with(['driver', 'customer']) ->find($data->attribute_id); $trip->paid_fare = ($trip->paid_fare +$trip->tips); $trip->payment_status = PAID; $trip->save(); $push = getNotification('payment_successful'); sendDeviceNotification( fcm_token: $trip->driver->fcm_token, title: translate($push['title']), description: translate(textVariableDataFormat(value: $push['description'],paidAmount: $trip->paid_fare,methodName: $trip->payment_method)), status: $push['status'], ride_request_id: $trip->id, type: $trip->type, action: 'payment_successful', user_id: $trip->driver->id ); if ($trip->tips > 0) { $pushTips = getNotification('tips_from_customer'); sendDeviceNotification( fcm_token: $trip->driver->fcm_token, title: translate($pushTips['title']), description: translate(textVariableDataFormat(value: $pushTips['description'],tipsAmount: $trip->tips)), status: $push['status'], ride_request_id: $trip->id, type: $trip->type, action: 'tips_from_customer', user_id: $trip->driver->id ); } if (!empty($trip)) { try { event(checkPusherConnection(CustomerTripPaymentSuccessfulEvent::broadcast($trip))); }catch(Exception $exception){ } } (new class { use TransactionTrait; })->digitalPaymentTransaction($trip); return $trip; } }