无法向 Stripe Connect 银行账户添加额外的验证文档以启用付款

use*_*050 5 javascript stripe-payments typescript

问题- 我应该使用哪些字段来创建正确的令牌来更新我的 Stripe 银行账户以启用付款?

我正在尝试启用我的 Stripe 银行帐户付款 - 在使用此测试路由和帐号(测试号链接)触发银行帐户所有权验证状态后,这会禁用付款。

路由号码:110000000,帐号:000999999991

我正在尝试通过添加附加文档来启用付款,以解决在使用这些测试号码创建帐户时收到的错误。

当前由于错误:

文件.bank_account_ownership_verification.files

尝试 1:我尝试使用这些字段更新帐户但失败

account = {
  documents: {
    bank_account_ownership_verification: {
      files: this.file.value
    }
  }
};
Run Code Online (Sandbox Code Playgroud)

我收到 Stripe 错误:

无法识别的令牌创建参数参数:文档不是可识别的参数。这可能会导致您将来的集成出现问题。

尝试 2:然后我尝试使用下面的这些字段更新帐户,但再次未能看到任何付款状态更改。

account = {
  individual: {
    verification: {
      additional_document: {
        front: this.file.value,
        back: this.file2.value
      }
    }
  }
};
Run Code Online (Sandbox Code Playgroud)

我收到 Stripe 错误:

更新帐户时出错。individual[verification][additional_document][front]如果帐户经过验证,则无法通过 API 进行更改。请通过 ht 联系我们

仅供参考 - 我可以通过两次尝试生成帐户令牌,但都无法使用 Stripe 更新帐户以启用付款

以下是生成帐户令牌的代码,然后将其传递到我的服务器,在服务器上调用 Stripe API 来更新帐户:

// attempt 1
let account = {
  tos_shown_and_accepted: true,
  documents: {
    bank_account_ownership_verification: {
      files: this.file.value
    }
  }
};
// attempt 2
let account = {
  tos_shown_and_accepted: true,
  individual: {
    verification: {
      additional_document: {
        front: this.file1.value,
          back: this.file2.value
        }
      }
   }
};

from(this.stripe.createToken('account', account)).pipe(take(1)).subscribe((result: any) => {

  if (result.error) {
    this.alertService.danger(result.error.message);
  } else {

    this.accountService.updateStripeAccount(this.route.snapshot.paramMap.get('id'), result.token.id).subscribe(() => {
      this.router.navigate(['/account/banks/accounts']);
      this.alertService.info("Account updated successfully");
    }, error => {
      console.log(error);
    }).add(() => {
      this.loadingAccount = false;
    });

  }
});
Run Code Online (Sandbox Code Playgroud)

小智 2

简而言之,您无法使用帐户令牌来执行此操作。

目前,帐户令牌不支持documents哈希,因此传递documents.bank_account_ownership_verification不起作用。您唯一的选择是在直接更新帐户(而不是通过令牌)时传入documents.bank_account_ownership_verification(请参阅apiref )。