shetabit/multipay

View on GitHub

Showing 98 of 98 total issues

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

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

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

        public function purchase()
        {
            $data = [
                'api_key' => $this->settings->merchantId,
                'order_id' => intval(1, time()) . crc32($this->invoice->getUuid()),
    Severity: Minor
    Found in src/Drivers/Nextpay/Nextpay.php - About 1 hr to fix

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

          public function verify(): ReceiptInterface
          {
              $token = Request::get('token');
              $paymentStatus = Request::get('payment_status');
              $data = [
      Severity: Minor
      Found in src/Drivers/Vandar/Vandar.php - About 1 hr to fix

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

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

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

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

            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
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language