简体   繁体   English

从Java Web应用程序中用于磁条或芯片卡的刷卡机读取卡信息

[英]Read card information from a swipe machine for magnetic strip or chip card in java web application

I am trying to develop a Spring MVC based web application with following requirements. 我正在尝试开发具有以下要求的基于Spring MVC的Web应用程序。

  1. User will swipe his/her magnetic strip or chip card on a card swiping machine. 用户将在刷卡机上刷磁条或芯片卡。
  2. The machine will read card information on card and will transport the same to my web application. 机器将读取卡上的卡信息,并将其传输到我的Web应用程序。

My questions are. 我的问题是。

  1. Is it possible to transport information from swipe machine on internet (Obviously the machine is connected to internet) 是否可以从互联网上的刷卡机传输信息(显然该机器已连接到互联网)
  2. How do I configure the swipe machine to so it would transport information to my web application (should I expose a rest web service). 如何配置刷卡机,以便将信息传输到我的Web应用程序(我应该公开其他Web服务)。
  3. How do I decode the data which is transported by swipe machine in my Spring controller or web service 如何在Spring控制器或Web服务中解码刷卡机传输的数据

Thanks you very much for any help Anant 非常感谢您的帮助Anant

Is it possible to transport information from swipe machine on internet (Obviously the machine is connected to internet)

The machine has to have output somewhere, where it does send data when doing something. 该机器必须有产出的地方,做东西的时候它不发送数据。

How do I configure the swipe machine to so it would transport information to my web application (should I expose a rest web service).

In documentation for machine, there should be info about what does it send and how. 在机器的文档,应该会有什么才送,以及如何信息。 Everything else depends on this. 其他一切都取决于此。

How do I decode the data which is transported by swipe machine in my Spring controller or web service

Same answer as for previous question. 与上一个问题的答案相同。

Reading a mag strip (there are 3 of them in a card) is a simple job and you can rely on the driver that comes with the machine, or if you feel adventurous, break out the RxTx java library. 读取磁条(一张卡中有3条磁条)很简单,您可以依靠机器随附的驱动程序,或者如果喜欢冒险,可以突破RxTx Java库。

It is basically a bunch of letters and numbers - check wikipedia for the format of the CRC - but back to your questions: 它基本上是一堆字母和数字-检查Wikipedia中的CRC格式-但回到您的问题:

  1. Yes. 是。 Done that. 做到了。 Pretty simple. 很简单 The machine has configurations that allow it to dial up or open a secure connection with a server. 机器具有允许其拨号或打开与服务器的安全连接的配置。

  2. Which number it will dial up or which service it will call is all configurable. 它将拨打哪个号码或将呼叫哪个服务都是可配置的。 Merchant will require you to provide your own machine and won't let you touch their existing machines. 商家将要求您提供自己的计算机,并且不允许您触摸其现有计算机。

  3. Decoding is simple. 解码很简单。 The swiper comes with a driver and you can use it. 刷卡器附带驱动程序,您可以使用它。 However, if you have your own machine (which you will need) then decoding is not needed. 但是,如果您有自己的机器(将需要),则不需要解码。 The swiper will either call a server at the merchant (the case for restaurants or supermarkets) or it will open an HTTPS connection with the server and send all the data that it is in the card. 刷卡器将在商家处调用服务器(对于餐馆或超市而言),或者将与服务器建立HTTPS连接并发送卡中的所有数据。 Your server will get the data in plain text, so no need to read it manually. 您的服务器将以纯文本格式获取数据,因此无需手动读取。

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

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