简体   繁体   English

Java电子商务支付网关架构

[英]Java ecommerce payment gateway architecture

I am developer of internet payment gateway solution in Java, and sometimes I wonder if I could/should have done something better. 我是Java的互联网支付网关解决方案的开发人员,有时我想知道是否可以/应该做得更好。

Currently system works as follows: 当前系统的工作方式如下:

System is receiving requests in form of html POST request to, lets say, confirm.xhtml There is some filter mappings for confirm.xhtml. 系统正在以html POST请求的形式接收请求,例如,confirm.xhtml。confirm.xhtml有一些过滤器映射。 In doFilter method there are some validations of request. 在doFilter方法中,有一些对请求的验证。 ie. 即。 is merchant active, are required parameters present in POST parameters and so on. 是商人激活的,POST参数中是否存在必需的参数,依此类推。 If request is valid, html page is displayed. 如果请求有效,则显示html页面。 This is very simple html page which consists of one form with fields like card number, card exp. 这是一个非常简单的html页面,由一种形式组成,其中包含卡号,卡exp等字段。 date, customer name, surname, etc. When customer fills the form, message for authorizing host is created and sent via tcp socket connection (proprietary protocol). 日期,客户名称,姓氏等。当客户填写表格时,将创建用于授权主机的消息,并通过tcp套接字连接(专有协议)发送该消息。 While system waits response from authorizing host, loading page is displayed to customer. 当系统等待授权主机的响应时,将向客户显示加载页面。 When response from host is received, customer is redirected back to merchant site. 收到主机的响应后,客户将被重定向回商家站点。 This is html POST request with parameters like response message, approval code, and some other data relevant to specific implementation. 这是带有参数的HTML POST请求,例如响应消息,批准代码以及其他与特定实现相关的数据。

This is very general description of current system, but I would like to hear how would You do it (or already did it). 这是对当前系统的非常笼统的描述,但是我想听听您将如何做(或已经做过)。 Specifically, would you use some framework or would that be overkill because this is only one html page? 具体来说,您会使用某个框架还是会因为它只是一个html页面而显得过大? ORM or plain JDBC? ORM还是纯JDBC? What about session management, security, client side or server side validations ... ? 会话管理,安全性,客户端或服务器端验证...?

I am aware that this question is very general, but I want to hear how would you approach to designing of such a system from the ground up. 我知道这个问题非常笼统,但是我想听听您如何从头开始设计这种系统。

Frameworks are supposed to be a tool to help you. 框架应该是可以帮助您的工具。 Why reinvent the wheel? 为什么要重新发明轮子? I don't think it would be an overkill depending on how you use it, but it's really up to you as the developer whether you want to use it or not, depending on your project. 我不认为这取决于您的使用方式,不过,作为开发人员,是否要使用它取决于您的项目,这实际上取决于您。

What about session management, security, client side or server side validations ... ? I would use Enterprise JavaBeans to facilitate handling those. 我将使用Enterprise JavaBeans来简化处理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM