shetabit/multipay

View on GitHub

Showing 87 of 98 total issues

Method verify has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function verify() : ReceiptInterface
    {
        $PaymentStatus = Request::input('PaymentStatus');
        if ($PaymentStatus != 'OK') {
            throw new InvalidPaymentException('تراکنش از سوی کاربر لغو شد', $PaymentStatus);
Severity: Minor
Found in src/Drivers/Gooyapay/Gooyapay.php - About 1 hr to fix

    Method oauth has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function oauth()
        {
            $response = $this
                ->client
                ->request(
    Severity: Minor
    Found in src/Drivers/Digipay/Digipay.php - About 1 hr to fix

      Method verify has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function verify(): ReceiptInterface
          {
              $authority = $this->invoice->getTransactionId() ?? Request::input('Authority');
              $data = [
                  "merchant_id" => $this->settings->merchantId,
      Severity: Minor
      Found in src/Drivers/Zarinpal/Strategies/Normal.php - About 1 hr to fix

        Method purchase has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function purchase()
            {
                $name = $this->extractDetails('name');
                $mobile = $this->extractDetails('mobile');
                $email = $this->extractDetails('email');
        Severity: Minor
        Found in src/Drivers/Payping/Payping.php - About 1 hr to fix

          Method purchase has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function purchase()
              {
                  $mobile = $this->extractDetails('mobile');
                  $description = $this->extractDetails('description');
                  $nationalCode = $this->extractDetails('national_code');
          Severity: Minor
          Found in src/Drivers/Vandar/Vandar.php - About 1 hr to fix

            Method verify has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function verify() : ReceiptInterface
                {
                    $amount = $this->invoice->getAmount() * ($this->settings->currency == 'T' ? 10 : 1); // convert to rial
                    $refNum = Request::post('ref_num');
                    $cardNumber = Request::post('card_number');
            Severity: Minor
            Found in src/Drivers/Paystar/Paystar.php - About 1 hr to fix

              Method purchase has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function purchase(): string
                  {
                      $data = array(
                          'WSContext' => [
                              'UserId' => $this->settings->username,
              Severity: Minor
              Found in src/Drivers/Omidpay/Omidpay.php - About 1 hr to fix

                Method notVerified has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function notVerified($status)
                    {
                        $translations = array(
                            "1" => "پرداخت انجام نشده است.",
                            "2" => "پرداخت ناموفق بوده است.",
                Severity: Minor
                Found in src/Drivers/Idpay/Idpay.php - About 1 hr to fix

                  Method notVerified has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function notVerified($status)
                      {
                          $translations = array(
                              0 => 'درحال حاضر درگاه بانکی قطع شده و مشکل بزودی برطرف می شود',
                              -1 => 'API Key ارسال نمی شود',
                  Severity: Minor
                  Found in src/Drivers/Payir/Payir.php - About 1 hr to fix

                    Method purchase has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function purchase()
                        {
                            $amount = $this->invoice->getAmount() * ($this->settings->currency == 'T' ? 10 : 1); // convert to rial
                    
                            if (!empty($this->invoice->getDetails()['description'])) {
                    Severity: Minor
                    Found in src/Drivers/Zarinpal/Strategies/Normal.php - About 1 hr to fix

                      Method purchase has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function purchase()
                          {
                              $details  = $this->invoice->getDetails();
                              $order_id = $this->invoice->getUuid();
                      
                      
                      Severity: Minor
                      Found in src/Drivers/Azki/Azki.php - About 1 hr to fix

                        Method callCurl has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function callCurl($url, $arrayData, $haveAuth = false, $try = 0, $method = 'POST')
                            {
                                $data = $arrayData;
                                $jsonData = json_encode($data);
                                $accessToken = '';
                        Severity: Minor
                        Found in src/Drivers/Jibit/JibitClient.php - About 1 hr to fix

                          Method purchase has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function purchase()
                              {
                                  $metadata = [];
                          
                                  if (!empty($this->invoice->getDetails()['description'])) {
                          Severity: Minor
                          Found in src/Drivers/Minipay/Minipay.php - About 1 hr to fix

                            Function purchase has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function purchase()
                                {
                                    $details = $this->invoice->getDetails();
                            
                                    $name = '';
                            Severity: Minor
                            Found in src/Drivers/Gooyapay/Gooyapay.php - About 1 hr to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Method purchase has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function purchase()
                                {
                                    $orderId = $this->extractDetails('orderId');
                                    $phone = $this->extractDetails('phone');
                                    $description = $this->extractDetails('description') ?: $this->settings->description;
                            Severity: Minor
                            Found in src/Drivers/Sepordeh/Sepordeh.php - About 1 hr to fix

                              Method verify has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function verify(): ReceiptInterface
                                  {
                                      $status = (int)Request::input('Status');
                                      if ($status != 2) {
                                          $this->purchaseFailed($status);
                              Severity: Minor
                              Found in src/Drivers/SEP/SEP.php - About 1 hr to fix

                                Method verify has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function verify(): ReceiptInterface
                                    {
                                        $authority = $this->invoice->getTransactionId() ?? Request::input('Authority');
                                        $data = [
                                            "merchant_id" => $this->settings->merchantId,
                                Severity: Minor
                                Found in src/Drivers/Minipay/Minipay.php - About 1 hr to fix

                                  Method verify has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function verify(): ReceiptInterface
                                      {
                                          $tracking_number = Request::post("tracking_number");
                                          $transid = Request::post("transid");
                                          if ($tracking_number === null || $tracking_number === ""|| $transid === ""|| $transid === null) {
                                  Severity: Minor
                                  Found in src/Drivers/Aqayepardakht/Aqayepardakht.php - About 1 hr to fix

                                    Method verify has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function verify() : ReceiptInterface
                                        {
                                            $refId = Request::input('refid');
                                            $data = [
                                                'amount' => $this->invoice->getAmount() / ($this->settings->currency == 'T' ? 1 : 10), // convert to toman
                                    Severity: Minor
                                    Found in src/Drivers/Payping/Payping.php - About 1 hr to fix

                                      Method verify has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function verify(): ReceiptInterface
                                          {
                                              $resCode = Request::input('ResCode');
                                              if ($resCode != '0') {
                                                  throw new InvalidPaymentException($this->translateStatus($resCode), $resCode);
                                      Severity: Minor
                                      Found in src/Drivers/Behpardakht/Behpardakht.php - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language