vindi/vindi-woocommerce

View on GitHub
src/routes/RoutesApi.php

Summary

Maintainability
C
1 day
Test Coverage

Showing 368 of 368 total issues

VindiRoutes has 34 functions (exceeds 20 allowed). Consider refactoring.
Open

class VindiRoutes
{
 
/**
* @var VindiSettings
Severity: Minor
Found in src/routes/RoutesApi.php - About 4 hrs to fix

    File RoutesApi.php has 346 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
     
    namespace VindiPaymentGateways;
     
    class VindiRoutes
    Severity: Minor
    Found in src/routes/RoutesApi.php - About 4 hrs to fix

      The class VindiRoutes has 25 public methods. Consider refactoring VindiRoutes to keep number of public methods under 10.
      Open

      class VindiRoutes
      {
       
      /**
      * @var VindiSettings
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpmd

      The class VindiRoutes has an overall complexity of 82 which is very high. The configured complexity threshold is 50.
      Open

      class VindiRoutes
      {
       
      /**
      * @var VindiSettings
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpmd

      Function getPaymentMethods has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

      public function getPaymentMethods()
      {
      if (false === ($payment_methods = get_transient('vindi_payment_methods'))) {
       
      $payment_methods = array(
      Severity: Minor
      Found in src/routes/RoutesApi.php - About 2 hrs to fix

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

      public function isSubscriptionActive($subscription_id)
      {
      $subscription_id = filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT);
      if (isset($this->recentRequest)
      && $this->recentRequest['id'] == $subscription_id) {
      Severity: Minor
      Found in src/routes/RoutesApi.php - About 35 mins to fix

      The method isMerchantStatusTrialOrSandbox has a boolean flag argument $is_config, which is a certain sign of a Single Responsibility Principle violation.
      Open

      public function isMerchantStatusTrialOrSandbox($is_config = false)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpmd

      The method getMerchant has a boolean flag argument $is_config, which is a certain sign of a Single Responsibility Principle violation.
      Open

      public function getMerchant($is_config = false)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpmd

      The method suspendSubscription has a boolean flag argument $cancel_bills, which is a certain sign of a Single Responsibility Principle violation.
      Open

      public function suspendSubscription($subscription_id, $cancel_bills = false)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpmd

      Avoid assigning values to variables in if clauses and the like (line '476', column '20').
      Open

      public function getMerchant($is_config = false)
      {
      if (false === ($merchant = get_transient('vindi_merchant')) || $is_config) {
      $response = $this->api->request('merchant', 'GET');
       
       
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpmd

      Avoid assigning values to variables in if clauses and the like (line '282', column '7').
      Open

      public function getSubscription($subscription_id)
      {
      if ($response = $this->api->request("subscriptions/". filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT),'GET')['subscription'])
      return $response;
       
       
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpmd

      Avoid assigning values to variables in if clauses and the like (line '231', column '10').
      Open

      public function createSubscription($data)
      {
      if (($response = $this->api->request('subscriptions', 'POST', $data)) &&
      isset($response['subscription']['id'])) {
       
       
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpmd

      Avoid assigning values to variables in if clauses and the like (line '269', column '9').
      Open

      public function activateSubscription($subscription_id)
      {
      if ($response = $this->api->request('subscriptions/' . filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT) . '/reactivate', 'POST'))
      return $response;
       
       
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpmd

      Avoid assigning values to variables in if clauses and the like (line '399', column '9').
      Open

      public function createBill($data)
      {
      if ($response = $this->api->request('bills', 'POST', $data)) {
      return $response['bill'];
      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpmd

      Avoid assigning values to variables in if clauses and the like (line '424', column '20').
      Open

      public function getPaymentMethods()
      {
      if (false === ($payment_methods = get_transient('vindi_payment_methods'))) {
       
      $payment_methods = array(
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpmd

      Avoid assigning values to variables in if clauses and the like (line '413', column '9').
      Open

      public function deleteBill($bill_id, $comments = '')
      {
      $query = '';
       
      if($comments)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpmd

      Avoid variables with short names like $id. Configured minimum length is 3.
      Open

      public function findCustomerById($id)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpmd

      The property $current_plan is not named in camelCase.
      Open

      class VindiRoutes
      {
       
      /**
      * @var VindiSettings
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpmd

      The property $vindi_settings is not named in camelCase.
      Open

      class VindiRoutes
      {
       
      /**
      * @var VindiSettings
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpmd

      Visibility must be declared on method "__construct"
      Open

      function __construct(VindiSettings $vindi_settings)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Blank line found at start of control structure
      Open

      isset($response['subscription']['id'])) {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Blank line found at start of control structure
      Open

      if (false === ($payment_methods = get_transient('vindi_payment_methods'))) {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Only one argument is allowed per line in a multi-line function call
      Open

      sprintf('subscriptions/%s%s', filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT), $query), 'DELETE');
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Only one argument is allowed per line in a multi-line function call
      Open

      sprintf('bills/%s%s', filter_var($bill_id, FILTER_SANITIZE_NUMBER_INT), $query), 'DELETE')
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      * @param int $subscription_id
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      *
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      */
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line exceeds 120 characters; contains 141 characters
      Open

      if ($response = $this->api->request('subscriptions/' . filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT) . '/reactivate', 'POST'))
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Inline control structures are not allowed
      Open

      if(!$cancel_bills)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Inline control structures are not allowed
      Open

      if ($response = $this->api->request('subscriptions/' . filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT) . '/reactivate', 'POST'))
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      public function getSubscription($subscription_id)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      * @return array|bool|mixed
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Inline control structures are not allowed
      Open

      if ($response = $this->api->request("subscriptions/". filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT),'GET')['subscription'])
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line exceeds 120 characters; contains 142 characters
      Open

      if ($response = $this->api->request("subscriptions/". filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT),'GET')['subscription'])
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Inline control structures are not allowed
      Open

      if ($this->recentRequest['status'] != 'canceled')
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Inline control structures are not allowed
      Open

      if (false == $response)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      * @param int $subscription_id
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      *
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      */
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $response;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line exceeds 120 characters; contains 122 characters
      Open

      } else if ('PaymentMethod::BankSlip' === $method['type'] || 'PaymentMethod::OnlineBankSlip' === $method['type']) {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Inline control structures are not allowed
      Open

      if (!$response || !$response['merchant'])
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return false;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Inline control structures are not allowed
      Open

      if(false !== $product)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      * @return array|bool|mixed
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Inline control structures are not allowed
      Open

      if($comments)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      if ($response = $this->api->request("subscriptions/". filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT),'GET')['subscription'])
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Inline control structures are not allowed
      Open

      if (empty($customer))
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Inline control structures are not allowed
      Open

      if (end($response['payment_profiles']) !== null)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Inline control structures are not allowed
      Open

      if (empty($response['charge']))
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Inline control structures are not allowed
      Open

      if (isset($response['bill']))
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line exceeds 120 characters; contains 133 characters
      Open

      $response = $this->api->request(sprintf('charges/%s/refund', filter_var($charge_id, FILTER_SANITIZE_NUMBER_INT)), 'POST', $data);
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      filter_var($product_id, FILTER_SANITIZE_NUMBER_INT)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $response['plan'];
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $response['plan'];
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Multi-line function call not indented correctly; expected 8 spaces but found 6
      Open

      'products/%s',
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      filter_var($product_id, FILTER_SANITIZE_NUMBER_INT)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $response = $this->api->request('customers', 'POST', $data);
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $response = $this->api->request(sprintf(
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Multi-line function call not indented correctly; expected 8 spaces but found 6
      Open

      filter_var($user_id, FILTER_SANITIZE_NUMBER_INT)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $response = $this->api->request(sprintf(
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function findCustomerById($id)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      'customers/%s',
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $userExists;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      if(!$cancel_bills)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $response = $this->api->request(
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Multi-line function call not indented correctly; expected 4 spaces but found 6
      Open

      sprintf('subscriptions/%s%s', filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT), $query), 'DELETE');
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public $api;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      'plans/%s',
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function createCustomer($data)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      'customers/%s',
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      ), 'GET');
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

      if (($response = $this->api->request('subscriptions', 'POST', $data)) &&
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $query = '?cancel_bills=false';
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Multi-line function call not indented correctly; expected 8 spaces but found 6
      Open

      filter_var($product_id, FILTER_SANITIZE_NUMBER_INT)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      filter_var($plan_id, FILTER_SANITIZE_NUMBER_INT)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      ), 'PUT', $data);
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      'products/%s',
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Multi-line function call not indented correctly; expected 8 spaces but found 6
      Open

      'customers/%s',
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $productExists = isset($response['product']['id']) ? $response['product'] : false;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Expected 1 space after IF keyword; 0 found
      Open

      if(!$cancel_bills)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $productExists;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return false;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $response['charge'];
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      filter_var($user_id, FILTER_SANITIZE_NUMBER_INT)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      filter_var($id, FILTER_SANITIZE_NUMBER_INT)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $subscription['bill'] = $response['bill'];
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function activateSubscription($subscription_id)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function updatePlan($plan_id, $data)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Multi-line function call not indented correctly; expected 8 spaces but found 6
      Open

      filter_var($plan_id, FILTER_SANITIZE_NUMBER_INT)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $response = $this->api->request('products', 'POST', $data);
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function updateCustomer($user_id, $data)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function createSubscription($data)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $response;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      filter_var($user_id, FILTER_SANITIZE_NUMBER_INT)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $subscription;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function suspendSubscription($subscription_id, $cancel_bills = false)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

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

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

      $response = $this->api->request(
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Multi-line function call not indented correctly; expected 8 spaces but found 6
      Open

      filter_var($id, FILTER_SANITIZE_NUMBER_INT)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return false;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $query = '';
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Closing parenthesis of a multi-line function call must be on a line by itself
      Open

      sprintf('subscriptions/%s%s', filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT), $query), 'DELETE');
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      private $vindi_settings;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $response = $this->api->request('plans', 'POST', $data);
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $response['product'];
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $response['customer'];
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $response = $this->api->request(sprintf(
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $subscription = $response['subscription'];
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $response = $this->api->request(sprintf(
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      ), 'PUT', $data);
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      ), 'PUT', $data);
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Multi-line function call not indented correctly; expected 8 spaces but found 6
      Open

      'plans/%s',
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Multi-line function call not indented correctly; expected 8 spaces but found 6
      Open

      filter_var($user_id, FILTER_SANITIZE_NUMBER_INT)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      filter_var($user_id, FILTER_SANITIZE_NUMBER_INT)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Multi-line function call not indented correctly; expected 8 spaces but found 6
      Open

      filter_var($product_id, FILTER_SANITIZE_NUMBER_INT)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

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

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $response = $this->api->request(sprintf(
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Multi-line function call not indented correctly; expected 8 spaces but found 6
      Open

      'customers/%s',
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $response['customer'];
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      'customers/%s',
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $response['customer'];
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $response = $this->api->request(sprintf(
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      isset($response['subscription']['id'])) {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      );
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function createProduct($data)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function updateProduct($product_id, $data)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      'products/%s',
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function deleteCustomer($user_id)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      ), 'DELETE');
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $response;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      if ($response = $this->api->request('subscriptions/' . filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT) . '/reactivate', 'POST'))
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      function __construct(VindiSettings $vindi_settings)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function findProductById($product_id)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function createPlan($data)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Multi-line function call not indented correctly; expected 8 spaces but found 6
      Open

      'customers/%s',
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      sprintf('subscriptions/%s%s', filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT), $query), 'DELETE');
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      if ($this->recentRequest['status'] != 'canceled')
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return false;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $log['card_number'] = sprintf('**** *%s', substr($log['card_number'], -3));
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $response = $this->api->request('payment_profiles', 'POST', $data, $log);
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      ),
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      No space found after comma in function call
      Open

      if ($response = $this->api->request("subscriptions/". filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT),'GET')['subscription'])
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $this->recentRequest = $response;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      'price' => 0,
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return false;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function deleteBill($bill_id, $comments = '')
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $query = '';
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $response;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Usage of ELSE IF is discouraged; use ELSEIF instead
      Open

      } else if ('PaymentMethod::BankSlip' === $method['type'] || 'PaymentMethod::OnlineBankSlip' === $method['type']) {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function isSubscriptionActive($subscription_id)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function verifyCustomerPaymentProfile($payment_profile_id)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $transient_key = "vindi_product_{$code}";
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      'pricing_schema' => array(
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Expected 1 space after IF keyword; 0 found
      Open

      if($comments)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $query = '?comments= ' . $comments;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      ) {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Multi-line function call not indented correctly; expected 8 spaces but found 6
      Open

      'products/%s',
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      ), 'GET');
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $response['product'];
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $userExists = isset($response['customer']['id']) ? $response['customer'] : false;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      filter_var($payment_profile_id, FILTER_SANITIZE_NUMBER_INT)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      set_transient($transient_key, $product, 1 * HOUR_IN_SECONDS);
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $this->createProduct(array(
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function getPaymentMethods()
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      if (false == $response)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      'payment_profiles/%s/verify',
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function findProductByCode($code)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      'code' => $code,
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function createBill($data)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

      if ($response = $this->api->request('bills', 'POST', $data)) {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Closing parenthesis of a multi-line function call must be on a line by itself
      Open

      sprintf('bills/%s%s', filter_var($bill_id, FILTER_SANITIZE_NUMBER_INT), $query), 'DELETE')
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      continue;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 20 spaces, found 8
      Open

      if ('PaymentMethod::CreditCard' === $method['type']) {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $method['payment_companies']
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function getMerchant($is_config = false)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $subscription_id = filter_var($subscription_id, FILTER_SANITIZE_NUMBER_INT);
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $response['payment_profile'];
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $product = $this->findProductByCode($code);
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      );
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 16 spaces, found 6
      Open

      foreach ($response['payment_methods'] as $method) {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 20 spaces, found 8
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $payment_methods['credit_card'] = array_merge(
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      set_transient('vindi_payment_methods', $payment_methods, 1 * HOUR_IN_SECONDS);
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $this->api->accept_bank_slip = $payment_methods['bank_slip'];
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $merchant = $is_config ? $this->getMerchant($is_config) : $this->getMerchant();
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return true;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      ), 'POST')['transaction']['status'];
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $log = $data;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $code = sanitize_text_field($code);
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Expected 1 space after IF keyword; 0 found
      Open

      if(false !== $product)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      ));
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $response = $this->api->request(sprintf('products?query=code:%s', $code), 'GET');
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return false;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 20 spaces, found 8
      Open

      if ('active' !== $method['status']) {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $payment_methods['credit_card'],
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      && $this->recentRequest['id'] == $subscription_id) {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $response = $this->getSubscription($subscription_id);
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return false;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Multi-line function call not indented correctly; expected 8 spaces but found 6
      Open

      'payment_profiles/%s/verify',
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $log['card_cvv'] = '***';
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $product;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function findOrCreateProduct($name, $code)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $response = $this->api->request('payment_methods', 'GET');
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 20 spaces, found 8
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 12 spaces, found 6
      Open

      if ($response['status'] != 'canceled') {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return 'success' === $this->api->request(sprintf(
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

      if (false === $product)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

      if (isset($this->recentRequest)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      if(false !== $product)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $name = sanitize_text_field($name);
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $payment_methods['credit_card'],
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $method['payment_companies']
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 16 spaces, found 6
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $payment_methods;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function isMerchantStatusTrialOrSandbox($is_config = false)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      if (!$response || !$response['merchant'])
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $merchant;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $this->current_plan;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      if (empty($customer))
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return false;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

      if (false === empty($response['products'])) {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Expected 1 space after closing parenthesis; found 5
      Open

      if (false === $product)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Multi-line function call not indented correctly; expected 4 spaces but found 6
      Open

      sprintf('bills/%s%s', filter_var($bill_id, FILTER_SANITIZE_NUMBER_INT), $query), 'DELETE')
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $this->current_plan = $response['plan'];
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Multi-line function call not indented correctly; expected 8 spaces but found 6
      Open

      'bills/%s',
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $this->current_plan = false;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      filter_var($bill_id, FILTER_SANITIZE_NUMBER_INT)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      ), 'GET');
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

      if (isset($response['charge'])) {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function createCustomerPaymentProfile($data)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $product = end($response['products']);
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

      if ($response = $this->api->request(
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return false;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      if (empty($response['charge']))
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

      if (empty($response['plan'])) {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return false;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $user_vindi_id = filter_var($user_vindi_id, FILTER_SANITIZE_NUMBER_INT);
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return true;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $code = sanitize_text_field($code);
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $payment_methods['bank_slip'] = true;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return true;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

      if (false === ($merchant = get_transient('vindi_merchant')) || $is_config) {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $response = $this->api->request(sprintf('charges/%s/refund', filter_var($charge_id, FILTER_SANITIZE_NUMBER_INT)), 'POST', $data);
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $response['charge'];
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

      if ($response && array_key_exists('status', $response)) {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 12 spaces, found 6
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $product = get_transient($transient_key);
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      'status' => 'active',
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $product;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $response['bill'];
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      if($comments)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return false;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      'bank_slip' => false,
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      );
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $merchant = $response['merchant'];
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function getPaymentProfile($user_vindi_id)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

      if (null === $this->api->accept_bank_slip) {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Multi-line function call not indented correctly; expected 8 spaces but found 6
      Open

      filter_var($payment_profile_id, FILTER_SANITIZE_NUMBER_INT)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $product;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      'name' => $name,
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      sprintf('bills/%s%s', filter_var($bill_id, FILTER_SANITIZE_NUMBER_INT), $query), 'DELETE')
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

      if (false === ($payment_methods = get_transient('vindi_payment_methods'))) {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $payment_methods = array(
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      'credit_card' => array(),
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 20 spaces, found 8
      Open

      } else if ('PaymentMethod::BankSlip' === $method['type'] || 'PaymentMethod::OnlineBankSlip' === $method['type']) {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function getCharge($charge_id)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return false;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function getPlan($plan_id)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return false;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Multi-line function call not indented correctly; expected 8 spaces but found 6
      Open

      filter_var($bill_id, FILTER_SANITIZE_NUMBER_INT)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $response['bill'];
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return false;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $response = $this->api->request("charges/" . filter_var($charge_id, FILTER_SANITIZE_NUMBER_INT), 'GET');
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $response = $this->api->request("plans/" . filter_var($plan_id, FILTER_SANITIZE_NUMBER_INT), 'GET');
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $customer = $this->findCustomerById($user_vindi_id);
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $response = $this->api->request('payment_profiles?query='.$query, 'GET');
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $this->getPaymentMethods();
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 8 spaces, found 4
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $response = $this->api->request(sprintf(
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      if (isset($response['bill']))
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      set_transient('vindi_merchant', $merchant, 1 * HOUR_IN_SECONDS);
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $query = urlencode("customer_id={$customer['id']} status=active type=PaymentProfile::CreditCard");
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function findBillById($bill_id)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function refundCharge($charge_id, $data)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      A closing tag is not permitted at the end of a PHP file
      Open

      ?>
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      if (end($response['payment_profiles']) !== null)
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $response['charge'];
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return end($response['payment_profiles']);
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      public function acceptBankSlip()
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      Line indented incorrectly; expected 4 spaces, found 2
      Open

      }
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      $response = $this->api->request('merchant', 'GET');
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return false;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return false;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      return $this->api->accept_bank_slip;
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      'bills/%s',
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

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

      {
      Severity: Minor
      Found in src/routes/RoutesApi.php by phpcodesniffer

      There are no issues that match your filters.

      Category
      Status