diff --git a/app/Http/Controllers/CompanyController.php b/app/Http/Controllers/CompanyController.php index e77fa41e7e74..af8bb9522ece 100644 --- a/app/Http/Controllers/CompanyController.php +++ b/app/Http/Controllers/CompanyController.php @@ -72,6 +72,9 @@ class CompanyController extends BaseController parent::__construct(); $this->company_repo = $company_repo; + + // $this->middleware('password_protected')->only(['destroy']); + } /** @@ -477,7 +480,7 @@ class CompanyController extends BaseController */ public function destroy(DestroyCompanyRequest $request, Company $company) { - + if(Ninja::isHosted() && config('ninja.ninja_default_company_id') == $company->id) return response()->json(['message' => 'Cannot purge this company'], 400); diff --git a/app/Services/Payment/RefundPayment.php b/app/Services/Payment/RefundPayment.php index a1d733311e1e..0d10b83fa745 100644 --- a/app/Services/Payment/RefundPayment.php +++ b/app/Services/Payment/RefundPayment.php @@ -81,8 +81,14 @@ class RefundPayment if ($response['success'] == false) { $this->payment->save(); - throw new PaymentRefundFailed($response['description']); + + if(array_key_exists('description', $response)) + throw new PaymentRefundFailed($response['description']); + else + throw new PaymentRefundFailed(); + } + } } else { $this->payment->refunded += $this->total_refund;