【问题标题】:Error: Unhandled Rejection (TypeError): Cannot read property 'id' of undefined错误:未处理的拒绝(TypeError):无法读取未定义的属性“id”
【发布时间】:2021-01-13 20:15:51
【问题描述】:

我一直在尝试将条带添加到我目前正在尝试获得 MVP 的应用程序中。每当我输入测试信用卡并单击发送时,我都会被发送到带有以下错误代码的屏幕。

Error: Unhandled Rejection (TypeError): Cannot read property 'id' of undefined

db.collection("users")
  .doc(user?.uid)
  .collection("orders")
  .doc(paymentIntent.id)
  .set({
    basket: basket,
    amount: paymentIntent.amount,
    created: paymentIntent.created,
  });

【问题讨论】:

  • 看来paymentIntent 为空

标签: reactjs google-cloud-firestore stripe-payments


【解决方案1】:

这里的错误很明显。看起来您的 paymentIntentundefined

【讨论】:

    猜你喜欢
    • 2019-07-19
    • 2020-04-29
    • 1970-01-01
    • 1970-01-01
    • 2019-01-24
    • 2019-04-07
    • 2021-12-13
    • 2021-05-06
    • 1970-01-01
    相关资源
    最近更新 更多