From cb9bfe02c251f0e6b8ddd1635394cde0bdcb76c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Sat, 10 Apr 2021 13:56:29 +0200 Subject: [PATCH] Show message from eligible service --- app/Http/Livewire/BillingPortalPurchase.php | 2 ++ .../livewire/billing-portal-purchase.blade.php | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/Http/Livewire/BillingPortalPurchase.php b/app/Http/Livewire/BillingPortalPurchase.php index a4326b04d525..820512ba49b7 100644 --- a/app/Http/Livewire/BillingPortalPurchase.php +++ b/app/Http/Livewire/BillingPortalPurchase.php @@ -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; diff --git a/resources/views/portal/ninja2020/components/livewire/billing-portal-purchase.blade.php b/resources/views/portal/ninja2020/components/livewire/billing-portal-purchase.blade.php index f40e4ce8bf7c..8836fd65aa41 100644 --- a/resources/views/portal/ninja2020/components/livewire/billing-portal-purchase.blade.php +++ b/resources/views/portal/ninja2020/components/livewire/billing-portal-purchase.blade.php @@ -59,10 +59,12 @@

- {{ ctrans('texts.total') }}: {{ \App\Utils\Number::formatMoney($price, $subscription->company) }} + {{ ctrans('texts.total') }} + : {{ \App\Utils\Number::formatMoney($price, $subscription->company) }} @if($steps['discount_applied']) - {{ \App\Utils\Number::formatMoney($subscription->price, $subscription->company) }} + {{ \App\Utils\Number::formatMoney($subscription->price, $subscription->company) }} @endif

@@ -208,6 +210,10 @@ @if($steps['not_eligible'] && !is_null($steps['not_eligible']))

{{ ctrans('texts.payment_error') }}

+ + @if($steps['not_eligible_message']) + {{ $steps['not_eligible_message'] }} + @endif @endif