diff --git a/app/Http/Controllers/Customers/Payments.php b/app/Http/Controllers/Customers/Payments.php index f908a29e4..8ddadde3e 100644 --- a/app/Http/Controllers/Customers/Payments.php +++ b/app/Http/Controllers/Customers/Payments.php @@ -23,7 +23,7 @@ class Payments extends Controller { $payments = Payment::with(['account', 'category'])->where('customer_id', '=', Auth::user()->customer->id)->paginate(); - $payment_methods = Modules::getPaymentMethods(); + $payment_methods = Modules::getPaymentMethods('all'); $categories = collect(Category::enabled()->type('income')->pluck('name', 'id')) ->prepend(trans('general.all_type', ['type' => trans_choice('general.categories', 2)]), ''); diff --git a/app/Utilities/Modules.php b/app/Utilities/Modules.php index 9d773da17..f36adb8ce 100644 --- a/app/Utilities/Modules.php +++ b/app/Utilities/Modules.php @@ -11,14 +11,14 @@ use App\Events\PaymentGatewayListing; class Modules { - public static function getPaymentMethods() + public static function getPaymentMethods($type = null) { $payment_methods = Cache::get('payment_methods.admin'); $customer = auth()->user()->customer; - if ($customer) { + if ($customer && $type != 'all') { $payment_methods = Cache::get('payment_methods.customer'); } @@ -38,7 +38,7 @@ class Modules continue; } - if ($customer && empty($gateway['customer'])) { + if (($customer && empty($gateway['customer'])) && $type != 'all') { continue; }