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"
}
)
This successfully returns a paymentIntent object with id ('pi_yyy'), client_secret ('pi_yyy_secret_zzz'), status ('requires_payment_method') and more fields.
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
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-acceptance-guide
For those who are still wondering with this issue,
These errors are usually caused by either a mismatch in API keys or by trying to access objects that exist on a different account. Double check your publishableKey and secret key from your console both from the same account.
In my case, I got to explicitly specify the payment intent account:
const refund = await stripe.refunds.create({
payment_intent: stripe_payment_intent_id,
reason: 'requested_by_customer',
}, {
stripeAccount: account_id,
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With