Fixes for removing payment methods

This commit is contained in:
David Bomba 2021-08-07 14:58:04 +10:00
parent f9b788ba50
commit c224255621

View File

@ -120,16 +120,23 @@ class PaymentMethodController extends Controller
{
// $gateway = $this->getClientGateway();
try {
$payment_method->gateway
->driver(auth()->user()->client)
->setPaymentMethod(request()->query('method'))
->detach($payment_method);
try {
event(new MethodDeleted($payment_method, auth('contact')->user()->company, Ninja::eventVars(auth('contact')->user()->id)));
$payment_method->delete();
} catch (Exception $e) {
event(new MethodDeleted($payment_method, auth('contact')->user()->company, Ninja::eventVars(auth('contact')->user()->id)));
$payment_method->delete();
nlog($e->getMessage());
return back();