Stripe Connect PaymentIntent 错误:没有这样的 payment_intent [英] Stripe Connect PaymentIntent error: No such payment_intent
问题描述
我在我的 API 中使用了条带连接,我想更新和处理现有的支付意图.使用NodeJS条带包创建paymentIntent成功
I'm using stripe connect in my API, and I would like to update and process an existing paymentIntent. The paymentIntent creation is successful using the NodeJS stripe package
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 对象.
This successfully returns a paymentIntent object with id ('pi_yyy'), client_secret ('pi_yyy_secret_zzz'), status ('requires_payment_method') and more fields.
但是,当使用返回的支付意图 id 进一步更新支付意图或使用 client_secret 在前端调用 stripe.createPaymentMethod 时,会返回错误:
However, when using the returned payment intent id to further update the payment intent or calling stripe.createPaymentMethod on the frontend with the client_secret, an error is returned:
Error: No such payment_intent: pi_yyy
推荐答案
在我的例子中,我在 BROWSER 中看到了错误:没有这样的 payment_intent: pi_yyy 在没有将 stripeAccount 传递给 Stripe 的情况下确认 PaymentIntent 时.确保您传递的是 stripeAccount
:
In my case I saw Error: No such payment_intent: pi_yyy in the BROWSER when confirming a PaymentIntent without passing stripeAccount to Stripe. Make sure you're passing a 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-验收指南
这篇关于Stripe Connect PaymentIntent 错误:没有这样的 payment_intent的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!