def encrypt_batch_file_request(cipher_filename, plain_filename, options)
      pgpkeyID = get_config(:vantivPublicKeyID, options)
      if pgpkeyID == ""
        raise RuntimeError, "The public key to encrypt batch file requests is missing from the config"
      end

      IOStreams::Pgp::Writer.open(
          cipher_filename,
          recipient: pgpkeyID
      ) do |output|
        File.open(plain_filename, "r").readlines.each do |line|
          output.puts(line)
        end
      end

    rescue IOStreams::Pgp::Failure => e
      raise ArgumentError, "Please check if you have entered correct vantivePublicKeyID to config and that " +
          "vantiv's public key is added to your gpg keyring and is trusted. #{e.message}"
    end
def encrypt_batch_file_request(cipher_filename, plain_filename, options)
      pgpkeyID = get_config(:vantivPublicKeyID, options)
      if pgpkeyID == ""
        raise RuntimeError, "The public key to encrypt batch file requests is missing from the config"
      end

      IOStreams::Pgp::Writer.open(
          cipher_filename,
          recipient: pgpkeyID
      ) do |output|
        File.open(plain_filename, "r").readlines.each do |line|
          output.puts(line)
        end
      end

    rescue IOStreams::Pgp::Failure => e
      raise ArgumentError, "Please check if you have entered correct vantivePublicKeyID to config and that " +
          "vantiv's public key is added to your gpg keyring and is trusted. #{e.message}"
    end
Encrypt the request file for a PGP enabled account
 +cipher_filename+:: Name of File that would contain encrypted batch
 +plain_filename+:: Name of File containing batch in XML markup
 +options+:: An (option) +Hash+ containing the public key to attempt to encrypt the file.
 If not provided, the values will be populated from the configuration file.