This commit is contained in:
lizandrogd
2026-01-21 02:49:42 -05:00
parent 845762f916
commit cec91ff45a
6 changed files with 209 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
<?php
require_once __DIR__ . '/../config/config.php';
require_once __DIR__ . '/../api/webhook.php';
// Simular payload de mensaje entrante para que webhook cree notificación
$payload = [
'object' => 'whatsapp_business_account',
'entry' => [
[
'changes' => [
[
'field' => 'messages',
'value' => [
'messages' => [
[
'from' => '573019999900',
'id' => 'NTFTEST1',
'timestamp' => time(),
'type' => 'text',
'text' => ['body' => 'Notificacion test']
]
]
]
]
]
]
]
];
$w = new WhatsAppWebhook();
$w->processPayload($payload);
$db = Database::getInstance();
$rows = $db->fetchAll('SELECT * FROM notifications ORDER BY id DESC LIMIT 5');
foreach ($rows as $r) echo json_encode($r) . "\n";