@extends('layouts/layoutMaster') @section('title', __('locale.Subscription Profile')) @section('vendor-style') @vite(['resources/assets/vendor/libs/select2/select2.scss', 'resources/assets/vendor/libs/flatpickr/flatpickr.scss', 'resources/assets/vendor/libs/sweetalert2/sweetalert2.scss']) @endsection @section('vendor-script') @vite(['resources/assets/vendor/libs/select2/select2.js', 'resources/assets/vendor/libs/flatpickr/flatpickr.js', 'resources/assets/vendor/libs/sweetalert2/sweetalert2.js']) @endsection @section('content') @php $currency=Helper::setting('currency_symbol','currency'); @endphp
@include('_partials/flashMessage')
@if ($subscription && $customerDeleted == false)

{{ __('locale.Current Subscription') }}

@if (Auth::user()->user_type == 'Store') @endif

{{ __('locale.Package') }}: {{ $subscription['package']?->name }}

{{ __('locale.ID') }}: {{ $subscription->stripe_subscription_id }}

{{ __('locale.Status') }}: {{ ucfirst($subscription->status) }}

{{ __('locale.Next Billing Date') }}: {{ \Carbon\Carbon::parse($subscription->next_billing_date)->format('F j, Y') }}

{{ __('locale.Total Amount') }}: ${{ number_format($subscription->amount, 2) }}

@if ($subscription?->status === 'canceled')
@csrf
@else @endif
@else

{{ __('locale.Add Subscription') }}

@csrf
@endif
@php use Carbon\Carbon; $today = Carbon::today(); $start = isset($user->start_date) ? Carbon::parse($user->start_date) : Carbon::parse($user->created_at); $end = Carbon::parse($user->end_date); $default_days = 15; $totalDays = $start && $end ? $start->diffInDays($end) : $default_days; // total days between start and end $daysUsed = $start->diffInDays($today); $daysRemaining = $end->diffInDays($today, true); // false to get negative value if expired $progress = $totalDays > 0 ? min(100, intval(($daysUsed / $totalDays) * 100)) : 0; @endphp @if ($subscription && Auth::user()->user_type == 'Store')
@if (empty($user['subscriptionRecord']) && $user->end_date >= $today->toDateString())
{{ __('locale.Days') }}
{{ $daysUsed }} of {{ $totalDays }} {{ __('locale.Days') }}

{{ $daysRemaining }} day{{ $daysRemaining == 1 ? '' : 's' }} {{ __('locale.remaining until your plan requires update') }}

@elseif (empty($user['subscriptionRecord']) && $user->end_date < $today->toDateString()) @elseif (!empty($user['subscriptionRecord']) && $user->end_date < $today->toDateString()) @else @endif

💳 {{ __('locale.Manage Payment Methods') }}

{{-- Saved Cards --}}
{{ __('locale.Saved Cards') }}
@forelse ($paymentMethods as $card)
{{ ucfirst($card->card->brand) }}
**** **** **** {{ $card->card->last4 }}
{{ __('locale.Expires') }} {{ $card->card->exp_month }}/{{ $card->card->exp_year }}
@if ($card->id === $user->default_payment_method) {{ __('locale.Default') }} @else
@csrf
@endif @if ($card->id != $user->default_payment_method)
@csrf @method('DELETE')
@endif
@empty

{{ __('locale.No cards saved yet.') }}

@endforelse
{{-- Add Card --}}
{{ __('locale.Add New Card') }}
@csrf
@endif
@if ($transactions->count())

{{ __('locale.Billing History') }}

@foreach ($transactions as $index => $txn) @endforeach
# {{ __('locale.Amount') }} {{ __('locale.Status') }} {{ __('locale.Txn ID') }} {{ __('locale.Date') }}
{{ $index + 1 }} {{ $currency }}{{ number_format($txn->amount, 2) }} {{ ucfirst($txn->status) }} Txn Date: {{ \Carbon\Carbon::parse($txn->created_at)->format('F j, Y') }}
Start: {{ \Carbon\Carbon::parse($txn->start_date)->format('F j, Y') }}
@endif
@endsection @section('page-script') @endsection