mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 03:57:32 -05:00 
			
		
		
		
	Revoking the manadate when deleting
This commit is contained in:
		
							parent
							
								
									1ae9cde8ff
								
							
						
					
					
						commit
						b3aa7877b9
					
				@ -14,6 +14,7 @@ namespace App\PaymentDrivers;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
use App\Http\Requests\Gateways\Mollie\Mollie3dsRequest;
 | 
					use App\Http\Requests\Gateways\Mollie\Mollie3dsRequest;
 | 
				
			||||||
use App\Http\Requests\Payments\PaymentWebhookRequest;
 | 
					use App\Http\Requests\Payments\PaymentWebhookRequest;
 | 
				
			||||||
 | 
					use App\Jobs\Util\SystemLogger;
 | 
				
			||||||
use App\Models\ClientGatewayToken;
 | 
					use App\Models\ClientGatewayToken;
 | 
				
			||||||
use App\Models\GatewayType;
 | 
					use App\Models\GatewayType;
 | 
				
			||||||
use App\Models\Payment;
 | 
					use App\Models\Payment;
 | 
				
			||||||
@ -138,4 +139,25 @@ class MolliePaymentDriver extends BaseDriver
 | 
				
			|||||||
            return (new CreditCard($this))->processUnsuccessfulPayment($e);
 | 
					            return (new CreditCard($this))->processUnsuccessfulPayment($e);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function detach(ClientGatewayToken $token)
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $this->init();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        try {
 | 
				
			||||||
 | 
					            $this->gateway->mandates->revokeForId($token->gateway_customer_reference, $token->token);
 | 
				
			||||||
 | 
					        } catch (\Mollie\Api\Exceptions\ApiException $e) {
 | 
				
			||||||
 | 
					            SystemLogger::dispatch(
 | 
				
			||||||
 | 
					                [
 | 
				
			||||||
 | 
					                    'server_response' => $e->getMessage(),
 | 
				
			||||||
 | 
					                    'data' => request()->all(),
 | 
				
			||||||
 | 
					                ],
 | 
				
			||||||
 | 
					                SystemLog::CATEGORY_GATEWAY_RESPONSE,
 | 
				
			||||||
 | 
					                SystemLog::EVENT_GATEWAY_FAILURE,
 | 
				
			||||||
 | 
					                SystemLog::TYPE_MOLLIE,
 | 
				
			||||||
 | 
					                $this->client,
 | 
				
			||||||
 | 
					                $this->client->company
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user