mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-02 19:24:34 -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)
|
public function destroy(ClientGatewayToken $payment_method)
|
||||||
{
|
{
|
||||||
|
$gateway = $this->getClientGateway();
|
||||||
|
|
||||||
|
$gateway
|
||||||
|
->driver(auth()->user()->client)
|
||||||
|
->setPaymentMethod(request()->query('method'))
|
||||||
|
->detach($payment_method);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
event(new MethodDeleted($payment_method, auth('contact')->user()->company, Ninja::eventVars()));
|
event(new MethodDeleted($payment_method, auth('contact')->user()->company, Ninja::eventVars()));
|
||||||
$payment_method->delete();
|
$payment_method->delete();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user