如何使用PHP更新stripe的legal_entity.verification.document?
是上传到条带的文件。
答案 0 :(得分:6)
legal_entity[verification][document]
属性应设置为file upload的ID。
This part文档介绍了如何使用Stripe API上传文件,this part说明了如何将上传的文件附加到客户帐户。
答案 1 :(得分:0)
您需要先将文件以multipart / form-data格式传递给服务器。获取路径并在Stripe FileUpload函数中添加路径。
您甚至可以通过将文件手动保存在服务器目录中来测试文件上载,并将文件路径传递给该函数。 以下是样本。
$account = \Stripe\Account::retrieve('acct_xxxxxxxxxxx');
$uploadedFile = \Stripe\FileUpload::create(
array("purpose" => "identity_document",
"file" => fopen('file.png', 'r')
)
);
您将获得带有文件ID的成功上传响应,您需要传递legal_entity.verification.document中的此ID:
$account->legal_entity->verification->document = $uploadedFile->id;
$account->save();