设计允许在 Rails 应用程序中使用多种付款方式吗?
有谁有关于如何允许多种支付方式以便将来可以添加更多支付方式从而创建可扩展设计的经验?
我已经在我的应用程序中使用 Activemerchant 实现了 Paypal 快速结帐,但是我没有将其作为抽象设计,以便可以轻松添加未来的付款方式。
请指出任何可能具有此类设计的示例/现有项目或提供对此问题的任何见解。提前致谢!
PS 这涉及到类的设计和关系,而不是如何实现支付网关。
Does anyone have any experience with how to allow multiple payment methods so that more payment methods can be added in the future thus creating a scalable design?
I have implmented Paypal express checkout using Activemerchant in my application, however I didn't make it an abstracted design so that future payment methods could be added with ease.
Please point me to any example / existing project that may have such design or provide any insight to this problem. Thanks in advance!
P.S. This is regarding to the design and the relationships of the classes, rather than how to implement the payment gateway.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我推荐 ActiveMerchant:http://activemerchant.org
用于在轨道上构建集成的多重支付系统。
即使您想推出自己的项目,您也可以获得该项目的源代码并了解他们是如何做到的以获得一些想法。
I'd recommend ActiveMerchant: http://activemerchant.org
For building integrated, multi-payment systems in rails.
Even if you want to roll your own, you an get the source code for this project and see how they did it to get some ideas.