mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 03:54:36 -04:00
Minor fixes for deleting payment methods
This commit is contained in:
parent
4f99830ed0
commit
7057ca30d6
@ -118,25 +118,24 @@ class PaymentMethodController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function destroy(ClientGatewayToken $payment_method)
|
public function destroy(ClientGatewayToken $payment_method)
|
||||||
{
|
{
|
||||||
// $gateway = $this->getClientGateway();
|
|
||||||
|
if($payment_method->gateway()->exists()){
|
||||||
|
|
||||||
|
$payment_method->gateway
|
||||||
|
->driver(auth()->user()->client)
|
||||||
|
->setPaymentMethod(request()->query('method'))
|
||||||
|
->detach($payment_method);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
$payment_method->gateway
|
|
||||||
->driver(auth()->user()->client)
|
|
||||||
->setPaymentMethod(request()->query('method'))
|
|
||||||
->detach($payment_method);
|
|
||||||
|
|
||||||
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