#Nick Ortega
1 messages · Page 1 of 1 (latest)
Hi, yes you can. Have you tried it? Are you seeing any errors?
Yes I have but every time I try to call the update it mentions that the payment intent doesn’t exist yet. And then it doesn’t capture the customer I want it attached to.
Let show you the images of the errors, give me a moment
Can you share the request id with me? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
The reason why you're seeing this error is because this Payment Intent already succeeded, pi_3McFJjFtS0oTWMGc1wMVecQ9. You cannot update a succeeded intent, you can only update Payment Intents in `requires_payment_method, requires_confirmation, requires_action.' statuses
I'm unsure what you're asking here, can you add more context?
In the server.js file I have the create and update payment intent, in the CheckoutForm.js file I am fetching those endpoints but I realize that the confirm payment intent happens before the update can do anything.
Not sure where I can update the paymetintent without having it break my code
You can set the confirm on the Payment Intent to false: https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirmation_method so it's not confirming before you can update the Payment Intent.
Then, yo u can confirm the Payment Intent, https://stripe.com/docs/api/payment_intents/confirm
app.post("/create-payment-intent", async (req, res) => {
try {
const paymentIntent = await stripe.paymentIntents.create({
currency: "usd",
amount: "1000",
statement_descriptor: "Ortegalive Software",
automatic_payment_methods: {
enabled: true,
},
});
res.send({ clientSecret: paymentIntent.client_secret });
} catch (e) {
return res.status(400).send({
error: {
message: e.message,
},
});
}
});
So i would input confirmation_method: false, within the code above, is that right?
Or would it be manual in this case?
Actually, that is the default here. You're creating the Payment Intent here: https://dashboard.stripe.com/test/logs/req_yQ7mi5p65Re4ff and then, calling the confirm here: https://dashboard.stripe.com/test/logs/req_MmUOcGQyl5F0DV
So you just want to make the Payment intent update call before the second request
The second request is the confirm payment correct?
That is correct
Okay last question, would that go into the Payment.js file? Or in the CheckoutForm.js file?
That would go on your server side code.