feat(notifications): implement comprehensive telegram notifications for payment providers
- Add NotifyMe trait with centralized Telegram bot integration - Implement webhook notifications for Polar, OxaPay, and ActivationKey providers - Add subscription lifecycle notifications (create, activate, cancel, pause, resume) - Enhance Polar webhook processing with user context and error handling - Fix subscription.updated and subscription.canceled webhook column errors - Add idempotent webhook processing to prevent duplicate handling
This commit is contained in:
@@ -2,13 +2,13 @@
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Exception;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
trait NotifyMe
|
||||
{
|
||||
public function sendTelegramNotification($message)
|
||||
public function sendTelegramNotification($message): bool
|
||||
{
|
||||
$botToken = config('app.notify_tg_bot_token');
|
||||
$chatId = config('app.notify_tg_chat_id');
|
||||
@@ -28,9 +28,7 @@ trait NotifyMe
|
||||
];
|
||||
|
||||
try {
|
||||
$response = Http::post($url, $data);
|
||||
|
||||
return $response->successful();
|
||||
return Http::post($url, $data)->successful();
|
||||
} catch (Exception $e) {
|
||||
Log::error('Failed to send Telegram notification: '.$e->getMessage());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user