简体   繁体   English

stripe.customers.createBalanceTransaction 不是 function 错误

[英]stripe.customers.createBalanceTransaction is not a function error

I am struggling with a Type Error when trying to implement stripe's createBalanceTransaction function.我在尝试实现条带的 createBalanceTransaction function 时遇到类型错误。 Here is the API reference for the function: https://stripe.com/docs/api/customer_balance_transactions/create这是 function 的 API 参考: https://stripe.com/docs/api/customer_balance_transactions/create

The error: Unhandled error TypeError: stripe.customers.createBalanceTransaction is not a function错误: Unhandled error TypeError: stripe.customers.createBalanceTransaction is not a function

The code:编码:

const stripe = require('stripe')(functions.config().stripe.livekey);

return stripe.customers.createBalanceTransaction(
    customer, 
    {
      amount:       balanceAmt,
      currency:     'usd',
      description:  'proration'
    }
  ).then(result => {
// ...
});

I have ensured that the inputs to the function are valid, and that stripe is configured correctly prior to the function call.我已确保 function 的输入有效,并且在 function 调用之前正确配置了条带。 I have several other stripe API functions working properly, the issue seems to be exclusive to createBalanceTransaction我还有其他几个条纹 API 功能正常工作,这个问题似乎是 createBalanceTransaction 独有的

The CustomerBalanceTransaction APIs are only available in the Node SDK v7.2.0 or higher. CustomerBalanceTransaction API 仅在节点 SDK v7.2.0 或更高版本中可用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM