gpt4 book ai didi

node.js - Stripe Connect PaymentIntent 错误 : No such payment_intent

转载 作者:行者123 更新时间:2023-12-03 12:13:08 30 4
gpt4 key购买 nike

我在我的 API 中使用了 strip 连接,我想更新和处理现有的支付意图。使用NodeJS stripe包创建paymentIntent成功

const paymentIntent = await stripe.paymentIntents.create(
{
payment_method_types: ["card"],
amount: 1499, // in cents
currency: "usd"
},
{
stripe_account: "acct_xxx"
}
)

这成功返回了一个带有 id ('pi_yyy')、client_secret ('pi_yyy_secret_zzz')、状态 ('requires_payment_method') 和更多字段的 paymentIntent 对象。

但是,当使用返回的支付意图 id 进一步更新支付意图或使用 client_secret 在前端调用 stripe.createPaymentMethod 时,会返回错误:
Error: No such payment_intent: pi_yyy

最佳答案

就我而言,我在 中看到了错误:没有这样的支付意图:pi_yyy浏览器 在没有将 stripeAccount 传递给 Stripe 的情况下确认 PaymentIntent 时。确保您传递的是 stripeAccount :

//pass stripeAccount to Stripe when using Stripe Connect in the browser
let stripe = Stripe(stripePublishableKey, {
stripeAccount: stripeAccountId,
})

let result = await stripe.confirmCardPayment(clientSecret,{
...
})
https://stripe.com/docs/connect/enable-payment-acceptance-guide

关于node.js - Stripe Connect PaymentIntent 错误 : No such payment_intent,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57624880/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com