在Rails中向银行帐户条带支付

时间:2016-04-21 23:00:53

标签: ruby-on-rails stripe-payments stripe-connect

我正在尝试自动从网站转帐到用户的银行帐户。这样做的正确方法是什么?

我首先尝试使用JS调用创建银行帐户拳头:

  Stripe.bankAccount.createToken({
    country: 'US',
    currency: 'USD',
    routing_number: routing_number,
    account_number: account_number,
    account_holder_name: account_holder_name,
    account_holder_type: account_holder_type
  }, function(status, response) {
    token_input.val(response.id);
    form.submit();
  });

我收到了Stipe的回复:

{id: "btok_8JTQwnYQQAEAlF", object: "token", bank_account: …}

在服务器端,我尝试使用token()

Stripe::Transfer.create(
    :amount => 400,
    :currency => "usd",
    :destination => params['bank_account_token'],
    :description => "Payout"
  )

但是我得到Stripe的反应是:

No such destination: btok_8JThh75QpdnB4m

将资金从Stripe转移到任何美国银行账户的方式是什么?

0 个答案:

没有答案
相关问题