From eaa94bdebef281dbecb5010caf720e7e2196fd1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Thu, 7 Oct 2021 16:51:27 +0200 Subject: [PATCH] Initialize \Razorpay\Api\Api client --- app/PaymentDrivers/RazorpayPaymentDriver.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/PaymentDrivers/RazorpayPaymentDriver.php b/app/PaymentDrivers/RazorpayPaymentDriver.php index 6436a0130551..54f1ee0c2c67 100644 --- a/app/PaymentDrivers/RazorpayPaymentDriver.php +++ b/app/PaymentDrivers/RazorpayPaymentDriver.php @@ -29,7 +29,7 @@ class RazorpayPaymentDriver extends BaseDriver public $can_authorise_credit_card = false; - public $gateway; + public \Razorpay\Api\Api $gateway; public $payment_method; @@ -39,6 +39,16 @@ class RazorpayPaymentDriver extends BaseDriver const SYSTEM_LOG_TYPE = SystemLog::TYPE_RAZORPAY; + public function init(): self + { + $this->gateway = new \Razorpay\Api\Api( + $this->company_gateway->getConfigField('apiKey'), + $this->company_gateway->getConfigField('apiSecret'), + ); + + return $this; + } + public function gatewayTypes(): array { return [