mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
fixes for refundS
This commit is contained in:
parent
ea38fb2b37
commit
97c58bcf70
@ -72,6 +72,9 @@ class CompanyController extends BaseController
|
|||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
$this->company_repo = $company_repo;
|
$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)
|
public function destroy(DestroyCompanyRequest $request, Company $company)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(Ninja::isHosted() && config('ninja.ninja_default_company_id') == $company->id)
|
if(Ninja::isHosted() && config('ninja.ninja_default_company_id') == $company->id)
|
||||||
return response()->json(['message' => 'Cannot purge this company'], 400);
|
return response()->json(['message' => 'Cannot purge this company'], 400);
|
||||||
|
|
||||||
|
@ -81,8 +81,14 @@ class RefundPayment
|
|||||||
|
|
||||||
if ($response['success'] == false) {
|
if ($response['success'] == false) {
|
||||||
$this->payment->save();
|
$this->payment->save();
|
||||||
throw new PaymentRefundFailed($response['description']);
|
|
||||||
|
if(array_key_exists('description', $response))
|
||||||
|
throw new PaymentRefundFailed($response['description']);
|
||||||
|
else
|
||||||
|
throw new PaymentRefundFailed();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->payment->refunded += $this->total_refund;
|
$this->payment->refunded += $this->total_refund;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user