Java 如何为在线交易创建支付网关?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3090907/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to create payment gateway for an online transaction?
提问by Lokesh
In my web application there is an online transaction system for online reservation. I have no idea about how to implement this, i.e when an end user wants to do reservation, a form has to open showing different banks, by selecting bank, user will be allowed to enter his/her card credentials and I have to send this to third party payment gateway vendor and has to receive information from that party regarding the transaction status.
在我的 Web 应用程序中,有一个用于在线预订的在线交易系统。我不知道如何实现这一点,即当最终用户想要进行预订时,必须打开一个显示不同银行的表格,通过选择银行,用户将被允许输入他/她的卡凭据,我必须发送这个到第三方支付网关供应商,并且必须从该方接收有关交易状态的信息。
How can we send and receive data from third party or is their is any way that we could eliminate the third party from transaction ?
我们如何从第三方发送和接收数据,或者他们有什么方法可以从交易中消除第三方?
Please help ! Thanks in advance.
请帮忙 !提前致谢。
回答by Kevin Sylvestre
The best solution is to select a payment gateway that supports your programming language / framework. The selection of your gateway will also depend greatly on your location and currency support requirements (as well as service fees). Typically data will be sent to the gateways in XML or JSON over SSL connections. Some sample gateways include BrainTree, PayPalor BeanStream. If you live in the United States I would recommend BrainTreebecause they offer a Java API (found here). Otherwise, just read through the documentation and the rest should be easy.
最好的解决方案是选择支持您的编程语言/框架的支付网关。网关的选择还很大程度上取决于您的位置和货币支持要求(以及服务费)。通常,数据将通过 SSL 连接以 XML 或 JSON 格式发送到网关。一些示例网关包括BrainTree、PayPal或BeanStream。如果您住在美国,我会推荐BrainTree,因为它们提供了 Java API(在此处找到)。否则,只需通读文档,其余的应该很容易。
回答by Amit Goyal
Developing your own payment gateway is slightly complicated and comes with lots of compliance issues. So, assume for the time being this is not an option. Now, there are various payment gateways available in market you can choose the one which fits your requirements. The parameter of appropriate selection could be transaction currency, country, transaction fee, withdraw charges, fraud detection and mitigation system, charge back transaction charges, ease of integration etc. About integrating a gateway, there are two types of integration possible
开发您自己的支付网关有点复杂,并伴随着许多合规性问题。因此,暂时假设这不是一种选择。现在,市场上有各种支付网关,您可以选择适合您要求的一种。The parameter of appropriate selection could be transaction currency, country, transaction fee, withdraw charges, fraud detection and mitigation system, charge back transaction charges, ease of integration etc. About integrating a gateway, there are two types of integration possible
- Form based
- API based
- 基于表单
- 基于 API
The need you mentioned fall under the category of API based gateway.
您提到的需求属于基于 API 的网关类别。
Form based gatewayis the one which, in which user is redirected to the gateway provider site and there user enters credit card and other details, once payment confirmed gateway provider notifies back through various means like HTTP call back etc.
基于表单的网关是一种将用户重定向到网关提供商站点并在那里用户输入信用卡和其他详细信息,一旦付款确认网关提供商通过各种方式(如 HTTP 回调等)通知的网关。
API basedis the one in which you display your own form at your website. Gateway provider provides an integration API kit to make a call to the gateway. Capture all the details like cc details etc at your end and pass all the details to the gateway provider by calling the API integrated.
基于 API是您在网站上显示自己的表单的一种。网关提供程序提供了一个集成 API 工具包来调用网关。在您的一端捕获所有详细信息,例如 cc 详细信息等,并通过调用集成的 API 将所有详细信息传递给网关提供商。
As far as efforts are concern, form based gateways are easier to integrate. I would suggest you to go ahead with form based gateways. This way you dont need to put much effort of programming.
就努力而言,基于表单的网关更容易集成。我建议您继续使用基于表单的网关。这样你就不需要花太多精力在编程上。
If you are using Ruby, probably check http://www.activemerchant.org/
如果您使用 Ruby,请查看http://www.activemerchant.org/
List of pre-integrated gateways available in active merchant: http://activemerchant.rubyforge.org/
活跃商家中可用的预集成网关列表:http: //activemerchant.rubyforge.org/
Hope this would help!!!
希望这会有所帮助!!!