mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-22 19:40:55 -04:00
Fixes for removing payment methods
This commit is contained in:
parent
f9b788ba50
commit
c224255621
@ -120,16 +120,23 @@ class PaymentMethodController extends Controller
|
|||||||
{
|
{
|
||||||
// $gateway = $this->getClientGateway();
|
// $gateway = $this->getClientGateway();
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
$payment_method->gateway
|
$payment_method->gateway
|
||||||
->driver(auth()->user()->client)
|
->driver(auth()->user()->client)
|
||||||
->setPaymentMethod(request()->query('method'))
|
->setPaymentMethod(request()->query('method'))
|
||||||
->detach($payment_method);
|
->detach($payment_method);
|
||||||
|
|
||||||
try {
|
|
||||||
event(new MethodDeleted($payment_method, auth('contact')->user()->company, Ninja::eventVars(auth('contact')->user()->id)));
|
event(new MethodDeleted($payment_method, auth('contact')->user()->company, Ninja::eventVars(auth('contact')->user()->id)));
|
||||||
|
|
||||||
$payment_method->delete();
|
$payment_method->delete();
|
||||||
|
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
|
|
||||||
|
event(new MethodDeleted($payment_method, auth('contact')->user()->company, Ninja::eventVars(auth('contact')->user()->id)));
|
||||||
|
|
||||||
|
$payment_method->delete();
|
||||||
|
|
||||||
nlog($e->getMessage());
|
nlog($e->getMessage());
|
||||||
|
|
||||||
return back();
|
return back();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user