mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Ability to detach payment method
This commit is contained in:
parent
f848fd83a8
commit
42991e1813
@ -188,4 +188,27 @@ class GoCardlessPaymentDriver extends BaseDriver
|
||||
{
|
||||
return \round(($amount * pow(10, $precision)), 0);
|
||||
}
|
||||
|
||||
public function detach(ClientGatewayToken $token)
|
||||
{
|
||||
$this->init();
|
||||
|
||||
try {
|
||||
$this->gateway->mandates()->cancel($token->token);
|
||||
} catch (\Exception $e) {
|
||||
nlog($e->getMessage());
|
||||
|
||||
SystemLogger::dispatch(
|
||||
[
|
||||
'server_response' => $e->getMessage(),
|
||||
'data' => request()->all(),
|
||||
],
|
||||
SystemLog::CATEGORY_GATEWAY_RESPONSE,
|
||||
SystemLog::EVENT_GATEWAY_FAILURE,
|
||||
SystemLog::TYPE_GOCARDLESS,
|
||||
$this->client,
|
||||
$this->client->company
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user