From 2c331b313257392afa277f55abf7b530d15dc2bb Mon Sep 17 00:00:00 2001 From: Aminul Islam Date: Tue, 20 Oct 2020 20:15:21 +0600 Subject: [PATCH] Fix login check --- modules/gateways/callback/bkashlegacy.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/modules/gateways/callback/bkashlegacy.php b/modules/gateways/callback/bkashlegacy.php index 6ed947e..aca438f 100644 --- a/modules/gateways/callback/bkashlegacy.php +++ b/modules/gateways/callback/bkashlegacy.php @@ -1,10 +1,5 @@ request = Request::createFromGlobals(); + $this->request = \Symfony\Component\HttpFoundation\Request::createFromGlobals(); } /** @@ -163,12 +158,12 @@ private function setInvoice() private function setCurrency() { $this->gatewayCurrency = (int)$this->gatewayParams['convertto']; - $this->customerCurrency = Capsule::table('tblclients') + $this->customerCurrency = \WHMCS\Database\Capsule::table('tblclients') ->where('id', '=', $this->invoice['userid']) ->value('currency'); if (!empty($this->gatewayCurrency) && ($this->customerCurrency !== $this->gatewayCurrency)) { - $this->convoRate = Capsule::table('tblcurrencies') + $this->convoRate = \WHMCS\Database\Capsule::table('tblcurrencies') ->where('id', '=', $this->gatewayCurrency) ->value('rate'); } else { @@ -247,7 +242,7 @@ private function addTransaction($trxId) 'invoiceid' => $this->invoice['invoiceid'], 'transid' => $trxId, 'gateway' => $this->gatewayModuleName, - 'date' => Carbon::now()->toDateTimeString(), + 'date' => \Carbon\Carbon::now()->toDateTimeString(), 'amount' => $this->due, 'fees' => $this->fee, ]; @@ -388,7 +383,7 @@ public function makeTransaction() die("Direct access forbidden."); } -if ((new ClientArea())->isLoggedIn()) { +if (!(new \WHMCS\ClientArea())->isLoggedIn()) { die("You will need to login first."); }