【问题标题】:Getting error when I try to payout to managed account当我尝试向客户账户付款时出现错误
【发布时间】:2016-09-11 00:24:29
【问题描述】:

尝试使用托管帐户进行付款。基本上,向用户收费,并将钱发送到托管账户而不是平台账户。我正在使用“共享客户”我正在使用此链接底部的代码https://stripe.com/docs/connect/shared-customers。检索令牌后,我尝试进行单次收费,但出现“未找到卡信息”的错误消息,但在创建令牌时我传递了 cardId

错误:message: "Could not find payment information"

Stripe.tokens.create(
 { customer: request.params.customerId, card: request.params.cardId },
 { stripe_account: 'acct_xyz' }, // id of the connected account
  function(err, token) {

  Stripe.charges.create(
 {
amount: 1000, // amount in cents
currency: "usd",
source: token,
description: "Example charge",
application_fee: 123 // amount in cents
},
function(err, charge) {
console.log(err);
 });
});

【问题讨论】:

    标签: javascript stripe-payments stripe-connect


    【解决方案1】:

    这对你有用吗?这里的主要区别是

    1. 我在stripe.charges.create 请求中包含{ stripe_account: 'acct_xyz' },如果使用共享客户,这需要在连接的帐户本身上发生。 https://stripe.com/docs/connect/payments-fees#charging-directly

    2. 我只使用令牌对象的 id 属性(例如 tok_xxxyyyzzz),而不是 token

    示例:

    // id of connected account you want to create customer on, charge
    var connectedAccountId = "acct_16MNx0I5dd9AuSl3";
    
    // id of customer and card you want to create a token from
    
    var platformCustomerId = "cus_8vEdBa4rQTGond";
    var platformCustomerCardId = "card_18dOAcFwTuOiiF4uwtDe2Nip";
    
    var stripe = require("stripe")(
      "sk_test_xxxyyyyzzz"
    );
    
        // create a token using a customer and card on the Platform account
        stripe.tokens.create(
          {customer: platformCustomerId, card: platformCustomerCardId },
          {stripe_account: connectedAccountId},
          function(err, token) {
            if (err)
              throw (err);
    
                stripe.charges.create({
                  amount: 4444,
                  currency: "usd",
                  source: token.id,
                  description: "Charge on a connected account",
                  application_fee: 1111
                },
                {stripe_account: connectedAccountId},
                function(err, charge) {
                  if (err)
                    throw (err);
                  console.log(charge);
                });
            });
    

    或者,正如您所说,您使用的是托管账户,您可能需要考虑通过平台收费,这样您就可以完全避免共享客户流程,请参阅此处以获取示例,https://stripe.com/docs/connect/payments-fees#charging-through-the-platform

    【讨论】:

    • id 是为我做的。谢谢队友:)
    猜你喜欢
    • 2015-03-01
    • 2020-09-03
    • 1970-01-01
    • 2023-03-23
    • 2013-09-03
    • 1970-01-01
    • 2018-03-20
    • 2016-05-09
    • 1970-01-01
    相关资源
    最近更新 更多