mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Update PaymentMethodController:destroy() with generic gateway detach
This commit is contained in:
parent
e36ff351de
commit
020005d20d
@ -135,6 +135,13 @@ class PaymentMethodController extends Controller
|
||||
*/
|
||||
public function destroy(ClientGatewayToken $payment_method)
|
||||
{
|
||||
$gateway = $this->getClientGateway();
|
||||
|
||||
$gateway
|
||||
->driver(auth()->user()->client)
|
||||
->setPaymentMethod(request()->query('method'))
|
||||
->detach($payment_method);
|
||||
|
||||
try {
|
||||
event(new MethodDeleted($payment_method, auth('contact')->user()->company, Ninja::eventVars()));
|
||||
$payment_method->delete();
|
||||
|
Loading…
x
Reference in New Issue
Block a user