javascript - Stripe 业务资料未显示在请求正文中

标签 javascript php stripe-payments

我处于测试模式,我在前端使用 JavaScript 并在后端使用 PHP 成功创建了一个自定义连接帐户。

帐户创建成功,但由于某种原因,业务资料未显示在请求正文中(我在仪表板中的 strip 日志中看到了这一点)。

我在提交表单之前看到一条警告消息: business_profile 不是可识别的参数

以下是我在测试时使用的 API 编码,供您引用: https://stripe.com/docs/api/accounts/create?lang=php#create_account-business_profile

JavaScript

const accountResult = await stripe.createToken('account', {
    business_type: 'company',
    company: {...},
    business_profile: {
      mcc: "5812",
      support_email: "test@example.com",
      url: "https://example.com",
    },
    tos_shown_and_accepted: true,
});

PHP

// ...
$account = \Stripe\Account::create([
    "country" => "FR",
    "type" => "custom",
    "account_token" => $account_token,
]);
// ...

最佳答案

stripe.createToken 不采用 business_profile 值,也不管理 Stripe\Account 对象 - 它创建 a Stripe\Token 。您必须通过单独调用 Stripe API 来更新该信息。它确实采用的参数是are documented here:

name, address_line1,address_line2, address_city, address_state, address_zip, address_country, currency

关于javascript - Stripe 业务资料未显示在请求正文中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58318879/

相关文章:

javascript - 在 Javascript 中链接 promise 结果

php - 两个词之间的空格和链接问题

ruby-on-rails - Rails 6 访问凭据不起作用?

javascript - 如何在不使用 Stripe 的 UI 层的情况下获取客户端 token ?

javascript - 在 TWebbrowser 中禁用同源策略

javascript - 如何从非标准日期格式在 Javascript 中创建新的 Date()

php - 如何使用 XSLT 创建 PHP/JSP/ERB 标签?

php - 比较表中同一列的不同行

Laravel/Stripe : Server aborted the SSL

javascript - d3标线具有填充颜色?