AesCryptUtil не может быть преобразован в тип в платежном шлюзе ccAvenue - PullRequest
0 голосов
/ 18 июня 2020

Я интегрирую платежный шлюз ccAvenue весной. * Проект 1008 *, в который я добавляю следующие 3 файла: 1. dataForm. html 2. ccavRequestHandler. jsp 3. ccavResponseHandler. jsp

У меня есть кнопка оплаты в моем проекте, когда я нажимаю кнопку оплаты, затем перенаправляется на страницу dataForm. html после заполнения всех деталей я нажимаю кнопку проверки, затем она перенаправляется на страницу ccavRequestHandler. jsp, на которой я получил следующую ошибку

HTTP Status 500 - Unable to compile class for JSP:
type Exception report

message Unable to compile class for JSP:

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: 25 in the jsp file: /ccavRequestHandler.jsp
AesCryptUtil cannot be resolved to a type
22:           pvalue = request.getParameter(pname);
23:           ccaRequest = ccaRequest + pname + "=" + URLEncoder.encode(pvalue,"UTF-8") + "&";
24:      }
25:      AesCryptUtil aesUtil=new AesCryptUtil(workingKey);
26:      String encRequest = aesUtil.encrypt(ccaRequest);
27:     %>
28:     


An error occurred at line: 25 in the jsp file: /ccavRequestHandler.jsp
AesCryptUtil cannot be resolved to a type
22:           pvalue = request.getParameter(pname);
23:           ccaRequest = ccaRequest + pname + "=" + URLEncoder.encode(pvalue,"UTF-8") + "&";
24:      }
25:      AesCryptUtil aesUtil=new AesCryptUtil(workingKey);
26:      String encRequest = aesUtil.encrypt(ccaRequest);
27:     %>
28:     


Stacktrace:
    org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103)
    org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:366)
    org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:476)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:378)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)
    org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)
    org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:657)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.54 logs.

Мой ccavRequestHandler. jsp файл:

<%@page import="java.net.URLEncoder"%>
<%
/*
   This is the sample Checkout Page JSP script. It can be directly used for integration with CCAvenue if your application is developed in JSP. You need to simply change the variables to match your variables as well as insert routines (if any) for handling a successful or unsuccessful transaction.
*/
%>
<%@ page import = "java.io.*,java.util.*,com.ccavenue.security.*" %>
<html>
<head>
    <title>Sub-merchant checkout page</title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
    <%
     String accessCode= "";     //Put in the Access Code in quotes provided by CCAVENUES.
     String workingKey = "";    //Put in the 32 Bit Working Key provided by CCAVENUES.  
     Enumeration enumeration=request.getParameterNames();
     String ccaRequest="", pname="", pvalue="";
     while(enumeration.hasMoreElements()) {
          pname = ""+enumeration.nextElement();
          pvalue = request.getParameter(pname);
          ccaRequest = ccaRequest + pname + "=" + URLEncoder.encode(pvalue,"UTF-8") + "&";
     }
     AesCryptUtil aesUtil=new AesCryptUtil(workingKey);
     String encRequest = aesUtil.encrypt(ccaRequest);
    %>

    <form id="nonseamless" method="post" name="redirect" action="https://secure.ccavenue.com/transaction.do?command=initiateTransaction"/> 
        <input type="hidden" id="encRequest" name="encRequest" value="<%= encRequest %>">
        <input type="hidden" name="access_code" id="access_code" value="<%= accessCode %>">
        <script language='javascript'>document.redirect.submit();</script>
    </form>

 </body> 
</html>
...