简体   繁体   English

什么是良好而安全的Web支付架构

[英]What is a good and secure web payment architecture

I'm running a transactional web site where client pay for goods. 我正在运行一个交易网站,客户支付货款。 As of now, I'm using my payment processor (pp) company web page to handle the payment, ie the client is redirected to the PP server and redirected back to my site when the payment done. 截至目前,我正在使用我的支付处理器(pp)公司网页来处理付款,即客户被重定向到PP服务器并在付款完成后重定向回我的网站。 A big disadvantage is that I can't customize the PP page, or very little. 一个很大的缺点是我不能自定义PP页面,或者很少。

Now, I want to handle the payment directly on my web site. 现在,我想直接在我的网站上处理付款。 I just need to post all the payment data to my payment processor an it returns the response. 我只需要将所有付款数据发布到我的付款处理器并返回响应。 I already know that I need to be PCI compliant. 我已经知道我需要符合PCI标准。 My website is done using AJAX calling RESTeasy WebServices and a Java server. 我的网站是使用AJAX调用RESTeasy WebServices和Java服务器完成的。

Now my question is, should I validate every fields on the client side, using javascript, or swing everything on the server and do the job there? 现在我的问题是,我应该使用javascript验证客户端的每个字段,还是在服务器上摆放所有内容并在那里完成工作? Should I POST to the payment processor directly using a FORM on the client or using an HttpUrlConnection from the server? 我应该使用客户端上的FORM或使用服务器上的HttpUrlConnection直接向支付处理器发送信息吗? What is the benchmark on the market for doing this? 这样做的市场基准是什么? I found a lot of PHP example but unfortunatly a don't have time to learn PHP. 我发现了很多PHP的例子但不幸的是没有时间学习PHP。

Thanks 谢谢

As pointed out, you cannot validate only on the client because people can take your client code and modify it. 正如所指出的,您无法仅在客户端上进行验证,因为人们可以获取您的客户端代码并对其进行修改。 In addition, you'll need to provide account information, which you wouldn't want to be visible to users. 此外,您还需要提供您不希望用户看到的帐户信息。 Your server must validate and process the request. 您的服务器必须验证并处理该请求。

This is a fairly complex task. 这是一项相当复杂的任务。 You need to ensure the page is accessed through SSL (HTTPS), and you need to securely access your credit card processor. 您需要确保通过SSL(HTTPS)访问该页面,并且您需要安全地访问您的信用卡处理器。

You can perform some basic validation from your server-side code. 您可以从服务器端代码执行一些基本验证。 Check out http://www.blackbeltcoder.com/Articles/ecommerce/validating-credit-card-numbers . 查看http://www.blackbeltcoder.com/Articles/ecommerce/validating-credit-card-numbers

Beyond that, it's really up to your processor and the API they make available to you. 除此之外,它完全取决于您的处理器和它们为您提供的API。 You'll need to write code that conforms to their specification. 您需要编写符合其规范的代码。

Whether you want to POST data directly to the payment processor or collect the credit card information depends on your payment processor and if you want to store some of the information you collect on the credit card page ( don't store the credit card information; store only the last four digits if you need to.) 是否要将数据直接发送到支付处理器或收集信用卡信息取决于您的支付处理器,以及是否要将您收集的一些信息存储在信用卡页面上( 不要存储信用卡信息;存储如果需要,只有最后四位数字。)

Posting the form directly to the payment processor is the simplest way. 将表单直接发布到支付处理器是最简单的方法。 It probably also means that you don't even need to be PCI level 4 compliant, because none of the credit card information ever passes through your system. 它可能还意味着您甚至不需要符合PCI 4级标准,因为没有任何信用卡信息通过您的系统。 See here: 看这里:

http://www.pcicomplianceguide.org/pcifaqs.php#2 http://www.pcicomplianceguide.org/pcifaqs.php#2

On the other hand, if you want to store the billing address or the last four digits of the credit card number - or to insert this data into a receipt that you want to send by e-mail - you will need to write your own server-side code that collects the information from the credit card page and POSTs the data to the payment processor using an HttpUrlConnection. 另一方面,如果您想存储帐单地址或信用卡号码的最后四位数字 - 或者将此数据插入您希望通过电子邮件发送的收据中 - 您需要编写自己的服务器 - 代码,用于从信用卡页面收集信息,并使用HttpUrlConnection将数据发送到支付处理器。 If your payment processor offers an API, you could also use that. 如果您的支付处理器提供API,您也可以使用它。

In either case, you should make sure that your payment page can only be viewed over SSL. 在任何一种情况下,您都应确保只能通过SSL查看您的付款页面。 In a Java web application, you can use a transport-guarantee entry in web.xml to do this: 在Java Web应用程序中,您可以使用web.xml中的transport-guarantee条目来执行此操作:

  <security-constraint>
   <user-data-constraint>
     <transport-guarantee>CONFIDENTIAL</transport-guarantee>
   </user-data-constraint>
   <web-resource-collection>
     <url-pattern>your_payment_page.jsp</url-pattern>
   </web-resource-collection>
  </security-constraint>

This will make sure that even if a user accesses your payment page on plain HTTP, the application server will redirect to HTTPS. 这将确保即使用户在普通HTTP上访问您的付款页面,应用程序服务器也将重定向到HTTPS。

This page (from a payment processor I've dealt with) has some more information, from a processor point of view: 从处理器的角度来看,这个页面(来自我处理过的支付处理器)有更多信息:

http://wiki.usaepay.com/developer/transactionapi http://wiki.usaepay.com/developer/transactionapi

Thanks to all of you for your answers. 感谢大家的回答。 Finally, it's far more complicated, and it's a too big responsibility to take care of collecting the payment data myself just for the purpose of web page design. 最后,它要复杂得多,而且仅仅为了网页设计而自己负责收集付款数据是一项太大的责任。 I will still modify my payment page, informing the users that they will be redirected on the payment processor web page to complete the payment. 我仍然会修改我的付款页面,通知用户他们将被重定向到付款处理器网页上以完成付款。 Kind of an hybrid of what I have now. 我现在拥有的那种混合物。 This is safer for them and for me. 这对他们和对我来说都更安全。

Thanks again. 再次感谢。

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

相关问题 Facebook代理Web应用程序-它是好的架构/设计吗? - Facebook proxy web application - Is it good architecture/design? 哪种数据库体系结构适合该应用程序? - what database architecture is a good choiche for this application? 什么Web FrameWork对Java开发人员有用? - What Web FrameWork will be good for java developers? 什么是Web调用的良好压缩API - What is a good compression API for Web calls Web应用程序稳定性的良好标准指标是什么? - What is a good standard metric for stability in a web application? 保护javascript前端/ REST后端架构网站的最佳方法? - Best way to secure javascript front end/REST back end architecture web site? Java电子商务支付网关架构 - Java ecommerce payment gateway architecture 什么是Java的优秀Web搜索和Web爬网引擎? - What is a good Web search and web crawling engine for Java? 我在哪里可以找到针对Web开发人员的Java Swing GUI的优秀,简短,面向架构的介绍? - Where do I find a good, short, architecture-oriented introduction to Java Swing GUI for web developerrs? 可扩展,安全且易于使用的Web服务的特征是什么? - What are the characteristics of a Scalable, Secure and Easy to Use Web Services?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM