diff --git a/app/Http/Controllers/StoreController.php b/app/Http/Controllers/StoreController.php index 2eb57c18..9fd48ea7 100644 --- a/app/Http/Controllers/StoreController.php +++ b/app/Http/Controllers/StoreController.php @@ -12,9 +12,14 @@ class StoreController extends Controller public function index() { $isPaypalSetup = false; - if (env('PAYPAL_SECRET') && env('PAYPAL_CLIENT_ID')) $isPaypalSetup = true; - if (env('APP_ENV', 'local') == 'local') $isPaypalSetup = true; + $isStripeSetup = false; + if (env('PAYPAL_SECRET') && env('PAYPAL_CLIENT_ID')) $isPaypalSetup = true; + if (env('APP_ENV', 'local') == 'local') { + $isPaypalSetup = true; + $isStripeSetup = true; + } + if (env('STRIPE_SECRET') && env('STRIPE_ENDPOINT_SECRET') && env('STRIPE_METHODS')) $isStripeSetup = true; //Required Verification for creating an server if (Configuration::getValueByKey('FORCE_EMAIL_VERIFICATION', false) === 'true' && !Auth::user()->hasVerifiedEmail()) { @@ -28,7 +33,8 @@ class StoreController extends Controller return view('store.index')->with([ 'products' => CreditProduct::where('disabled', '=', false)->orderBy('price', 'asc')->get(), - 'isPaypalSetup' => $isPaypalSetup + 'isPaypalSetup' => $isPaypalSetup, + 'isStripeSetup' => $isStripeSetup ]); } } diff --git a/resources/views/admin/store/index.blade.php b/resources/views/admin/store/index.blade.php index f8b5fc31..cc09f06b 100644 --- a/resources/views/admin/store/index.blade.php +++ b/resources/views/admin/store/index.blade.php @@ -6,13 +6,13 @@
-

{{__('Store')}}

+

{{ __('Store') }}

@@ -26,10 +26,18 @@
- @if($isPaypalSetup == false) + @if ($isPaypalSetup == false)
-

{{__('Paypal is not configured.')}}

-

{{__('To configure PayPal, head to the .env and add your PayPal’s client id and secret.')}}

+

{{ __('Paypal is not configured.') }}

+

{{ __('To configure PayPal, head to the .env and add your PayPal’s client id and secret.') }} +

+
+ @endif + @if ($isStripeSetup == false) +
+

{{ __('Stripe is not configured.') }}

+

{{ __('To configure Stripe, head to the .env and add your Stripüe Secret, Endpoint and supported Payment Methods.') }} +

@endif
@@ -39,9 +47,9 @@
-
{{__('Store')}}
- {{__('Create new')}} +
{{ __('Store') }}
+ {{ __('Create new') }}
@@ -49,15 +57,15 @@ - - - - - - - - - + + + + + + + + + @@ -78,26 +86,42 @@ return confirm("Are you sure you wish to delete?") !== false; } - document.addEventListener("DOMContentLoaded", function () { + document.addEventListener("DOMContentLoaded", function() { $('#datatable').DataTable({ language: { - url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{config("app.datatable_locale")}}.json' + url: '//cdn.datatables.net/plug-ins/1.11.3/i18n/{{ config('app.datatable_locale') }}.json' }, processing: true, serverSide: true, stateSave: true, - ajax: "{{route('admin.store.datatable')}}", - order: [[ 2, "desc" ]], - columns: [ - {data: 'disabled'}, - {data: 'type'}, - {data: 'price'}, - {data: 'display'}, - {data: 'description'}, - {data: 'created_at'}, - {data: 'actions', sortable: false}, + ajax: "{{ route('admin.store.datatable') }}", + order: [ + [2, "desc"] ], - fnDrawCallback: function( oSettings ) { + columns: [{ + data: 'disabled' + }, + { + data: 'type' + }, + { + data: 'price' + }, + { + data: 'display' + }, + { + data: 'description' + }, + { + data: 'created_at' + }, + { + data: 'actions', + sortable: false + }, + ], + fnDrawCallback: function(oSettings) { $('[data-toggle="popover"]').popover(); } });
{{__('Active')}}{{__('Type')}}{{__('Price')}}{{__('Display')}}{{__('Description')}}{{__('Created at')}}
{{ __('Active') }}{{ __('Type') }}{{ __('Price') }}{{ __('Display') }}{{ __('Description') }}{{ __('Created at') }}