Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/382.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript “更新条带帐户返回”;错误:条纹:";id";必须是字符串,但得到:object";_Javascript_Stripe Payments_Stripe Connect - Fatal编程技术网

Javascript “更新条带帐户返回”;错误:条纹:";id";必须是字符串,但得到:object";

Javascript “更新条带帐户返回”;错误:条纹:";id";必须是字符串,但得到:object";,javascript,stripe-payments,stripe-connect,Javascript,Stripe Payments,Stripe Connect,我正在尝试更新一个条带帐户,以添加一个外部帐户令牌,以便稍后进行收费,如示例所示 返回下面的 My Stripe ID: acct_xxxxxxxxxxxxx stripeID var type: string [Error: Stripe: "id" must be a string, but got: object (on API request to `POST /accounts/{id}`)] 其中acct_uuxxxxxxxxxx是用户存储的帐户ID

我正在尝试更新一个条带帐户,以添加一个外部帐户令牌,以便稍后进行收费,如示例所示

返回下面的

     My Stripe ID:  acct_xxxxxxxxxxxxx
     stripeID var type:  string
    [Error: Stripe: "id" must be a string, but got: object (on API request to `POST /accounts/{id}`)]

其中acct_uuxxxxxxxxxx是用户存储的帐户ID。根据第一个console.log值,stripeID似乎是一个字符串而不是一个对象,这使我不确定如何处理此错误。

尽管文档指定

 stripe.accounts.update({
  {CONNECTED_STRIPE_ACCOUNT_ID},
  metadata: {internal_id: 42},
}).then(function(acct) {
  // asynchronously called
});`
以下几点对我有用

stripe.accounts.update(
           CONNECTED_STRIPE_ACCOUNT_ID,
           {
            metadata: {internal_id:42},
          }
          ).then((account) => {
         // response to successful action

在此处删除此
var
关键字:
var stripeID=stripeID[0]谢谢!我在更改变量名时意外地添加了这一点。不幸的是,即使var被移除,这仍然会导致相同的问题。你能找到解决方案吗?我认为这个问题很严重well@ShawnVarughese对条带帐户id应为字符串,而不是对象。我将回答这个问题以展示一个完整的例子。为了更清晰,我对答案进行了编辑。这目前在我的平台上运行。通过添加“{”给我syntex错误:(我面临同样的问题
stripe.accounts.update(
           CONNECTED_STRIPE_ACCOUNT_ID,
           {
            metadata: {internal_id:42},
          }
          ).then((account) => {
         // response to successful action