繁体   English   中英

条带连接费用 - 必须作为连接帐户进行身份验证才能使用客户参数

[英]Stripe Connect Charge - Must authenticate as a connected account to be able to use customer parameter

我正在尝试设置Stripe Connect并且需要

  1. 首先创建客户,向买方收取费用,
  2. 然后生成一个令牌,最后
  3. 使用此令牌向客户收费。

只要买方和卖方不是Stripe Connect平台的所有者,这种方法就可以正常工作。

即,我们假设以下电子邮件对应于帐户持有者:

admin@admin.com

现在,我们有两个卖家:

seller_1@sellers.com
admin@admin.com

我们有一个买家:

buyer_1@buyers.com

buyer_1seller_1购买时,我的代码有效。 一切顺利,并收取申请费。

然而,当buyer_1想要从admin@admin.com购买时,问题就出现了。 尽管admin@admin.com已连接到帐户平台(我通过与seller_1相同的流程),但我仍然收到错误消息:

message: "Must authenticate as a connected account to be able to use customer parameter. See https://stripe.com/docs/api#create_card_token for more details."
param: "customer"
raw: Object
rawType: "invalid_request_error"
requestId: "req_8EtIue0F4JWFmQ"
stack: 400
type: "StripeInvalidRequestError"

我使用以下教程来保存客户并向客户收费

// store
// 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
var stripe = require("stripe")("SECRETKEY");

// (Assuming you're using express - expressjs.com)
// Get the credit card details submitted by the form
var tokenID = request.body.stripeToken;

// Create a Customer
stripe.customers.create({
  source: tokenID,
  description: "Example customer"
}, function(err, customer) {

});

// Create token
// Create a Token from the existing customer on the platform's account
stripe.tokens.create(
  { customer: CUSTOMER_ID, card: CARD_ID },
  { stripe_account: CONNECTED_STRIPE_ACCOUNT_ID }, // id of the connected account
  function(err, token) {
    // callback
  }
);

我知道这个问题不是最近的,但我在开发测试中多次遇到过同样的问题。 当我执行db时,问题得到解决:重置或删除用户(客户帐户)并重新授权。

事实证明,对于同一个用户,我有重复的连接帐户,对于旧计划和api_key是旧的。

自从我进行开发和测试以来,我还发现在仪表板>业务设置>数据>删除所有测试数据时从Stripe清除测试数据很有用

希望有所帮助。

同样的事情发生在我身上。 这有点欺骗,因为Stripe允许您将帐户直接连接到设置中的同一帐户(其中显示“测试OAuth流程”),就像单个帐户同时充当平台和连接帐户一样。 但是,当您尝试在已连接帐户上实际创建费用或客户时,会出现上述错误。

使用Stripe Connect测试费用时遇到了这个问题。 事实证明,当我完成将测试业务连接到我的应用程序(通过他们提供的Connect To Stripe测试页面)的过程时,我也已经在另一个浏览器窗口中登录了我的应用程序的Stripe帐户。 这最终保存了我的应用程序的帐户数据,而不是新的“测试业务”,这导致收费失败并出现该错误。

当我经历了从Stripe注销的相同过程时,它工作正常并且正常处理费用。

答案是简单地将客户ID更改为客户,并将卡作为来源。

您可以在此处找到Stripe Connect with Ionic的工作示例的完整源代码

https://www.noodl.io/market/product/P201601151251248/stripe-connect-guide-with-complete-source-code-all-you-need-to-start-accepting-money-on-behalf-of-其他

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM