簡體   English   中英

無法向 Stripe Connect 銀行賬戶添加額外的驗證文件以啟用付款

[英]Can't add additional verification documents to Stripe Connect bank account to enable payouts

問題- 我使用哪些字段來創建正確的令牌來更新我的 Stripe 銀行賬戶以啟用付款?

我正在嘗試啟用我的 Stripe 銀行帳戶付款 - 在使用此測試路由和帳號( 測試號碼鏈接)觸發銀行帳戶所有權驗證狀態后,禁用了付款。

路由號碼:110000000,賬號:000999999991

我正在嘗試通過為我在使用這些測試號碼創建帳戶時收到的錯誤添加附加文檔來啟用付款。

當前到期的錯誤:

文件.bank_account_ownership_verification.files

嘗試 1:我嘗試使用這些字段更新帳戶但失敗

 account = { documents: { bank_account_ownership_verification: { files: this.file.value } } };

我收到一個 Stripe 錯誤消息:

無法識別的令牌創建參數參數:文檔不是可識別的參數。 這可能會導致您將來的集成出現問題。

嘗試 2:然后我嘗試使用以下這些字段更新帳戶,但再次未能看到任何付款狀態更改。

 account = { individual: { verification: { additional_document: { front: this.file.value, back: this.file2.value } } } };

我收到一個 Stripe 錯誤消息:

更新帳戶時出錯。 如果帳戶已驗證,則無法通過 API 更改individual[verification][additional_document][front] 請通過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; }); } });

簡短的回答是,您無法使用帳戶令牌來做到這一點。

目前,Account Tokens 不支持documents散列,因此傳入documents.bank_account_ownership_verification將不起作用。 當您直接(而不是通過令牌)更新帳戶時,您唯一的選擇是傳入documents.bank_account_ownership_verification (請參閱apiref )。

我在使用 curl api 上傳銀行帳戶所有權驗證文件時也出錯。

請參閱我下面的代碼,請幫我解決它。

/* for upload bank_account_ownership_verification document start  */ 

$curl = curl_init();

    $additional_document = "path_of_document/example.png";
     
    $file_contents = file_get_contents($additional_document);    
    $boundary = uniqid();

$content =  "--".$boundary."\r\n".
            "Content-Disposition: form-data; name=\"file\"; filename=\"".basename($additional_document)."\"\r\n".
            "Content-Type: image/png\r\n\r\n".
            $file_contents."\r\n";

// add some POST fields to the request too: $_POST['foo'] = 'bar'
$content .=  "--".$boundary."\r\n".
            "Content-Disposition: form-data; name=\"purpose\"\r\n\r\n".
            "account_requirement\r\n";

// signal end of request (note the trailing "--")
$content .= "--".$boundary."--\r\n";

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://files.stripe.com/v1/files",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_POSTFIELDS => $content,
  CURLOPT_HTTPHEADER => array(
    "authorization: Bearer ".$key,
    "cache-control: no-cache",
    "content-type: multipart/form-data; boundary=".$boundary,
    "stripe-account: ".$acc_id
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {

  $account_requirement = json_decode($response,true);  
  $account_requirement_file_id = $account_requirement['id'];
}
/* for upload bank_account_ownership_verification document end */ 


/* link bank_account_ownership_verification document start  */ 
$curl = curl_init();

$attach_file_arr = array(
              'documents' => array("bank_account_ownership_verification" => array("files" => $account_requirement_file_id))
            );

$attach_file_arr_string = http_build_query($attach_file_arr);

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.stripe.com/v1/accounts/".$acc_id,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => $attach_file_arr_string,
  CURLOPT_HTTPHEADER => array(
    "authorization: Bearer ".$key,
    "cache-control: no-cache",
    "content-type: application/x-www-form-urlencoded"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  print_r($response);
}
/* link bank_account_ownership_verification document end */ 

但它返回如下錯誤:

{ "error": { "message": "Invalid array", "param": "documents[bank_account_ownership_verification][files]", "type": "invalid_request_error" } }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM