DONE: add env based checking for whatsapp before testing at staging

This commit is contained in:
ISMAIL MASSERAN
2026-09-28 10:26:06 +08:00
parent 583d936fd2
commit b1934e1627
4 changed files with 14 additions and 11 deletions
+2 -2
View File
@@ -54,10 +54,10 @@ class WhatsappPembiayaanOnlinePaid extends Job
$storedPhone = $customer ? ($customer->telefon ?: $customer->telefon2) : null;
$to = $client->normalizeMsisdn($storedPhone);
if (env('APP_ENV') !== 'production') {
if (!config('whatsapp.whatsapp_cloud_enabled')) {
$admin = $client->normalizeMsisdn(env('ADMIN_PHONE_NUMBER'));
if (!$admin) {
Log::warning('WhatsApp Cloud skipped: ADMIN_PHONE_NUMBER required when not production', [
Log::warning('WhatsApp Cloud skipped: ADMIN_PHONE_NUMBER required when WHATSAPP_ENABLED is false', [
'norujukan' => $this->norujukan,
]);
$this->logBlast($now, $storedPhone, 'skipped: ADMIN_PHONE_NUMBER empty');