From b3f97054c56366d98f00d275829047b7abf6da24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Wed, 29 Sep 2021 14:44:23 +0200 Subject: [PATCH] Initialization for GoCardless --- app/PaymentDrivers/GoCardlessPaymentDriver.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/PaymentDrivers/GoCardlessPaymentDriver.php b/app/PaymentDrivers/GoCardlessPaymentDriver.php index f445ec14b22d..f04796cfe8d4 100644 --- a/app/PaymentDrivers/GoCardlessPaymentDriver.php +++ b/app/PaymentDrivers/GoCardlessPaymentDriver.php @@ -63,6 +63,16 @@ class GoCardlessPaymentDriver extends BaseDriver 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) { return $this->payment_method->authorizeView($data);