mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-12 22:22:32 +01:00
Fixes for gocardless invalid credentials
This commit is contained in:
parent
f80767bcfc
commit
814ac115e8
@ -98,10 +98,17 @@ class GoCardlessPaymentDriver extends BaseDriver
|
||||
|
||||
public function init(): self
|
||||
{
|
||||
$this->gateway = new \GoCardlessPro\Client([
|
||||
'access_token' => $this->company_gateway->getConfigField('accessToken'),
|
||||
'environment' => $this->company_gateway->getConfigField('testMode') ? \GoCardlessPro\Environment::SANDBOX : \GoCardlessPro\Environment::LIVE,
|
||||
]);
|
||||
try {
|
||||
$this->gateway = new \GoCardlessPro\Client([
|
||||
'access_token' => $this->company_gateway->getConfigField('accessToken'),
|
||||
'environment' => $this->company_gateway->getConfigField('testMode') ? \GoCardlessPro\Environment::SANDBOX : \GoCardlessPro\Environment::LIVE,
|
||||
]);
|
||||
}
|
||||
catch(\GoCardlessPro\Core\Exception\AuthenticationException $e){
|
||||
|
||||
throw new \Exception('GoCardless: Invalid Access Token', 403);
|
||||
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user