创建客户帐户条带nodejs时出现问题

Problem creating customer account stripe nodejs

我在节点中创建条带客户帐户时遇到问题。

所有代码:

 const customer = await stripe.customers.create({
  email: emailAddress,
  description: uid,
  name: name_lastname,
  address: {city: "Warszawa",
      country: "Poland",
      line1: "Testowa",
      line2: "22",
      postal_code: "00-001",
      state: "mazowieckie"
    },
  source: token,
  tax: {
        location: {
          source: 'billing_address',
        },
     },
});

如果我加税:{} 到 stripe.customers.create:

  tax: {
        location: {
          source: 'billing_address',
        },
     },

客户的帐户未创建,如果我将其删除并且代码如下所示,一切正常:

 const customer = await stripe.customers.create({
  email: emailAddress,
  description: uid,
  name: name_lastname,
  address: {city: "Warszawa",
      country: "Poland",
      line1: "Testowa",
      line2: "22",
      postal_code: "00-001",
      state: "mazowieckie"
    },
  source: token,
});

我用过这个link:https://stripe.com/docs/api/customers/object?lang=node

我只是想在创建客户端时给客户端适当的税率,这样它会根据账单地址中给定的国家/地区自动添加税率。

如果您查看特定于 Create Customer API 请求的文档,您会发现您可以添加的唯一 customer.tax 属性是 ip_address.

此外,税费不会自动添加,除非您使用其他工具或集成来处理。 Stripe Tax 是其中的一个选项,但并未涵盖所有用例。

一般来说,地址参数对于大多数用例来说应该没问题。