需要实现一个基于java技术的支付网关集成页面。
到目前为止,我有一个index.html,它获取客户信息的详细信息,并且被重定向到EBS支付网关(如下面的代码片段所示)。
下面是index.html页面的片段
</head>
<body onload="a2()" style="background-color:lightgray; margin-left:300px; margin-right:300px; margin-top:0px;">
<center>
<div style="background-color:white;">
<form action="pay.jsp" method="post" name="frm" id="theForm" onsubmit="return validateForm()" autocomplete = "off" />
<input type="hidden" name="V3URL" value="https://secure.ebs.in/pg/ma/payment/request" />
<div>
<h1>EBS - JSP Version 3</h1>/作为付款网关的响应,代码(response.js)如下:
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ page import="java.io.*,java.util.*" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>EBS Response</title>
</head>
<body>
<center>
<h2>EBS Response</h2>
<table width="50%" border="1" align="center">
<tr bgcolor="#949494">
<th>Response Parameter Name</th><th>Response Value</th>
</tr>
<%
Enumeration paramNames = request.getParameterNames();
while(paramNames.hasMoreElements()) {
String paramName = (String)paramNames.nextElement();
out.print("<tr><td>" + paramName + "</td>\n");
String paramValue = request.getParameter(paramName);
out.println("<td> " + paramValue + "</td></tr>\n");
}
%>
</table>
</center>
</body>
</html>有用于验证输入字段的表单验证代码。
安全性是在pay.jsp中使用java的MessageDigest实现的。(请注意,在index.html代码段的第5行中使用了pay.jsp )。
现在我要继续前进了。我需要的是:
2.如何集成所有组件,以获得完善的支付网关
发布于 2015-11-20 10:27:10
首先,您需要一个来自response.js的POST数据。
1.a. --如果您有POST数据,就不会出现类似的问题(必须是JSON):
{
"result" : {
"ResponseMessage" : "success",
"TransaactionID": "5555",
"RequestID" : "8729394"
.
.
.
}
}1.b. --如果没有post数据,就必须获取所有参数并保存到JSON或模式中。
2.您必须为此创建一个模型:
public class Result
{
private string ResponseMessage { get; set; }
private string TransaactionID { get; set; }
private string RequestID { get; set; }
.
.
.
}
public class RootObject
{
private Result result { get; set; }
}您可以将这些数据发送到saveOrUpdate(obj);
https://stackoverflow.com/questions/33823978
复制相似问题