在不使用 ActiveRecord 作为其 ORM 的项目中很难使用 ActiveMerchant 吗?

发布于 2024-08-05 15:47:57 字数 338 浏览 3 评论 0原文

ActiveMerchant 似乎是在考虑 AR 的情况下开发的。

我得出这个结论的基础是purchase()方法返回 ActiveRecord::Billing::Response 对象

这是正确的吗?如果是,这是否意味着在使用不同 Ruby 的项目中使用 ActiveMerchant 可能会很困难ORM(续集/数据映射器)?

ActiveMerchant seems to be baked with AR in mind.

I've come to this conclusion based on the fact that the purchase() method returns an ActiveRecord::Billing::Response object:

Is this correct and, if so, does this mean it might be difficult to use ActiveMerchant in a project that uses a different Ruby ORM (Sequel/Datamapper)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

寒尘 2024-08-12 15:47:57

如果您检查 ActiveMerchant::Billing::Response 的实现,则文件中的任何位置都没有提及 ActiveRecord。不确定您从哪里得到 AM 返回 AR 对象的想法。

查看 Braintree 网关的 #purchase 实现,它调用 #commit,这只是 返回 ActiveMerchant::Billing::Response 对象

If you check the implementation of ActiveMerchant::Billing::Response, there is no mention of ActiveRecord anywhere in the file. Not sure where you got the idea that AM returns AR objects.

Looking at the implementation of #purchase for the Braintree gateway, it calls #commit, which simply returns an ActiveMerchant::Billing::Response object

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文