Initialization for GoCardless

This commit is contained in:
Benjamin Beganović 2021-09-29 14:44:23 +02:00
parent 33f0b6b7c6
commit b3f97054c5

View File

@ -63,6 +63,16 @@ class GoCardlessPaymentDriver extends BaseDriver
return $types; return $types;
} }
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,
]);
return $this;
}
public function authorizeView(array $data) public function authorizeView(array $data)
{ {
return $this->payment_method->authorizeView($data); return $this->payment_method->authorizeView($data);