如何将 Braintree 与 Rails 和 Activemerchant 结合使用
我有一个简单的 Rails 网站,现在需要添加支付网关。我看到 railscast 将 activemerchant 与 paypal 集成,但我想改用 Braintree。
我找不到任何教程来展示 Braintree 如何端到端集成到 Rails 应用程序中。我看到人们对 Braintree 有很多好话要说,但是教程怎么样?
有人在他们的 Rails 应用程序中使用过这个支付网关吗?它会类似于带有 paypal 的 Railscast...只需将 paypal 替换为 Braintree 吗?
I have a simple rails website to which I need to add a payments gateway now. I see a railscast on integrating activemerchant with paypal but I wanted to use braintree instead.
I am unable to find any tutorials that show how braintree can be integrated to a rails app end to end. I see that people have good things to say about braintree but how about a tutorial?
Has someone used this payment gateway for their rails application? Would it be similar to the railscasts with paypal...just replace paypal with braintree?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Active Merchant 是一个更加灵活的选择,因为它使您的公司可以自由地更改网关,而无需进行重大代码更改。最初的问题是如何将其与 Active Merchant 集成,而不是如何使用 BT 的专有 API。这是我在深入研究代码后找到的答案。您可以在“账户”->“账户”下找到您的公钥、私钥和商户ID。 “我的用户”-> “API 密钥”。
Active Merchant is a much more flexible choice since it gives your company the freedom to change gateways without significant code changes. The original question was how to integrate it with Active Merchant, not how to use BT's proprietary API. Here's the answer I found after some digging through the code. You can find your public key, private key and merchant id under "Account" -> "My User" -> "API Keys".
Braintree 的人根据他们的 API 创建了他们自己的 gem。设置和进行实际交易非常容易。您可以在 Github 上查看代码,并可以在 此处。集成 Rails 的完整项目位于此处。
The guys at Braintree created their own gem based on their API. It's very easy to setup and do actual transactions with. You can view the code on Github and a quick example can be found here. Full projects with Rails integration are located here.