Show message from eligible service

This commit is contained in:
Benjamin Beganović 2021-04-10 13:56:29 +02:00
parent 3062ee4fec
commit cb9bfe02c2
2 changed files with 10 additions and 2 deletions

View File

@ -111,6 +111,7 @@ class BillingPortalPurchase extends Component
'discount_applied' => false,
'show_loading_bar' => false,
'not_eligible' => null,
'not_eligible_message' => null,
];
/**
@ -327,6 +328,7 @@ class BillingPortalPurchase extends Component
if (is_array($is_eligible)) {
$this->steps['not_eligible'] = true;
$this->steps['not_eligible_message'] = $is_eligible['exception'];
$this->steps['show_loading_bar'] = false;
return;

View File

@ -59,10 +59,12 @@
<div class="relative flex justify-center text-sm leading-5">
<h1 class="text-2xl font-bold tracking-wide bg-gray-50 px-6 py-0">
{{ ctrans('texts.total') }}: {{ \App\Utils\Number::formatMoney($price, $subscription->company) }}
{{ ctrans('texts.total') }}
: {{ \App\Utils\Number::formatMoney($price, $subscription->company) }}
@if($steps['discount_applied'])
<small class="ml-1 line-through text-gray-500">{{ \App\Utils\Number::formatMoney($subscription->price, $subscription->company) }}</small>
<small
class="ml-1 line-through text-gray-500">{{ \App\Utils\Number::formatMoney($subscription->price, $subscription->company) }}</small>
@endif
</h1>
</div>
@ -208,6 +210,10 @@
@if($steps['not_eligible'] && !is_null($steps['not_eligible']))
<h1>{{ ctrans('texts.payment_error') }}</h1>
@if($steps['not_eligible_message'])
<small class="mt-4 block">{{ $steps['not_eligible_message'] }}</small>
@endif
@endif
</div>
</div>