图书馆将钱存入用户帐户?

发布于 2024-11-04 14:13:16 字数 132 浏览 4 评论 0原文

我正在构建一个应用程序,需要从通过信用卡付款的客户处收取资金,并将这笔钱存入另一个客户的银行帐户。我不想存储银行帐户信息,我只想说“将 X 美元存入用户 Y 的银行帐户”,其中 Y 呼叫第三方。该应用程序位于 Rails 中。有什么干净的解决方案吗?

I am building an app that needs to take money from a customer who is paying by credit card and deposit that money into another customer's bank account. I don't want to store the bank account info, I just want to say "deposit X dollars into user Y's bank account" where Y calls a 3rd party. The app is in rails. Any clean solutions out there?

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

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

发布评论

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

评论(2

我们的影子 2024-11-11 14:13:16

如果您想直接将资金存入 Y 的账户,您必须拥有 Y 的银行路由号码和银行帐号。

首先,您需要在 Rails 应用程序中设置 Active Merchant。使用插件或 gem:

rails plugin install git://github.com/Shopify/active_merchant.git

gem 'activemerchant'

将其安装在应用程序上后,您将需要使用网关进行注册。以下是受支持网关的完整列表 https://github.com/Shopify/active_merchant/wiki/gatewayfeaturematrix< /a>

这些 Railscast 将帮助您开始使用 Active Merchant:

http://railscasts。 com/episodes/144-active-merchant-basics

http://railscasts. com/episodes/145-integrating-active-merchant

要使用银行而不是信用卡,如果您遵循railscast,请在订单模型中创建一个新方法

 def bank_account
  @bank_account ||= ActiveMerchant::Billing::Check.new(

   :account_holder_type=> "personal",
   :account_number=>      "number", 
   :account_type =>       "checking/savings", 
   :name=>                "name",
   :routing_number=>      "routing_number")

  end
 end

You will have to have the Y's bank routing number and bank account number if you want to directly deposit funds into Y's account.

First you will need to setup Active Merchant in your rails app. Use the plugin or gem:

rails plugin install git://github.com/Shopify/active_merchant.git

gem 'activemerchant'

After you got that installed on your app you will need to sign up with a gateway. Heres a full list of supported gateways https://github.com/Shopify/active_merchant/wiki/gatewayfeaturematrix

These railscasts will get help get you started on Active Merchant:

http://railscasts.com/episodes/144-active-merchant-basics

http://railscasts.com/episodes/145-integrating-active-merchant

To use a bank instead of a credit card, create a new method in the Order model if you are following the railscast

 def bank_account
  @bank_account ||= ActiveMerchant::Billing::Check.new(

   :account_holder_type=> "personal",
   :account_number=>      "number", 
   :account_type =>       "checking/savings", 
   :name=>                "name",
   :routing_number=>      "routing_number")

  end
 end
洋洋洒洒 2024-11-11 14:13:16

首先选择第三方来处理您的交易。然后使用他们的 API 来完成它。例如,如果您选择 PayPal,则可以使用这些 gem(我自己没有使用过它们,因此在决定使用什么之前请检查它们):

First choose a third party to handle your transactions. And then use their API to do it. For example if you choose PayPal you can use these gems (I have not used them myself, so do check on them before you come to a decision on what to use):

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