由于未定义stripe.paymentIntents,因此无法检索setupIntent

时间:2019-09-12 18:34:31

标签: node.js stripe-payments

遵循本指南(https://stripe.com/docs/payments/checkout/subscriptions/updating)来通过 Stripe checkout 来收集付款明细,但在步骤4中全部失败,因为未定义stripe.setupIntents。

有人知道什么可能是错误的吗?

const stripe = require("stripe")("sk_test_key_here");

 ...   

case "checkout.session.completed":

  if (event.data.object.setup_intent) {

    if (stripe.setupIntents) {
      const setupIntent = stripe.setupIntents.retrieve(
        event.data.object.setup_intent
      );

UnhandledPromiseRejectionWarning:TypeError:无法读取未定义的属性“检索”

0 个答案:

没有答案