@extends('admin.layouts.app') @section('title', __('mpesa::mpesa.nav.settings')) @section('content') @php $t = fn ($k, $r = []) => __('mpesa::mpesa.settings.'.$k, $r); $val = fn ($k) => old($k, $config->get($k)); $envVal = fn ($f) => old($f, $config->env($f, $edit)); $flag = fn ($k) => (string) old($k, $config->get($k)) === '1'; $live = $config->environment(); @endphp @include('mpesa::admin._nav', ['title' => __('mpesa::mpesa.nav.settings')])
@foreach($warnings as $w)
{{ $w }}
@endforeach @if($problems)
{{ $t('problems_in', ['env' => $edit]) }}
@endif
{{ $t('editing') }} @foreach(['sandbox', 'production'] as $e) {{ ucfirst($e) }}{{ $live === $e ? ' ('.$t('in_use').')' : '' }} @endforeach {{ $t('editing_hint') }}
@csrf
{{ $t('section_gateway') }}
@if($live !== 'production') @endif
{{ $t('active_hint') }}
{{ $t('section_merchant', ['env' => $edit]) }}
{{ $t('shortcode_hint') }}
{{ $t('till_hint') }}
{{ $t('section_credentials', ['env' => $edit]) }}
@foreach(['consumer_key', 'consumer_secret', 'passkey'] as $f)
@if($secrets[$f])@endif {{ $t($f.'_hint') }}
@endforeach
{{ $t('section_initiator', ['env' => $edit]) }}

{{ $t('initiator_intro') }}

@foreach(['security_credential', 'initiator_password'] as $f)
@if($secrets[$f])@endif {{ $t($f.'_hint') }}
@endforeach
{{ $t('certificate_hint') }}
{{ $t('section_customer') }}
{{ $t('instructions_hint') }}
{{ $t('manual_hint') }}
{{ $t('section_callbacks') }}

{{ $t('callbacks_intro') }}

{{ $t('callback_base_url_hint') }}
@foreach($urls as $kind => $url)
{{ $kind }}{{ $url }}
@endforeach

{{ $t('c2b_status') }}: @if($c2b && ($c2b['ok'] ?? false)){{ $t('registered_at', ['at' => $c2b['at']]) }} @elseif($c2b){{ $t('registration_failed', ['at' => $c2b['at'], 'message' => $c2b['message'] ?? '']) }} @else{{ $t('not_registered') }}@endif

{{ $t('response_type_hint') }}
{{ $t('validation_hint') }}
{{ $t('verify_stk_hint') }} {{ $t('verify_c2b_hint') }}
{{ $t('ip_hint') }}
{{ $t('section_matching') }}
@foreach(['underpayment_policy' => ['allocate', 'review'], 'overpayment_policy' => ['credit', 'review'], 'closed_invoice_policy' => ['credit', 'review']] as $k => $opts)
{{ $t($k.'_hint') }}
@endforeach
{{ $t('phone_matching_hint') }}
{{ $t('claim_requires_phone_hint') }}
{{ $t('section_reconciliation') }}
@foreach(['reconcile_minutes', 'stk_query_after_seconds', 'stk_give_up_minutes', 'stk_max_queries', 'retry_limit', 'retry_minutes', 'pull_overlap_minutes', 'api_failure_alert', 'callback_retention_days'] as $k)
{{ $t($k.'_hint') }}
@endforeach
{{ $t('pull_hint') }}
{{ $t('pull_nominated_hint') }}
{{ $t('section_reversals') }}
{{ $t('reversal_approval_threshold_hint') }}
{{ $t('reversal_max_amount_hint') }}
{{ $t('reversal_invoice_policy_hint') }}
{{ $t('notifications_hint') }}
{{ $t('section_actions', ['env' => $edit]) }}
@csrf @if($lastTest){{ $t('last_test', ['at' => $lastTest['at'], 'result' => ($lastTest['ok'] ?? false) ? 'OK' : ($lastTest['message'] ?? 'failed')]) }}@endif
@csrf
@csrf @if($pull){{ ($pull['ok'] ?? false) ? $t('registered_at', ['at' => $pull['at']]) : $t('registration_failed', ['at' => $pull['at'], 'message' => $pull['message'] ?? '']) }}@endif
@csrf
@if($live === 'sandbox')
@csrf
{{ $t('simulate_hint') }}
@endif
@endsection