Code Duplication    Length = 23-23 lines in 2 locations

catalog/includes/modules/payment/sage_pay_form.php 1 location

@@ 67-89 (lines=23) @@
64
      }
65
    }
66
67
    function update_status() {
68
      global $order;
69
70
      $OSCOM_Db = Registry::get('Db');
71
72
      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_SAGE_PAY_FORM_ZONE > 0) ) {
73
        $check_flag = false;
74
        $Qcheck = $OSCOM_Db->get('zones_to_geo_zones', 'zone_id', ['geo_zone_id' => MODULE_PAYMENT_SAGE_PAY_FORM_ZONE, 'zone_country_id' => $order->billing['country']['id']], 'zone_id');
75
        while ($Qcheck->fetch()) {
76
          if ($Qcheck->valueInt('zone_id') < 1) {
77
            $check_flag = true;
78
            break;
79
          } elseif ($Qcheck->valueInt('zone_id') == $order->billing['zone_id']) {
80
            $check_flag = true;
81
            break;
82
          }
83
        }
84
85
        if ($check_flag == false) {
86
          $this->enabled = false;
87
        }
88
      }
89
    }
90
91
    function javascript_validation() {
92
      return false;

catalog/includes/modules/payment/sage_pay_server.php 1 location

@@ 68-90 (lines=23) @@
65
      }
66
    }
67
68
    function update_status() {
69
      global $order;
70
71
      $OSCOM_Db = Registry::get('Db');
72
73
      if ( ($this->enabled == true) && ((int)MODULE_PAYMENT_SAGE_PAY_SERVER_ZONE > 0) ) {
74
        $check_flag = false;
75
        $Qcheck = $OSCOM_Db->get('zones_to_geo_zones', 'zone_id', ['geo_zone_id' => MODULE_PAYMENT_SAGE_PAY_SERVER_ZONE, 'zone_country_id' => $order->billing['country']['id']], 'zone_id');
76
        while ($Qcheck->fetch()) {
77
          if ($Qcheck->valueInt('zone_id') < 1) {
78
            $check_flag = true;
79
            break;
80
          } elseif ($Qcheck->valueInt('zone_id') == $order->billing['zone_id']) {
81
            $check_flag = true;
82
            break;
83
          }
84
        }
85
86
        if ($check_flag == false) {
87
          $this->enabled = false;
88
        }
89
      }
90
    }
91
92
    function javascript_validation() {
93
      return false;