@extends('root') @section('title', 'WhatsApp Integration') @section('content')
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') }}
Package Type
{{ $integrationStatus['package_type_label'] }}Integration Mode
{{ ucfirst($integrationStatus['integration_mode']) }}Status WABA
@if($integrationStatus['waba_status'] === 'connected') Connected @else Not Connected @endifJumlah WABA
{{ $integrationStatus['waba_count'] }}Billing
@if($integrationStatus['platform_handles_billing']) Dikelola Platform @else Meta Direct + Platform Margin @endifAnda sudah menggunakan Self Service!
{{--Hubungkan WABA tambahan atau kelola integrasi yang sudah ada.
--}} @elseHubungkan WhatsApp Business Account Anda melalui Facebook Login for Business.
Semua pesan tetap dikirim via platform. Token disimpan dengan aman.
@if($integrationStatus['package_type'] !== 'self_service') {{-- Facebook Login Button (Embedded Signup) --}}Package otomatis berubah setelah WABA terhubung
@endifPesan Anda dikirim melalui nomor WhatsApp bersama yang dikelola platform. Anda tidak perlu menghubungkan WABA sendiri.
@if($integrationStatus['package_type'] === 'self_service') Hubungkan WABA Anda untuk mulai mengirim pesan. @else Hubungkan WABA Anda untuk upgrade ke Self Service. @endif
@if($isMetaConfigured) @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 WABA Anda. Biaya dikenakan langsung oleh Meta ke Business Manager Anda.
WABA khusus yang dikelola platform untuk bisnis Anda. Biaya termasuk dalam paket langganan.