vindi/vindi-woocommerce

View on GitHub
src/utils/PaymentGateway.php

Summary

Maintainability
A
3 hrs
Test Coverage

get_country_code accesses the super-global variable $_GET.
Open

  public function get_country_code()
  {
    if (isset($_GET['order_id'])) {
      $order = new WC_Order(filter_var($_GET['order_id'], FILTER_SANITIZE_NUMBER_INT));
      return $order->billing_country;
Severity: Minor
Found in src/utils/PaymentGateway.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

get_country_code accesses the super-global variable $_GET.
Open

  public function get_country_code()
  {
    if (isset($_GET['order_id'])) {
      $order = new WC_Order(filter_var($_GET['order_id'], FILTER_SANITIZE_NUMBER_INT));
      return $order->billing_country;
Severity: Minor
Found in src/utils/PaymentGateway.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

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

  public function get_level3_data_from_order($order)
  {
    // WC Versions before 3.0 don't support postcodes and are
    // incompatible with level3 data.
    if (VindiHelpers::is_wc_lt('3.0')) {
Severity: Minor
Found in src/utils/PaymentGateway.php - About 1 hr to fix

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

      public function process_refund($order_id, $amount = null, $reason = '') {
        $order_id = filter_var($order_id, FILTER_SANITIZE_NUMBER_INT);
        $amount = filter_var($amount, FILTER_SANITIZE_NUMBER_FLOAT);
        $reason = sanitize_text_field($reason);
        $order = wc_get_order($order_id);
    Severity: Minor
    Found in src/utils/PaymentGateway.php - About 1 hr to fix

      Function process_refund has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        public function process_refund($order_id, $amount = null, $reason = '') {
          $order_id = filter_var($order_id, FILTER_SANITIZE_NUMBER_INT);
          $amount = filter_var($amount, FILTER_SANITIZE_NUMBER_FLOAT);
          $reason = sanitize_text_field($reason);
          $order = wc_get_order($order_id);
      Severity: Minor
      Found in src/utils/PaymentGateway.php - About 35 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

      Avoid unused local variables such as '$key'.
      Open

          foreach ($order_meta as $key => $order_item) {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpmd

      UnusedLocalVariable

      Since: 0.2

      Detects when a local variable is declared and/or assigned, but not used.

      Example

      class Foo {
          public function doSomething()
          {
              $i = 5; // Unused
          }
      }

      Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

      Avoid unused local variables such as '$results'.
      Open

          $results = [];
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpmd

      UnusedLocalVariable

      Since: 0.2

      Detects when a local variable is declared and/or assigned, but not used.

      Example

      class Foo {
          public function doSomething()
          {
              $i = 5; // Unused
          }
      }

      Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

      Avoid using static access to class 'VindiPaymentGateways\VindiHelpers' in method 'get_level3_data_from_order'.
      Open

            $discount_amount     = VindiHelpers::get_vindi_amount($item->get_subtotal() - $item->get_total(), $currency);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpmd

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class 'VindiPaymentGateways\VindiHelpers' in method 'get_level3_data_from_order'.
      Open

          if (VindiHelpers::is_wc_lt('3.0')) {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpmd

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class 'VindiPaymentGateways\VindiHelpers' in method 'get_level3_data_from_order'.
      Open

            $unit_cost           = VindiHelpers::get_vindi_amount(($item->get_subtotal() / $quantity), $currency);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpmd

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class 'VindiPaymentGateways\VindiHelpers' in method 'get_level3_data_from_order'.
      Open

            $tax_amount          = VindiHelpers::get_vindi_amount($item->get_total_tax(), $currency);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpmd

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class 'VindiPaymentGateways\VindiHelpers' in method 'get_level3_data_from_order'.
      Open

            'shipping_amount'      => VindiHelpers::get_vindi_amount($order->get_shipping_total() + $order->get_shipping_tax(), $currency), // The shipping cost, in cents, as a non-negative integer.
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpmd

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      The property $vindi_settings is not named in camelCase.
      Open

      abstract class VindiPaymentGateway extends WC_Payment_Gateway_CC
      {
        /**
         * @var bool
         */
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpmd

      CamelCasePropertyName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name attributes.

      Example

      class ClassName {
          protected $property_name;
      }

      Source

      A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 24 and the first side effect is on line 11.
      Open

      <?php
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      The abstract declaration must precede the visibility declaration
      Open

        public abstract function type();
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Terminating statement must be indented to the same level as the CASE body
      Open

                break;
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Blank line found at start of control structure
      Open

          if ($this->is_valid_br_zip_code($shipping_address_zip)) {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Expected 0 spaces before closing bracket; 1 found
      Open

              if (!is_null($amount) ) {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Closing class brace must be on a line by itself
      Open

      };
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line exceeds 120 characters; contains 130 characters
      Open

              'tax_amount'          => $tax_amount, // The amount of tax this item had added to it, in cents, as a non-negative integer.
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line exceeds 120 characters; contains 149 characters
      Open

              'discount_amount'     => $discount_amount, // The amount an item was discounted—if there was a sale,for example, as a non-negative integer.
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $request['amount'] = substr($amount, 0, strlen($amount)-2) . "." . substr($amount, -2);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Get refund request args.
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public function refund_transaction($bill_id, $amount = null, $reason = '') {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @return array
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              );
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              return apply_filters('vindi_refund_request', $request, $bill_id, $request['amount'], $reason);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param  float    $amount Refund amount.
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param  string   $reason Refund reason.
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public function get_refund_request($bill_id, $amount = null, $reason = '') {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line exceeds 120 characters; contains 209 characters
      Open

            'merchant_reference'   => $order->get_id(), // An alphanumeric string of up to  characters in length. This unique value is assigned by the merchant to identify the order. Also known as an “Order ID”.
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line exceeds 120 characters; contains 123 characters
      Open

            return $payment->abort(__('O Pagamento foi cancelado devido a erro de configuração do meio de pagamento.', VINDI));
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line exceeds 120 characters; contains 157 characters
      Open

            return new WP_Error('error', __('Não é possível realizar reembolsos parciais, faça um reembolso manual caso você opte por esta opção.', VINDI));
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param  int      $bill_id Order object.
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @return object Either an object of name value pairs for a success, or a WP_ERROR object.
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param  int      $bill_id Order object.
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              return $refund['last_transaction'];
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $request = array(
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if (!is_null($amount) ) {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if (empty($refund)) {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param  float    $amount Refund amount.
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Refund an order via PayPal.
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param  string   $reason Refund reason.
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 4 spaces, found 2
      Open

        exit;
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $this->vindi_settings = $vindi_settings;
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $this->routes = $vindi_settings->routes;
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

        protected $validated = true;
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

        public $vindi_settings;
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 8
      Open

              'tax_amount'          => $tax_amount, // The amount of tax this item had added to it, in cents, as a non-negative integer.
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $this->controllers = $controllers;
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

        public function get_level3_data_from_order($order)
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 8
      Open

              'unit_cost'           => $unit_cost, // Cost of the product, in cents, as a non-negative integer.
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            $level3_data['shipping_from_zip'] = $store_postcode;
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 6
      Open

            $this->vindi_settings->get_template('admin-gateway-settings.html.php', array('gateway' => $this));
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

        }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $currency = get_option('woocommerce_currency');
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          try {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

        public $controllers;
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $this->enabled = $this->get_option('enabled');
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 4 spaces, found 2
      Open

        {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $order_items = array_values($order->get_items());
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            $product_description = substr($item->get_name(), 0, 26);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 4 spaces, found 2
      Open

        {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $vindi_line_items = array_map(function ($item) use ($currency) {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 8
      Open

              'product_description' => $product_description, // Up to 26 characters long describing the product.
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          return in_array($currency, ['BRL']) && ! empty($api_key);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $payment = new VindiPaymentProcessor($order, $this, $this->vindi_settings, $this->controllers);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            return $payment->abort(__('O Pagamento foi cancelado devido a erro de configuração do meio de pagamento.', VINDI));
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            $order->reduce_order_stock();
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $currency    = $order->get_currency();
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

        public function is_valid_br_zip_code($zip)
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

        public function get_country_code()
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

        }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            $response = $payment->process();
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 8
      Open

              : $item->get_product_id();
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 8
      Open

              'discount_amount'     => $discount_amount, // The amount an item was discounted—if there was a sale,for example, as a non-negative integer.
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $this->logger->log(sprintf('Processando pedido %s.', $order_id));
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          if (! $this->validate_settings()) {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          if (VindiHelpers::is_wc_lt('3.0')) {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            return array();
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            return (object) array(
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          }, $order_items);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $store_postcode = get_option('woocommerce_store_postcode');
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $order   = wc_get_order($order_id);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

        }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 4 spaces, found 2
      Open

        {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          if (isset($_GET['order_id'])) {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

        public function process_payment($order_id)
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 8
      Open

              'result'   => 'fail',
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 20 spaces, found 12
      Open

                  sprintf(__('[Transação #%2$s]: reembolsado R$%1$s', VINDI), $result['amount'], $result['id'])
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

        public abstract function type();
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $this->logger = $this->vindi_settings->logger;
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            $quantity            = $item->get_quantity();
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            $unit_cost           = VindiHelpers::get_vindi_amount(($item->get_subtotal() / $quantity), $currency);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 4 spaces, found 2
      Open

        {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $order_id = filter_var($order_id, FILTER_SANITIZE_NUMBER_INT);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          if (! $this->validated) {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 16 spaces, found 8
      Open

              case 'success':
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 20 spaces, found 10
      Open

                $order->add_order_note(
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

        private function find_bill_last_charge($bill_id)
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

        protected $routes;
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          if (is_admin()) {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            add_action('woocommerce_update_options_payment_gateways_' . $this->id, array(&$this, 'process_admin_options'));
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            $product_id          = $item->get_variation_id()
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            $tax_amount          = VindiHelpers::get_vindi_amount($item->get_total_tax(), $currency);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

        public function admin_options()
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

        public function validate_settings()
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 8
      Open

              ? $item->get_variation_id()
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $reason = sanitize_text_field($reason);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 16 spaces, found 8
      Open

              throw new Exception($result->errors[0]->message);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          return $level3_data;
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Opening brace should be on a new line
      Open

          public function refund_transaction($bill_id, $amount = null, $reason = '') {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          return end($charges);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $reason = sanitize_text_field($reason);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $charge_id = $last_charge['id'];
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

        public function __construct(VindiSettings $vindi_settings, VindiControllers $controllers)
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 4 spaces, found 2
      Open

        {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $this->title = $this->get_option('title');
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          );
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          if ($this->is_valid_br_zip_code($store_postcode)) {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            $order = new WC_Order(filter_var($_GET['order_id'], FILTER_SANITIZE_NUMBER_INT));
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 4 spaces, found 2
      Open

        {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            $result = $this->refund_transaction($bill_id, $amount, $reason);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 12 spaces, found 6
      Open

            if(isset($result->errors)) {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Opening brace should be on a new line
      Open

          public function get_refund_request($bill_id, $amount = null, $reason = '') {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $bill_id = filter_var($bill_id, FILTER_SANITIZE_NUMBER_INT);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $bill_id = filter_var($bill_id, FILTER_SANITIZE_NUMBER_INT);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $last_charge = $this->find_bill_last_charge($bill_id);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 4 spaces, found 2
      Open

        {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            return $this->vindi_settings->woocommerce->customer->get_billing_country();
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

        }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

        protected function is_single_order()
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $amount = filter_var($amount, FILTER_SANITIZE_NUMBER_FLOAT);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            $bill_id = $order_item['bill']['id'];
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Expected 1 space after IF keyword; 0 found
      Open

            if(isset($result->errors)) {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 16 spaces, found 8
      Open

              return false;
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

        }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            $discount_amount     = VindiHelpers::get_vindi_amount($item->get_subtotal() - $item->get_total(), $currency);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $shipping_address_zip = $order->get_shipping_postcode();
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          if ($this->is_valid_br_zip_code($shipping_address_zip)) {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $api_key = $this->vindi_settings->get_api_key();
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 8
      Open

              'redirect' => '',
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

        }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          if($amount < $order->get_total()) {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 12 spaces, found 6
      Open

            }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $bill = $this->routes->findBillById($bill_id);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Expected 1 space after IF keyword; 0 found
      Open

          if($amount < $order->get_total()) {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Multi-line function call not indented correctly; expected 14 spaces but found 12
      Open

                  /* translators: 1: Refund amount, 2: Refund ID */
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 28 spaces, found 10
      Open

                );
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          return true;
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $reason = sanitize_text_field($reason);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Closing brace indented incorrectly; expected 2 spaces, found 4
      Open

          }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          return $response;
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 4 spaces, found 2
      Open

        {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

        }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 6
      Open

            'shipping_amount'      => VindiHelpers::get_vindi_amount($order->get_shipping_total() + $order->get_shipping_tax(), $currency), // The shipping cost, in cents, as a non-negative integer.
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            $level3_data['shipping_address_zip'] = $shipping_address_zip;
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          } elseif ($this->vindi_settings->woocommerce->customer->get_billing_country()) {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            return false;
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            $response = array(
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            );
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $types = [];
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Opening brace should be on a new line
      Open

        public function process_refund($order_id, $amount = null, $reason = '') {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            $this->logger->log('Resultado do reembolso: ' . wc_print_r($result, true));
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Closing brace indented incorrectly; expected 4 spaces, found 2
      Open

        }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $data = $this->get_refund_request($bill_id, $amount, $reason);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

        }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Expected 1 space after IF keyword; 0 found
      Open

          if(!$bill) {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 8
      Open

              'quantity'            => $quantity, // The number of items of this type sold, as a non-negative integer.
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            );
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $level3_data = array(
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 6
      Open

            'merchant_reference'   => $order->get_id(), // An alphanumeric string of up to  characters in length. This unique value is assigned by the merchant to identify the order. Also known as an “Order ID”.
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 6
      Open

            'line_items'           => $vindi_line_items,
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          } catch (Exception $e) {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

        public function process_refund($order_id, $amount = null, $reason = '') {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $order = wc_get_order($order_id);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            return new WP_Error('error', __('Reembolso falhou.', VINDI));
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $amount = filter_var($amount, FILTER_SANITIZE_NUMBER_FLOAT);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $amount = filter_var($amount, FILTER_SANITIZE_NUMBER_FLOAT);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Closing brace indented incorrectly; expected 4 spaces, found 2
      Open

        }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $bill_id = filter_var($bill_id, FILTER_SANITIZE_NUMBER_INT);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

        protected $logger;
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 8
      Open

              'product_code'        => (string) $product_id, // Up to 12 characters that uniquely identify the product.
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          return !empty($zip) && preg_match('/^[0-9]{5,5}([- ]?[0-9]{3,3})?$/', $zip);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

        }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 4 spaces, found 2
      Open

        {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            return $order->billing_country;
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            $types[] = $item['data']->get_type();
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          if (!$this->can_refund_order($order)) {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          foreach ($order_meta as $key => $order_item) {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Multi-line function call not indented correctly; expected 14 spaces but found 12
      Open

                  sprintf(__('[Transação #%2$s]: reembolsado R$%1$s', VINDI), $result['amount'], $result['id'])
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            throw new Exception(sprintf(__('A fatura com bill_id #%s não foi encontrada!', VINDI), $bill_id), 2);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

        }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          return !(boolean) preg_grep('/subscription/', $types);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $results = [];
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          if(!$bill) {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

          foreach ($this->vindi_settings->woocommerce->cart->cart_contents as $item) {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $order_id = filter_var($order_id, FILTER_SANITIZE_NUMBER_INT);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 12 spaces, found 6
      Open

            return new WP_Error('error', __('Não é possível realizar reembolsos parciais, faça um reembolso manual caso você opte por esta opção.', VINDI));
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

        }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 12 spaces, found 6
      Open

            switch (strtolower($result['status'])) {
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected 12 spaces, found 6
      Open

            }
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $charges = $bill['charges'];
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      Line indented incorrectly; expected at least 8 spaces, found 4
      Open

          $refund = $this->routes->refundCharge($charge_id, $data);
      Severity: Minor
      Found in src/utils/PaymentGateway.php by phpcodesniffer

      There are no issues that match your filters.

      Category
      Status