diff --git a/app/Http/Livewire/Chat/PublicChat.php b/app/Http/Livewire/Chat/PublicChat.php index ec03f21..661e794 100755 --- a/app/Http/Livewire/Chat/PublicChat.php +++ b/app/Http/Livewire/Chat/PublicChat.php @@ -1420,6 +1420,15 @@ class PublicChat extends Component $saldo->update(['valor' => $nuevoSaldo]); $this->saldoUsuario = $nuevoSaldo; + \App\Models\recarga::create([ + 'usuario_id' => $this->userId, + 'saldo_id' => $saldo->id, + 'monto' => $monto, + 'valor_recarga' => $monto, + 'status' => 'Confirmado', + 'reference' => 'breb-chat-' . $solicitud->id, + ]); + $solicitud->confirmar(); $this->flujo = ''; diff --git a/app/Services/TelegramBotService.php b/app/Services/TelegramBotService.php index 86d5d02..b9551c5 100755 --- a/app/Services/TelegramBotService.php +++ b/app/Services/TelegramBotService.php @@ -310,6 +310,15 @@ class TelegramBotService $nuevoSaldo = $saldo->valor + $monto; $saldo->update(['valor' => $nuevoSaldo]); + \App\Models\recarga::create([ + 'usuario_id' => $usuarioId, + 'saldo_id' => $saldo->id, + 'monto' => $monto, + 'valor_recarga'=> $monto, + 'status' => 'Confirmado', + 'reference' => 'breb-bot-' . $solicitud->id, + ]); + $solicitud->confirmar(); unset($state['data']['pago_pendiente'], $state['data']['solicitud_recarga_id']);