diff --git a/app/Http/Controllers/Admin/CreditProductController.php b/app/Http/Controllers/Admin/CreditProductController.php index 772fa620..d85297fe 100644 --- a/app/Http/Controllers/Admin/CreditProductController.php +++ b/app/Http/Controllers/Admin/CreditProductController.php @@ -21,11 +21,16 @@ class CreditProductController extends Controller */ public function index(Request $request) { - $isPaypalSetup = false; - if (env('PAYPAL_SECRET') && env('PAYPAL_CLIENT_ID')) $isPaypalSetup = true; + $isPaymentSetup = false; + + if ( + env('APP_ENV') == 'local' || + env('PAYPAL_SECRET') && env('PAYPAL_CLIENT_ID') || + env('STRIPE_SECRET') && env('STRIPE_ENDPOINT_SECRET') && env('STRIPE_METHODS') + ) $isPaymentSetup = true; return view('admin.store.index', [ - 'isPaypalSetup' => $isPaypalSetup + 'isPaymentSetup' => $isPaymentSetup ]); } diff --git a/app/Http/Controllers/StoreController.php b/app/Http/Controllers/StoreController.php index 9fd48ea7..c2ce00e8 100644 --- a/app/Http/Controllers/StoreController.php +++ b/app/Http/Controllers/StoreController.php @@ -11,15 +11,13 @@ class StoreController extends Controller /** Display a listing of the resource. */ public function index() { - $isPaypalSetup = false; - $isStripeSetup = false; + $isPaymentSetup = 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; + if ( + env('APP_ENV') == 'local' || + env('PAYPAL_SECRET') && env('PAYPAL_CLIENT_ID') || + env('STRIPE_SECRET') && env('STRIPE_ENDPOINT_SECRET') && env('STRIPE_METHODS') + ) $isPaymentSetup = true; //Required Verification for creating an server if (Configuration::getValueByKey('FORCE_EMAIL_VERIFICATION', false) === 'true' && !Auth::user()->hasVerifiedEmail()) { @@ -33,8 +31,7 @@ class StoreController extends Controller return view('store.index')->with([ 'products' => CreditProduct::where('disabled', '=', false)->orderBy('price', 'asc')->get(), - 'isPaypalSetup' => $isPaypalSetup, - 'isStripeSetup' => $isStripeSetup + 'isPaymentSetup' => $isPaymentSetup, ]); } } diff --git a/resources/views/admin/store/index.blade.php b/resources/views/admin/store/index.blade.php index cc09f06b..fa679ce2 100644 --- a/resources/views/admin/store/index.blade.php +++ b/resources/views/admin/store/index.blade.php @@ -26,20 +26,14 @@
{{ __('To configure PayPal, head to the .env and add your PayPal’s client id and secret.') }} -
-{{ __('To configure Stripe, head to the .env and add your Stripüe Secret, Endpoint and supported Payment Methods.') }} +
{{ __('To configure your payment methods, head to the .env and add the required options for your prefered payment method.') }}