@extends('root') @section('title', 'WhatsApp Integration') @section('content')
Kelola nomor WhatsApp bisnis Anda dan hubungkan akun untuk mengirim pesan ke pelanggan.
Akun Anda otomatis menggunakan paket Self Service. Anda sekarang dapat mengirim pesan menggunakan WABA Anda sendiri.
WABA ID: {{ session('waba_id') }}
Token berhasil disimpan dan WABA siap digunakan.
{{ session('error') }}
@if(session('error_code'))
Error Code: {{ session('error_code') }}
Hubungkan akun WhatsApp Business Anda melalui Facebook. Proses aman dan otomatis—nomor bisnis Anda siap digunakan untuk chat dengan pelanggan.
Paket otomatis berubah setelah terhubung
Tipe Paket
{{ $integrationStatus['package_type_label'] }}Mode Integrasi
{{ ucfirst($integrationStatus['integration_mode']) }}Pembayaran
@if($integrationStatus['platform_handles_billing']) Dikelola Platform @else Meta Direct @endifAnda menggunakan nomor bisnis sendiri. Token disimpan aman di platform.
@if($integrationStatus['package_type'] === 'shared') Nomor yang tersedia untuk mengirim pesan ke pelanggan @else Daftar nomor bisnis yang terhubung ke akun Anda @endif
Pesan Anda dikirim melalui nomor WhatsApp bersama yang dikelola platform. Tidak perlu menghubungkan nomor sendiri—langsung bisa kirim pesan.
@if($isMetaConfigured) Upgrade ke Self Service @endif| Akun WABA | Nomor WhatsApp | Status |
|---|---|---|
{{ $waba->account_name ?: 'WhatsApp Business' }}ID: {{ $waba->waba_id }} |
{{ $waba->phone_number ?: '-' }} | Aktif |
Tidak ada nomor shared pool yang aktif saat ini.
Hubungi administrator untuk mengaktifkan nomor.
@if($integrationStatus['package_type'] === 'self_service') Hubungkan nomor WhatsApp Business Anda untuk mulai mengirim pesan ke pelanggan dari Inbox. @else Hubungkan nomor WhatsApp Business Anda untuk upgrade ke Self Service dan gunakan nomor bisnis sendiri. @endif
@if($isMetaConfigured)Proses aman dan dipandu oleh Meta
@endif| Akun WABA | Nomor WhatsApp | Mode Integrasi | Status | Aksi |
|---|---|---|---|---|
{{ $waba->account_name ?: 'WhatsApp Business' }}ID: {{ $waba->waba_id }} |
{{ $waba->phone_number ?: '-' }}
@if($waba->phone_number_id)
Phone ID: {{ Str::limit($waba->phone_number_id, 20) }} @endif |
@php $modeClass = match($waba->integration_mode?->value ?? 'pool') { 'oauth' => 'bg-purple', 'managed' => 'bg-success', default => 'bg-info', }; $modeLabel = match($waba->integration_mode?->value ?? 'pool') { 'oauth' => 'Self Service (OAuth)', 'managed' => 'Dedicated', default => 'Shared Pool', }; @endphp {{ $modeLabel }} |
@php
// Use code_verification_status from raw_meta_response as primary source
$codeVerificationStatus = null;
$phoneStatus = null;
$rawResponse = $waba->raw_meta_response ?? [];
if (isset($rawResponse['phone']['code_verification_status'])) {
$codeVerificationStatus = strtoupper($rawResponse['phone']['code_verification_status']);
}
if (isset($rawResponse['phone']['status'])) {
$phoneStatus = strtoupper($rawResponse['phone']['status']);
}
// Determine final status based on code_verification_status
if ($codeVerificationStatus === 'VERIFIED') {
$finalStatus = 'verified';
$statusLabel = 'Verified';
} elseif ($codeVerificationStatus === 'UNVERIFIED') {
$finalStatus = 'unverified';
$statusLabel = 'Unverified';
} elseif ($codeVerificationStatus === 'PENDING') {
$finalStatus = 'pending';
$statusLabel = 'Pending';
} elseif ($phoneStatus === 'CONNECTED' || $phoneStatus === 'REGISTERED') {
// If phone is connected/registered but no code_verification_status, show Registered
$finalStatus = 'registered';
$statusLabel = 'Registered';
} elseif ($waba->phone_status === 'active' || $waba->phone_status === 'REGISTERED') {
$finalStatus = 'registered';
$statusLabel = 'Registered';
} elseif ($waba->phone_status === 'pending' || $waba->phone_status === 'PENDING') {
$finalStatus = 'pending';
$statusLabel = 'Pending';
} elseif (in_array($waba->status, ['error', 'rejected', 'banned'])) {
$finalStatus = 'error';
$statusLabel = 'Error/Banned';
} elseif ($waba->status === 'syncing') {
$finalStatus = 'syncing';
$statusLabel = 'Syncing...';
} elseif ($waba->status === 'active') {
$finalStatus = 'active';
$statusLabel = 'Active';
} else {
$finalStatus = 'pending';
$statusLabel = 'Pending';
}
// Map to UI
$statusClass = match($finalStatus) {
'verified', 'registered', 'active' => 'bg-success-subtle text-success',
'error' => 'bg-danger-subtle text-danger',
'syncing' => 'bg-info-subtle text-info',
'pending', 'unverified' => 'bg-warning-subtle text-warning',
default => 'bg-secondary'
};
$statusIcon = match($finalStatus) {
'verified', 'registered', 'active' => 'ti-circle-check',
'error' => 'ti-alert-octagon',
'syncing' => 'ti-refresh ti-spin',
default => 'ti-clock'
};
$statusTooltip = match($finalStatus) {
'verified' => 'Nomor WhatsApp Business sudah terverifikasi dan siap digunakan',
'registered' => 'Nomor WhatsApp Business sudah aktif dan siap digunakan',
'pending' => 'WhatsApp membutuhkan waktu untuk mengaktifkan nomor bisnis. Pesan akan tersedia setelah proses selesai.',
'unverified' => 'Nomor WhatsApp Business belum terverifikasi oleh Meta',
default => ''
};
@endphp
{{ $statusLabel }}
@if($codeVerificationStatus)
Code: {{ $codeVerificationStatus }}
@endif
@if($finalStatus === 'active' && $waba->oauth_expires_at)
Expires: {{ $waba->oauth_expires_at->format('d M Y') }}
@endif
@if($waba->phone_status === 'error')
Cek Meta Business Manager
@endif
{{-- Webhook Status Badge --}}
@if($waba->isOauth())
@if($waba->webhook_status === 'active' && $waba->is_subscribed)
Webhook Active
@elseif($waba->webhook_status === 'failed')
Webhook Failed
@elseif($waba->webhook_status === 'pending')
Webhook Pending
@endif
@endif
|
@if($waba->integration_mode?->value === 'oauth')
@if($waba->webhook_status !== 'active' || !$waba->is_subscribed)
@endif
@else
Dikelola Platform
@endif
|
Pesan dikirim melalui nomor bisnis Anda. Biaya dikenakan langsung oleh Meta ke Business Manager Anda.
Nomor khusus yang dikelola platform untuk bisnis Anda. Biaya termasuk dalam paket langganan.
WhatsApp Business Account adalah akun bisnis resmi untuk mengirim pesan ke pelanggan melalui WhatsApp.
Token akses disimpan dengan aman. Anda tidak perlu mengelola token secara manual.