code: private boolean checkIeVatId(final String pvatId) {
      final char checkSum = pvatId.charAt(9);
      String vatId = pvatId;
      if (pvatId.charAt(3) >= 'A' && pvatId.charAt(3) <= 'Z') {
        // old id, can be transfered to new form
        vatId = pvatId.substring(0, 2) + "0" + pvatId.substring(4, 9) + pvatId.substring(2, 3)
            + pvatId.substring(9);
      }
      final int sum = (vatId.charAt(2) - '0') * 8 + (vatId.charAt(3) - '0') * 7
          + (vatId.charAt(4) - '0') * 6 + (vatId.charAt(5) - '0') * 5 + (vatId.charAt(6) - '0') * 4
          + (vatId.charAt(7) - '0') * 3 + (vatId.charAt(8) - '0') * 2;
      final int calculatedCheckSum = sum % 23;
      final char calculatedCheckSumCharIe;
      if (calculatedCheckSum == 0) {
        calculatedCheckSumCharIe = 'W';
      } else {
        calculatedCheckSumCharIe = (char) ('A' + calculatedCheckSum - 1);
      }
      return checkSum == calculatedCheckSumCharIe;
    }
docs: check the VAT identification number, country version for Ireland.
  
  @param pvatId vat id to check
  @return true if checksum is ok