예제 #1
1
  private void SendText() {
    toNumber = toNumber.replace("-", "");
    toNumber = toNumber.replace("(", "");
    toNumber = toNumber.replace(")", "");
    toNumber = toNumber.replace(" ", "");
    if (!isNumeric(toNumber) || toNumber.length() < 7) {
      setTextStatus(STATUS_NOT_VALID_PHONE_NUMBER);
    }

    try {
      if (textStatus == STATUS_NOT_SENT) {
        Voice voice = new Voice(username, password);

        voice.sendSMS(
            toNumber,
            kioskSettings
                    .getLocaleSettings()
                    .getLocaleString("SaveScreen", "TextMessageToSend", "Prompt")
                + " "
                + getTinyUrl(pageUrl));
        setTextStatus(STATUS_SENT);
      }
    } catch (IOException e) {
      e.printStackTrace();
      new ErrorLog(true, true, "Was unable to send text message.", 0x16);
      setTextStatus(STATUS_IO_EXCEPTION);
      kioskSettings
          .getKioskStatusModule()
          .setKioskStatus("I/O Exception when trying to text customer.", true);
    }
  }
예제 #2
0
  public CardReader(Settings KioskSettings) {
    kioskSettings = KioskSettings;
    cardReaderPath = kioskSettings.getCardReader().getAbsolutePath();
    cardReader = kioskSettings.getCardReader();

    initializeCardReader();
  }
예제 #3
0
 public FileInputStream getInputStream() {
   try {
     return new FileInputStream(cardReaderPath);
   } catch (FileNotFoundException e) {
     kioskSettings
         .getKioskStatusModule()
         .setKioskStatus("Could not initialize card reader: ", true);
     new ErrorLog(
         false,
         true,
         kioskSettings
             .getLocaleSettings()
             .getLocaleString("SwipeBuckId", "CouldNotInitialize", "Prompt"),
         kioskSettings
             .getLocaleSettings()
             .getLocaleString("SwipeBuckId", "CouldNotInitialize", "Title"),
         0x4);
     e.printStackTrace();
   }
   return null;
 }
예제 #4
0
 public boolean initializeCardReader() {
   kioskSettings.getKioskStatusModule().setKioskStatus("Initializing card reader.");
   if (cardReader.exists()) {
     if (cardReader.canRead()) {
       setStatus(STATUS_INITIALIZED);
       kioskSettings.getKioskStatusModule().setKioskStatus("Card reader initialized.");
       return true;
     } else {
       kioskSettings
           .getKioskStatusModule()
           .setKioskStatus("Could not initialize card reader: Can't read.", true);
       setStatus(STATUS_ERROR_CANT_READ);
       new ErrorLog(
           false,
           true,
           kioskSettings
               .getLocaleSettings()
               .getLocaleString("SwipeBuckId", "CouldNotInitialize", "Prompt"),
           kioskSettings
               .getLocaleSettings()
               .getLocaleString("SwipeBuckId", "CouldNotInitialize", "Title"),
           0x2);
       return false;
     }
   } else {
     kioskSettings
         .getKioskStatusModule()
         .setKioskStatus("Could not initialize card reader: Does not exist.", true);
     setStatus(STATUS_ERROR_DOES_NOT_EXIST);
     new ErrorLog(
         false,
         true,
         kioskSettings
             .getLocaleSettings()
             .getLocaleString("SwipeBuckId", "CouldNotInitialize", "Prompt"),
         kioskSettings
             .getLocaleSettings()
             .getLocaleString("SwipeBuckId", "CouldNotInitialize", "Title"),
         0x3);
     return false;
   }
 }