fix(wa): notifikasi LUNAS lewat gateway aktif + approve APK
All checks were successful
CI / test (push) Successful in 2m26s

- isConnected GOWA: tangani /devices array (state connected)
- app-customer payment-notif: pakai waNotify, bukan Baileys
- customerAPI approve kolektor + payment-unmatched: kirim WA lunas
- versi 0.5.13
This commit is contained in:
oxpoe
2026-11-05 17:32:31 +07:00
parent 310e91ed97
commit 7db4cb81a3
8 changed files with 73 additions and 8 deletions

View File

@@ -628,8 +628,8 @@ async function trySendWaPaymentSuccess(settings, invoiceId, methodLabel) {
if (!inv) return;
const phone = String(inv.customer_phone || '').trim();
if (!phone) return;
const { sendWA, whatsappStatus } = await import('./services/whatsappBot.mjs');
if (whatsappStatus.connection !== 'open') throw new Error('Bot WhatsApp belum terhubung');
// Pakai gateway aktif (GOWA/Fonnte/Meta/Baileys), bukan hanya Baileys.
const waNotify = require('./services/waNotifyService');
const appUrl = (settings.public_base_url || '').replace(/\/$/, '');
const portalUrl = appUrl ? `${appUrl}/customer` : '';
@@ -654,7 +654,7 @@ async function trySendWaPaymentSuccess(settings, invoiceId, methodLabel) {
});
logger.info(`[WEBHOOK][payment-notif] Sending WA success notif to ${phone} inv=${invoiceId} method=${metode}`);
await sendWA(phone, msg);
await waNotify.sendText(phone, msg);
} catch (e) {
logger.error(`[WEBHOOK][payment-notif] WA success notif failed: ${e?.message || e}`);
}