#Nick Ortega

1 messages · Page 1 of 1 (latest)

violet pulsarBOT
tepid elbow
#

Hi, yes you can. Have you tried it? Are you seeing any errors?

split kelp
#

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

tepid elbow
split kelp
#

yes one second i can get it for you

#

req_G0ECgMH8no4Cuf

tepid elbow
#

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

split kelp
#

Ohhhh

#

Is that something I can add within the parameters of the create PaymentIntent?

tepid elbow
#

I'm unsure what you're asking here, can you add more context?

split kelp
#

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

tepid elbow
split kelp
#

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?

tepid elbow
#

So you just want to make the Payment intent update call before the second request

split kelp
#

The second request is the confirm payment correct?

tepid elbow
#

That is correct

split kelp
#

Okay last question, would that go into the Payment.js file? Or in the CheckoutForm.js file?

tepid elbow
#

That would go on your server side code.