From 5ba3e918c99eae155d75e7156d6cadc0085a7ce9 Mon Sep 17 00:00:00 2001 From: mahdi khanzadi Date: Sun, 5 Jan 2020 20:17:36 +0330 Subject: [PATCH] fix bugs --- src/Drivers/Zibal/Zibal.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Drivers/Zibal/Zibal.php b/src/Drivers/Zibal/Zibal.php index 898e618..a25b682 100644 --- a/src/Drivers/Zibal/Zibal.php +++ b/src/Drivers/Zibal/Zibal.php @@ -109,12 +109,11 @@ public function purchase() */ public function pay() { - if (strtolower($this->getMode()) == 'direct') { - $payUrl = $this->settings->apiPaymentUrl.$this->invoice->getTransactionId().'/direct'; - } else { - $payUrl = $this->settings->apiPaymentUrl.$this->invoice->getTransactionId(); - } + $payUrl = $this->settings->apiPaymentUrl.$this->invoice->getTransactionId(); + if (strtolower($this->settings->mode) == 'direct') { + $payUrl .= '/direct'; + } // redirect using laravel logic return redirect()->to($payUrl);