<div class="paymenterror alert alert-danger my-2 py-1 d-none"> {{ trans('messages.payment_selection_required') }}</div>
<div class="row g-3 justify-content-between">
@php
$i = 0;
@endphp
@foreach ($getpaymentmethods as $key => $pmdata)
@php
$transaction_type = $pmdata->payment_type;
$paymentname = $pmdata->payment_name;
// Check if the current $pmdata is a system addon and activated
if ($pmdata->payment_type == '1' || $pmdata->payment_type == '2') {
$systemAddonActivated = true;
} else {
$systemAddonActivated = false;
}
$addon = App\Models\SystemAddons::where('unique_identifier', $pmdata->unique_identifier)->first();
if ($addon != null && $addon->activated == 1) {
$systemAddonActivated = true;
}
@endphp
@if ($systemAddonActivated)
<label class="form-check-label col-md-6" for="payment{{ $transaction_type }}">
<input class="form-check-input" type="radio" name="transaction_type" id="payment{{ $transaction_type }}"
data-payment-type="{{ $transaction_type }}" value="{{ $transaction_type }}"
data-currency="{{ $pmdata->currency }}" {{ $i++ == 0 ? 'checked' : '' }}>
<div class="payment-gateway mb-0 justify-content-between">
<span class="color-changer"> <img src="{{ helper::image_path($pmdata->image) }}" alt="">
{{ ucfirst($paymentname) }}
</span>
<div class="d-flex gap-2">
@if ($transaction_type == 2)
<span class="text-end text-muted">{{ helper::currency_format(Auth::user()->wallet) }}</span>
@endif
@if (in_array($transaction_type, [3, 4, 5, 6]))
@if ($transaction_type == 3)
<input type="hidden" name="razorpaykey" id="razorpaykey"
value="{{ $pmdata->public_key }}">
@endif
@if ($transaction_type == 4)
<input type="hidden" name="stripekey" id="stripekey"
value="{{ $pmdata->public_key }}">
@endif
@if ($transaction_type == 5)
<input type="hidden" name="flutterwavekey" id="flutterwavekey"
value="{{ $pmdata->public_key }}">
@endif
@if ($transaction_type == 6)
<input type="hidden" name="paystackkey" id="paystackkey"
value="{{ $pmdata->public_key }}">
@endif
@endif
@if ($transaction_type == '16')
<input type="hidden" value="{{ $pmdata->payment_description }}" id="bank_payment">
@endif
<span class="check-icon"></span>
</div>
</div>
@if ($transaction_type == 2)
<small class="walleterror text-danger d-none">{{ trans('messages.insufficient_wallet') }}</small>
@endif
</label>
@if ($transaction_type == 4)
<form action="" method="" id="payment-form" class="d-none">
<div class="my-3" id="card-element"></div>
</form>
@endif
@endif
@endforeach
</div>