在Stripe Connect中使用帐户ID而不是“标记化”源

时间:2019-04-11 20:09:41

标签: ruby stripe-payments

遵循此处的指南:https://stripe.com/docs/connect/quickstart

第2步显示了创建以结尾的帐户

curl https://connect.stripe.com/oauth/token \
  -d client_secret=xx\
  -d code="{AUTHORIZATION_CODE}" \
  -d grant_type=authorization_code
The response includes the user’s account ID, which you’ll need in Step 3. (You can also find it in the Dashboard; it’ll be something like acct_9kYI2P9tA3ruC9Ig.)

现在我有一个acct...,太好了。但是,在步骤3中,source字段是token

帐户是否适用于来源?帐户->标记化来源是否有转换过程?

# Set your secret key: remember to change this to your live secret key in production
# See your keys here: https://dashboard.stripe.com/account/apikeys
Stripe.api_key = 'xxx'

charge = Stripe::Charge.create({
  amount: 1000,
  currency: "usd",
  source: "tok_visa",
  transfer_data: {
    destination: "{CONNECTED_STRIPE_ACCOUNT_ID}",
  },
})
The example uses a test token—tok_visa—but you could tokenize a test card using Stripe.js and Elements or Stripe Checkout instead.

1 个答案:

答案 0 :(得分:0)

在第3步的示例中,他们要收取一些卡费用,然后将钱转入某个关联帐户。如果您需要从连接的帐户中的 转账,请转至https://stripe.com/docs/connect/account-debits部分:

charge = Stripe::Charge.create({
  amount: 1500,
  currency: 'usd',
  source: '{{CONNECTED_STRIPE_ACCOUNT_ID}}',
})
相关问题