shetabit/multipay

View on GitHub

Showing 87 of 98 total issues

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

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

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

        public function purchase()
        {
            $data = array(
                'action' => 'token',
                'TerminalId' => $this->settings->terminalId,
    Severity: Minor
    Found in src/Drivers/SEP/SEP.php - About 1 hr to fix

      Method powMod has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function powMod($p, $q, $r)
          {
              $factors = array();
              $div = $q;
              $power_of_two = 0;
      Severity: Minor
      Found in src/Drivers/Pasargad/Utils/RSA.php - About 1 hr to fix

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

            public function purchase()
            {
                $data = array(
                    'MID' => $this->settings->merchantId,
                    'ResNum' => $this->invoice->getUuid(),
        Severity: Minor
        Found in src/Drivers/Saman/Saman.php - About 1 hr to fix

          Method _fn_return_state_text has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function _fn_return_state_text($state)
          {
              switch ($state) {
                  case "CanceledByUser":
                      return "پرداخت توسط شما لغو شده است.";
          Severity: Minor
          Found in src/Drivers/Atipay/Core/fn.atipay.php - About 1 hr to fix

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

                public function verify(): ReceiptInterface
                {
                    $data = array(
                        'RefNum' => Request::input('RefNum'),
                        'merchantId' => $this->settings->merchantId,
            Severity: Minor
            Found in src/Drivers/Saman/Saman.php - About 1 hr to fix

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

                  public function purchase()
                  {
                      $client = new SoapClient($this->settings->apiPurchaseUrl, array('trace' => true));
              
                      $data = new stdClass();
              Severity: Minor
              Found in src/Drivers/Yekpay/Yekpay.php - About 1 hr to fix

                Function fn_atipay_verify_payment has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                function fn_atipay_verify_payment($params, $amount)
                {
                    $r = wsRequestPost(ATIPAY_VERIFY_URL, $params);
                    $return = array();
                    if ($r) {
                Severity: Minor
                Found in src/Drivers/Atipay/Core/fn.atipay.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 verify has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function verify(): ReceiptInterface
                    {
                        $token = $this->invoice->getTransactionId() ?? Request::input('token');
                        $refNum = Request::input('RefNum');
                
                
                Severity: Minor
                Found in src/Drivers/Omidpay/Omidpay.php - About 1 hr to fix

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

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

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

                        public function verify(): ReceiptInterface
                        {
                            $params = $_POST;
                            $result = fn_check_callback_data($params);
                            $payment_id = $params['reservationNumber'];
                    Severity: Minor
                    Found in src/Drivers/Atipay/Atipay.php - About 1 hr to fix

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

                          public function verify() : ReceiptInterface
                          {
                              $status = Request::input('responseCode');
                              if (Request::input('responseCode') != "00") {
                                  return $this->notVerified($status);
                      Severity: Minor
                      Found in src/Drivers/Irankish/Irankish.php - About 1 hr to fix

                        Method purchaseFailed has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function purchaseFailed($status)
                            {
                                $translations = [
                                    "1"  => "Internal Server Error",
                                    "2"  => "Resource Not Found",
                        Severity: Minor
                        Found in src/Drivers/Azki/Azki.php - About 1 hr to fix

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

                              public function purchase()
                              {
                                  $details = $this->invoice->getDetails();
                          
                                  $amount = $this->invoice->getAmount() * ($this->settings->currency == 'T' ? 10 : 1); // convert to rial
                          Severity: Minor
                          Found in src/Drivers/Zibal/Zibal.php - About 1 hr to fix

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

                                public function purchase()
                                {
                                    $data = [
                                        'pin' => $this->settings->mode === "normal" ? $this->settings->pin : "sandbox",
                                        'amount' => $this->invoice->getAmount() / ($this->settings->currency == 'T' ? 1 : 10), // convert to toman
                            Severity: Minor
                            Found in src/Drivers/Aqayepardakht/Aqayepardakht.php - About 1 hr to fix

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

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

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

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

                                  Function _fn_return_state_text has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function _fn_return_state_text($state)
                                  {
                                      switch ($state) {
                                          case "CanceledByUser":
                                              return "پرداخت توسط شما لغو شده است.";
                                  Severity: Minor
                                  Found in src/Drivers/Atipay/Core/fn.atipay.php - About 55 mins 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 paymentRequest has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      public function paymentRequest($amount, $referenceNumber, $userIdentifier, $callbackUrl, $currency = 'IRR', $description = null, $additionalData = null)
                                  Severity: Major
                                  Found in src/Drivers/Jibit/JibitClient.php - About 50 mins to fix

                                    Function verify has a Cognitive Complexity of 8 (exceeds 5 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 45 mins 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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language