php PHP中的信用卡支付网关?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1439904/
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
Credit card payment gateway in PHP?
提问by TheFlash
I need to process credit cards and integrate with backend payment services to credit them. The majority of solutions on the internet require an intermediary, eg. 2CO, GCO, Auth.net.
我需要处理信用卡并与后端支付服务集成以贷记它们。互联网上的大多数解决方案都需要中介,例如。2CO、GCO、Auth.net。
Do you have any experience with implementing a credit-card payment gateway in PHP? Any help in appreciated.
你有在 PHP 中实现信用卡支付网关的经验吗?任何帮助表示赞赏。
Thanks for your time.
谢谢你的时间。
采纳答案by anurag
Stripehas a PHP library to accept credit cards without needing a merchant account: https://github.com/stripe/stripe-php
Stripe有一个 PHP 库,无需商家帐户即可接受信用卡:https: //github.com/stripe/stripe-php
Check out the documentationand FAQ, and feel free to drop by our chatroomif you have more questions.
回答by Eric Petroelje
If you need something quick and dirty, you can just use PayPal's "Buy" buttons and drop them on your pages. These will take people off-site to PayPal where they can pay with a PayPal account or a credit card. This is free and super easy to implement.
如果您需要快速而肮脏的东西,您可以使用贝宝的“购买”按钮并将它们放在您的页面上。这些会将人们带到场外的 PayPal,在那里他们可以使用 PayPal 帐户或信用卡付款。这是免费的并且非常容易实现。
If you want something a bit nicer where people pay on-site with their credit card, then you would want to look into one of those 3rd part payment providers. None of them (that I'm aware of) are completely free. All will have a per-transaction fee, and most will have a monthly fee as well.
如果您想要一些更好的东西,人们可以使用他们的信用卡在现场付款,那么您需要研究那些第三部分支付提供商之一。他们中没有一个(我知道)是完全免费的。所有人都将收取每笔交易费用,并且大多数还将收取月费。
Personally I've worked with Authorize.NET and PayPal Website Payments Pro. Both have great APIs and sample code that you can hook into via PHP easily enough.
我个人曾与 Authorize.NET 和 PayPal Website Payments Pro 合作过。两者都有很棒的 API 和示例代码,您可以通过 PHP 轻松地连接到它们。
回答by Scott Lance
There are more than a few gateways out there, but I am not aware of a reliable gateway that is free. Most gateways like PayPal will provide you APIs that will allow you to process credit cards, as well as do things like void, charge, or refund.
那里有很多网关,但我不知道有一个可靠的免费网关。大多数网关(如 PayPal)都会为您提供 API,让您可以处理信用卡,以及执行无效、收费或退款等操作。
The other thing you need to worry about is the coming of PCI compliance which basically says if you are not compliant, you (or the company you work for) will be liable by your Merchant Bank and/or Card Vendor for not being compliant by July of 2010. This will impose large fines on you and possibly revoke the ability for you to process credit cards.
您需要担心的另一件事是 PCI 合规性的到来,它基本上是说如果您不合规,您(或您工作的公司)将因在 7 月之前不合规而由您的商业银行和/或卡供应商承担责任2010 年。这将对您处以巨额罚款,并可能取消您处理信用卡的能力。
All that being said companies like PayPal have a PHP SDK:
话虽如此,像 PayPal 这样的公司都有一个 PHP SDK:
https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/library_download_sdks
https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/library_download_sdks
Authorize.Net:
授权网:
http://developer.authorize.net/samplecode/
http://developer.authorize.net/samplecode/
Those are two of the more popular ones for the United States.
这是美国最受欢迎的两个。
For PCI Info see:
有关 PCI 信息,请参阅:
回答by dan-manges
Braintreealso has an open source PHP librarythat makes PHP integration pretty easy.
回答by TheCodeMonk
The best solution we found was to team up with one of those intermediaries. Otherwise you will have to deal with a bunch of other requirements like PCI compliance. We use Verifone's IPCharge and it works quite well.
我们找到的最佳解决方案是与其中一个中间人合作。否则,您将不得不处理一系列其他要求,例如 PCI 合规性。我们使用 Verifone 的 IPCharge,效果很好。

